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.
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
| Method | Path | Description |
|---|---|---|
| POST | /v1/messages | Anthropic-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_tokens | Token count for a prospective request, same shape as the provider's own endpoint. |
| POST | /v1/responses | OpenAI 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/models | What 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
| Method | Path | Description |
|---|---|---|
| GET | /api/me | The account the presented token belongs to. |
| GET | /api/wallet | Current balance and credit state. |
| GET | /api/ledger | Double-entry movements behind the balance. |
| GET | /api/usage/summary | Aggregate spend, tokens and saving for a filter. |
| GET | /api/usage/messages | Message-level history across every conversation. |
| GET | /api/conversations | Conversations, newest first; open one for its turns. |
| GET | /api/jobs | Jobs and their state. |
| GET | /api/jobs/{id}/stream | Server-sent events for a running job. |
| GET | /api/pricing | The active rate card — per-model list prices. |
| GET | /api/tokens | Your API tokens. POST to create, DELETE to revoke. |
Platform API — sellers
| Method | Path | Description |
|---|---|---|
| GET | /api/my/nodes | Seats you have connected, with budget and earning state. |
| POST | /api/nodes/connect | Connect a provider account as a seat. |
| POST | /api/nodes/{id}/plan | Declare the subscription tier a seat is on. |
| POST | /api/nodes/{id}/availability | List or unlist a seat. |
| POST | /api/nodes/{id}/drain | Stop new routing; let in-flight work finish. |
| POST | /api/seller/usage | Report your own usage of a connected account (token digests only). |
| GET | /api/earnings | What 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.
| Status | Meaning |
|---|---|
401 | Token missing, malformed or revoked. |
402 | Insufficient credit. Top up and retry; nothing was served. |
503 | overloaded_error — no seat could serve the request. Either nothing is connected for that lane, or every candidate seat failed. Retry with backoff. |