OpenAI SDK
Set base_url to the platform address plus /v1 and use a platform key. Works with the Python and Node SDKs and the official CLI.
Docs
Point your base_url at TokenPP and call every listed model with a platform key. Bodies match the official protocols, so existing code usually only needs a new base_url and key.
From sign-up to your first response: create a key, add credit, change the base_url.
Sign in and create a key on the console API Keys page. Keys look like sk-tpp-…, are shown in full only once, and are listed by prefix afterwards. Store it somewhere safe right away.
Billing is prepaid. Top-ups and redemption codes credit your balance immediately. With a zero balance, requests return 402.
OpenAI-compatible clients use the platform address plus /v1. Anthropic-compatible clients (Claude Code, Anthropic SDK) use the platform address alone and the SDK appends /v1/messages. The quick-start card on the console overview shows the actual address of your deployment and copies it in one click.
curl https://<platform-host>/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-tpp-..." \
-d '{
"model": "deepseek-v4.1-flash",
"messages": [{ "role": "user", "content": "ping" }]
}'Any client that lets you override base_url can be pointed here. These are the usual setups.
Set base_url to the platform address plus /v1 and use a platform key. Works with the Python and Node SDKs and the official CLI.
In Settings → Models, enable OpenAI API Key, paste a platform key, and set Override OpenAI Base URL to the platform address plus /v1.
Set ANTHROPIC_BASE_URL to the platform address without /v1 and ANTHROPIC_AUTH_TOKEN to a platform key.
Any HTTP client that can change base_url and the Authorization header works. Keep the body in the official OpenAI or Anthropic shape.
The platform exposes both OpenAI and Anthropic compatible entry points and authenticates them the same way: Authorization: Bearer <platform key>. Anthropic clients may also use the x-api-key header.
| Endpoint | Protocol | Notes |
|---|---|---|
| POST/v1/chat/completions | OpenAI | Chat completions with SSE streaming |
| POST/v1/responses | OpenAI | Responses API with SSE streaming |
| POST/v1/messages | Anthropic | Messages API with SSE streaming |
| GET/v1/models | OpenAI | Lists sellable models with unit prices; models without a price are omitted |
All three chat endpoints support SSE. Turn it on for long answers.
You pay for the tokens actually used, with no subscription tiers.
Gateway errors follow the OpenAI error shape: error.message, error.type, error.code, error.param.
| HTTP | code | Meaning |
|---|---|---|
| 401 | invalid_api_key | Key missing, invalid or deleted |
| 401 | key_disabled | This key is disabled |
| 401 | key_expired | This key has expired |
| 403 | account_disabled | The account is disabled |
| 402 | insufficient_balance | Balance too low to place the hold |
| 402 | insufficient_quota | This key has used up its quota |
| 400 | invalid_body | Body is not valid JSON, or model is missing |
| 404 | model_not_found | Model does not exist or is not listed |
| 429 | rate_limited | RPM, TPM or concurrency limit for this key was hit |
| 503 | upstream_unavailable | The service is temporarily unavailable. Try again later. |
OpenAI-compatible clients use the platform address plus /v1; Anthropic-compatible clients use the platform address alone. The console overview copies the real address of your deployment for you.
The model is not listed, or has no price configured. Check the model pricing page for the slug.
Make sure the header is Authorization: Bearer <platform key> and that you are using a platform key starting with sk-tpp-. A disabled or expired key also returns 401.
Usually the connection dropped, or no data arrived long enough to hit the idle timeout. Handle an early close and retry if needed. Usage already generated is still billed and logged.
The console usage page lists token breakdown and charged amount per request, grouped by model and key.