API Endpoints
The TokOne gateway exposes OpenAI-, Anthropic-, and Gemini-compatible protocols at once. This page lists the endpoints actually available.
Common configuration
| Item | Value |
|---|---|
| Base URL | https://api.tokone.ai (use your deployment domain) |
| Auth header | Authorization: Bearer <key> / x-api-key: <key> / x-goog-api-key: <key> |
| Content type | application/json |
| Streaming | add "stream": true; response is text/event-stream |
Most endpoints are also available as a root-path alias without the prefix (e.g. /chat/completions); prefer the /v1 form.
OpenAI-compatible endpoints
| Method | Path | Notes |
|---|---|---|
| POST | /v1/chat/completions | Chat Completions |
| POST | /v1/embeddings | Text embeddings (only when the key's group platform is OpenAI) |
| POST | /v1/responses | OpenAI Responses API |
| GET | /v1/models | Model list |
| GET | /v1/usage | Usage query |
Request/response shapes match OpenAI's, so point the official SDK's base_url at TokOne and go.
Anthropic-compatible endpoints
| Method | Path | Notes |
|---|---|---|
| POST | /v1/messages | Claude Messages API |
| GET | /v1/models | Model list |
Example:
bash
curl https://api.tokone.ai/v1/messages \
-H "x-api-key: $TOKONE_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-6",
"max_tokens": 512,
"messages": [{ "role": "user", "content": "Hello" }]
}'Gemini-compatible endpoints
Native Gemini style under /v1beta, with model:action in the path:
| Method | Path | Notes |
|---|---|---|
| GET | /v1beta/models | Model list |
| GET | /v1beta/models/:model | Single model info |
| POST | /v1beta/models/{model}:generateContent | Generate content |
| POST | /v1beta/models/{model}:streamGenerateContent | Streaming generation |
Example:
bash
curl "https://api.tokone.ai/v1beta/models/gemini-3.5-flash:generateContent" \
-H "x-goog-api-key: $TOKONE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{ "parts": [{ "text": "Hello" }] }]
}'Error codes
TokOne follows the standard HTTP status codes of each compatible protocol:
| Status | Meaning | Common cause |
|---|---|---|
| 400 | Bad request | Missing/malformed params; key sent via query param |
| 401 | Unauthorized | API key missing, wrong, or disabled |
| 402 | Insufficient balance | Not enough balance for this call |
| 404 | Endpoint/model unavailable | Wrong path, or endpoint not applicable to the key's platform group |
| 429 | Rate limited | Too many requests, retry later |
| 5xx | Upstream/gateway error | Upstream temporarily unavailable, retry |
Client examples
Point any OpenAI-compatible SDK's base_url at https://api.tokone.ai/v1 and set api_key to your sk- key — see Quick Start.