Skip to content

API Endpoints

The TokOne gateway exposes OpenAI-, Anthropic-, and Gemini-compatible protocols at once. This page lists the endpoints actually available.

Common configuration

ItemValue
Base URLhttps://api.tokone.ai (use your deployment domain)
Auth headerAuthorization: Bearer <key> / x-api-key: <key> / x-goog-api-key: <key>
Content typeapplication/json
Streamingadd "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

MethodPathNotes
POST/v1/chat/completionsChat Completions
POST/v1/embeddingsText embeddings (only when the key's group platform is OpenAI)
POST/v1/responsesOpenAI Responses API
GET/v1/modelsModel list
GET/v1/usageUsage query

Request/response shapes match OpenAI's, so point the official SDK's base_url at TokOne and go.

Anthropic-compatible endpoints

MethodPathNotes
POST/v1/messagesClaude Messages API
GET/v1/modelsModel 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:

MethodPathNotes
GET/v1beta/modelsModel list
GET/v1beta/models/:modelSingle model info
POST/v1beta/models/{model}:generateContentGenerate content
POST/v1beta/models/{model}:streamGenerateContentStreaming 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:

StatusMeaningCommon cause
400Bad requestMissing/malformed params; key sent via query param
401UnauthorizedAPI key missing, wrong, or disabled
402Insufficient balanceNot enough balance for this call
404Endpoint/model unavailableWrong path, or endpoint not applicable to the key's platform group
429Rate limitedToo many requests, retry later
5xxUpstream/gateway errorUpstream 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.