DOCS · API REFERENCE

One endpoint you already know, plus the platform around it

The completion endpoint is wire-compatible with the clients most people already run, so nothing in your code changes — only where it points. Everything else — wallet, history, seats, earnings — is a small JSON API under /api.

Private betaBase URL issued with your invite

Authentication

Every request carries your Shaidle token. Both header forms are accepted, so a client written for either provider convention works without modification:

Authorization: Bearer sk-shaidle-…
# or
x-api-key: sk-shaidle-…

Tokens are minted in the app under Connect editor, shown once, and can be revoked individually. Revoking a token ends that client's access immediately; it has no effect on any provider account behind the exchange.

Wire-compatible endpoints

MethodPathDescription
POST/v1/messagesAnthropic-compatible completion. Streams byte for byte. Routed to whichever seat is idle, metered from the provider's own response, settled on completion.
POST/v1/messages/count_tokensToken count for a prospective request, same shape as the provider's own endpoint.
POST/v1/responsesOpenAI Responses-compatible completion — the wire the Codex CLI speaks. Streams byte for byte, or returns one JSON response if you did not ask for a stream.
GET/v1/modelsWhat the exchange can serve right now, read from connected seats' own model registries.

Example

curl https://<your-exchange-endpoint>/v1/messages \
  -H "Authorization: Bearer sk-shaidle-…" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Explain this stack trace."}]
  }'

model takes any model the exchange lists — Claude and Codex models are priced from the same rate card, and the one you name decides which lane serves you. The current card is on the pricing page.

Streaming works exactly as it does against the provider. If the seat serving you runs out of quota mid-request, the exchange fails over to another seat before any byte has been sent to you — you see one clean response, not a truncated one.

The Codex side

curl https://<your-exchange-endpoint>/v1/responses   -H "Authorization: Bearer sk-shaidle-…"   -H "content-type: application/json"   -d '{
    "model": "gpt-5.6-codex",
    "input": "Explain this stack trace."
  }'

The same exchange, on the wire OpenAI-side tools speak. Point the Codex CLI at it with a named provider in ~/.codex/config.toml (wire_api = "responses") — the Connect your editor screen prints the exact file. You stay signed out of ChatGPT; every turn is served from a connected seat and billed to your wallet.

Ask GET /v1/models with your token for the models the exchange can actually serve — it is the union of what connected seats report, not a list we maintain, so it follows the providers rather than lagging them.

Platform API — buyers

MethodPathDescription
GET/api/meThe account the presented token belongs to.
GET/api/walletCurrent balance and credit state.
GET/api/ledgerDouble-entry movements behind the balance.
GET/api/usage/summaryAggregate spend, tokens and saving for a filter.
GET/api/usage/messagesMessage-level history across every conversation.
GET/api/conversationsConversations, newest first; open one for its turns.
GET/api/jobsJobs and their state.
GET/api/jobs/{id}/streamServer-sent events for a running job.
GET/api/pricingThe active rate card — per-model list prices.
GET/api/tokensYour API tokens. POST to create, DELETE to revoke.

Platform API — sellers

MethodPathDescription
GET/api/my/nodesSeats you have connected, with budget and earning state.
POST/api/nodes/connectConnect a provider account as a seat.
POST/api/nodes/{id}/planDeclare the subscription tier a seat is on.
POST/api/nodes/{id}/availabilityList or unlist a seat.
POST/api/nodes/{id}/drainStop new routing; let in-flight work finish.
POST/api/seller/usageReport your own usage of a connected account (token digests only).
GET/api/earningsWhat each seat has earned, and what is still held.

Seat reporting is opt-in and sends counts, never content. The reasoning is in the compliance position.

Errors

Each wire endpoint answers in ITS OWN provider's error shape — Anthropic's {"type":"error","error":{…}} on /v1/messages, OpenAI's {"error":{"message":…,"type":…}} on /v1/responses — so an unmodified client renders the message natively instead of showing a parse failure.

StatusMeaning
401Token missing, malformed or revoked.
402Insufficient credit. Top up and retry; nothing was served.
503overloaded_error — no seat could serve the request. Either nothing is connected for that lane, or every candidate seat failed. Retry with backoff.