Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.tokmodel.com/llms.txt

Use this file to discover all available pages before exploring further.

TokModel sits between your application and the AI providers you want to use. Instead of integrating each provider separately — managing different SDKs, authentication schemes, and API shapes — you send every request to https://tokmodel.com and TokModel handles the routing. Your code stays the same regardless of which model or provider you choose.

How the routing works

When you send a request to TokModel, three things happen:
  1. TokModel authenticates the request using your API key.
  2. TokModel reads the model field in your request body to determine which provider and model to call.
  3. TokModel forwards the request to that provider, receives the response, and returns it to you in a consistent format.
Your application never communicates directly with individual providers. All requests go through https://tokmodel.com.

Drop-in replacement

TokModel is fully compatible with the OpenAI client API. If your application already calls OpenAI, you can switch to TokModel by changing one value — the base URL:
from openai import OpenAI

client = OpenAI(
    api_key="your-tokmodel-api-key",
    base_url="https://tokmodel.com/v1",
)

response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Hello"}],
)
The same change works in any OpenAI-compatible SDK: the official OpenAI clients for Python, Node.js, Go, Java, and others, as well as third-party tools that accept a configurable base URL.

Supported endpoint families

TokModel exposes endpoints across six capability areas:
CapabilityEndpoints
Chat completionsPOST /v1/chat/completions
ResponsesPOST /v1/responses, POST /v1/responses/compact
Anthropic messagesPOST /v1/messages
Text embeddingsPOST /v1/embeddings
RerankingPOST /v1/rerank
Image generationPOST /v1/images/generations, POST /v1/images/edits, POST /v1/images/variations
Speech & audioPOST /v1/audio/speech, POST /v1/audio/transcriptions, POST /v1/audio/translations
Model listingGET /v1beta/models
Each endpoint accepts the same request format as its OpenAI equivalent, so existing integration code requires no changes beyond the base URL.
Use the model field to target any provider available on TokModel. Model IDs follow a provider/model-name convention — for example, anthropic/claude-3-5-sonnet, google/gemini-2.0-flash, or mistral/mistral-large-latest. See Models and providers for the full list.

Authentication

Every request requires an Authorization header with a Bearer token:
Authorization: Bearer your-tokmodel-api-key
You create and manage API keys in the TokModel console. Each key is scoped to your account and carries the credit balance associated with that account.