OpenAI via Spawnpay

Call gpt-4o / gpt-4o-mini / DALL-E through a single spk_ key with USDC billing and unified receipts.

BYOK $0.001 / 2xx No reselling — your upstream relationship stays exactly as it is.

Why route through Spawnpay

Letting Claude Code agents call GPT-4 as a fallback. Letting your tool fan out to multiple LLMs and bill end-users per call. Centralising OpenAI spend across multiple AI agents under one budget.

Endpoint

Method
POST
Upstream path
/v1/chat/completions
Upstream auth
Authorization
Auth note
Pass your OpenAI key in X-Provider-Key — Spawnpay rewrites it to "Authorization: Bearer …" upstream.
Routing fee
$0.001 USDC per upstream 2xx (4xx is free)
Provider docs

curl

curl -X POST https://spawnpay.ai/api/proxy \
  -H 'Authorization: Bearer spk_live_…' \
  -H 'X-Provider-Key: $OPENAI_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "provider": "openai",
  "path": "/v1/chat/completions",
  "method": "POST",
  "body": {
    "model": "gpt-4o-mini",
    "messages": [
      {
        "role": "user",
        "content": "hello"
      }
    ]
  }
}'

Node (spawnpay-paywall)

import { proxy } from 'spawnpay-paywall';

const out = await proxy({
  "provider": "openai",
  "path": "/v1/chat/completions",
  "method": "POST",
  "body": {
    "model": "gpt-4o-mini",
    "messages": [
      {
        "role": "user",
        "content": "hello"
      }
    ]
  },
  "providerKey": process.env.OPENAI_KEY
});

console.log(out.status, out.body);
console.log('charged', out.charged); // txHash + $0.001 USDC receipt

What you get back

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.

▶ Try OpenAI live → 60-sec quickstart All providers