tokrouterdocs
API reference

API reference

TokRouter endpoints, common headers and error conventions.

.mdOpen in Claude

Every endpoint shares the origin https://api.tokrouter.dev and the same sk- token.

Endpoints

Method and pathDescription
POST /v1/chat/completionsOpenAI Chat Completions, the most common entry point
POST /v1/responsesOpenAI Responses API
POST /v1/messagesAnthropic Messages
POST /v1beta/models/{model}:generateContentNative Gemini (:streamGenerateContent for streaming)
POST /v1/services/aigc/text-generation/generationNative DashScope (official /api prefix removed)
POST /v1/systemoneJev decision model passthrough (no streaming)
GET /v1/modelsModels available to this token
POST /v2/rerankReranking
GET /healthHealth check

Common headers

HeaderRequiredNotes
Authorization: Bearer sk-…OpenAI / DashScope protocolsx-api-key also accepted
x-api-key: sk-…Anthropic protocol
x-goog-api-key: sk-…Gemini protocol
Content-Type: application/jsonYes
anthropic-versionRecommended for Anthropice.g. 2023-06-01

Errors

  • The HTTP status indicates the class (401 auth, 402/403 quota or permission, 429 rate limit, 5xx upstream)
  • The body is JSON, and its shape follows the inbound protocol (OpenAI: {"error":{"message":…,"type":…}}, Anthropic: {"type":"error","error":{…}})
  • Failed requests are not billed

Error details belong to the upstream

The gateway aggregates vendors, so the type / code values come from each vendor. This page does not enumerate them — any enumeration would go stale. Read the error field in the response body and the vendor's docs.

Machine-readable spec

/openapi.yaml serves an OpenAPI 3.1 description, suitable for code generators and agent tooling.