Subsplit logo
Subsplit
Split & save AI credits

API

After a successful payment/top-up, Subsplit issues you an API key (shown once), then only the prefix is visible later. Use your key as a Bearer token.

Authentication

Authorization: Bearer ss_live_xxxxx...

Try it with cURL

Use the Subsplit gateway endpoint. This proxies to our Azure OpenAI backend and charges your wallet based on token usage.

curl -sS \
  -X POST "http://subsplit.co/api/v1/chat/completions" \
  -H "content-type: application/json" \
  -H "authorization: Bearer ss_live_YOUR_KEY" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      { "role": "user", "content": "Say hello from Subsplit." }
    ]
  }'

Try it with Postman

- Method: POST
- URL: http://subsplit.co/api/v1/chat/completions
- Headers:
content-type: application/json
authorization: Bearer ss_live_YOUR_KEY
- Body: raw / JSON
{
  "model": "gpt-4o",
  "messages": [
    { "role": "user", "content": "What can I build with Subsplit?" }
  ]
}

Compute token cost

For a model with creditsPer1kTokens:

costCredits = ceil(tokens / 1000 * creditsPer1kTokens)

Subsplit charges by rounding up to avoid undercharging tiny requests.

Endpoints

GET /api/models — list models & rates
POST /api/credits/spend — spend by tokens & model (ledger entry)
GET /api/credits/transactions — ledger history
POST /api/v1/chat/completions — Subsplit gateway (calls Azure OpenAI, charges credits)
GET /api/sandbox/ping — test an API key (returns wallet)
POST /api/keys/create — create an API key (shown once)
POST /api/keys/revoke — retire an API key

Hackathon-ready mode (creative)

Subsplit is designed to be used in hackathons and teams: pool capacity, issue keys per project, loan credits to teammates, and keep an auditable ledger to avoid “who spent what?” arguments. It’s also ideal for creators who want predictable spend in a local market.