Hosted open-source models (Llama, Qwen, DeepSeek, FLUX) — Spawnpay wraps every call with a USDC receipt and shared budget.
Agentic pipelines that mix LLM + image generation under one billing layer. Open-source-model-first products that still need clean cost recovery.
POST/v1/chat/completionsAuthorization$0.001 USDC per upstream 2xx (4xx is free)curl -X POST https://spawnpay.ai/api/proxy \
-H 'Authorization: Bearer spk_live_…' \
-H 'X-Provider-Key: $TOGETHER_KEY' \
-H 'Content-Type: application/json' \
-d '{
"provider": "together",
"path": "/v1/chat/completions",
"method": "POST",
"body": {
"model": "meta-llama/Llama-3.1-70B-Instruct-Turbo",
"messages": [
{
"role": "user",
"content": "hello"
}
]
}
}'
import { proxy } from 'spawnpay-paywall';
const out = await proxy({
"provider": "together",
"path": "/v1/chat/completions",
"method": "POST",
"body": {
"model": "meta-llama/Llama-3.1-70B-Instruct-Turbo",
"messages": [
{
"role": "user",
"content": "hello"
}
]
},
"providerKey": process.env.TOGETHER_KEY
});
console.log(out.status, out.body);
console.log('charged', out.charged); // txHash + $0.001 USDC receipt
The full upstream JSON body, the upstream status code, the upstream response headers, plus a charged field with the USDC receipt (tx hash) when the call succeeded.