API reference
Three wire formats, one key, one base URL: https://api.turboprivate.ai.
Authentication
Authorization: Bearer tp_live_…
# or, for clients that send an API key header
x-api-key: tp_live_…
Keys are created and revoked in the app. Revoking takes effect immediately, including for any short-lived token that key has issued.
Short-lived tokens
curl -X POST https://api.turboprivate.ai/v1/token -H "Authorization: Bearer tp_live_…"
# -> { "token": "tps_…", "expires_at": … } valid for one hour
Useful when a credential has to sit in a config file. The CLI wires this into Claude Code's
apiKeyHelper automatically, so a stolen settings file is worthless within the hour.
Endpoints
| method | path | format |
|---|---|---|
| POST | /v1/messages | Anthropic Messages, streaming or not |
| POST | /v1/messages/count_tokens | token estimate |
| POST | /v1/responses | OpenAI Responses |
| POST | /v1/chat/completions | OpenAI Chat Completions |
| GET | /v1/models | what we serve, with prices and context |
A first request
curl https://api.turboprivate.ai/v1/chat/completions \
-H "Authorization: Bearer $TURBOPRIVATE_API_KEY" \
-H "content-type: application/json" \
-d '{"model":"ds-flash","messages":[{"role":"user","content":"hi"}]}'
Behaviour worth knowing
- Tools work on all three formats, including the full call → result → answer loop.
- Unknown model names resolve rather than erroring, so a client that hard-codes a name we do not serve still works.
- Streams are kept alive with pings during long prefills, so a client's idle watchdog does not abort a request that is simply thinking.
- Errors are passed through with the upstream's own wording and status, because clients decide whether to retry by reading them.
- Fields we do not understand are ignored, never rejected — a newer client release cannot break on us.
- Limits: requests and concurrency are capped per key. Over the line you get
429withRetry-After. - No server, no service: if a model has no healthy server we answer
503and say so, rather than holding your request in a queue.