API endpoint

Tokener.ai model API base URL and supported OpenAI- and Anthropic-compatible paths.

Updated 2026-11-02
Edit on GitHub

Supported model API surfaces (relative to the base URL below):

StatusMethodPathUse for
SupportedGET/modelsList discoverable model ids available to your key
SupportedGET/models?client_version=…Codex remote model picker
SupportedGET/models/userClaude Code gateway model picker
SupportedPOST/chat/completionsChat and reasoning models (primary)
SupportedPOST/embeddingsEmbedding models
SupportedPOST/rerankRank documents for a query with an assigned model
SupportedPOST/audio/transcriptionsTranscribe an audio file sent as multipart form data
SupportedPOST/audio/speechGenerate speech as a binary audio stream
SupportedPOST/messagesAnthropic Messages API shape, including agent clients such as Claude Code
SupportedPOST/messages/count_tokensCount input tokens for an Anthropic Messages request without generation
SupportedPOST/responsesOpenAI Responses API, including agent clients such as Codex

Streaming works on chat-style paths (stream: true). Which models exist, their pricing, and availability are live on the Models catalog — not duplicated here.

Decision models are not OpenAI- or Anthropic-compatible and are served outside /v1; see Decision API.

Rerank requests use model, query, and documents, with optional top_n and return_documents. Responses contain results with document indexes and relevance scores. Use an explicitly assigned model ID. A hidden model does not appear in /models, even for an authorized key. Rerank does not stream.

Transcription requests use multipart/form-data with model and file fields. Speech requests use JSON with model, input, and voice. Successful speech responses stream audio bytes and preserve Content-Type. Both audio paths use your Tokener.ai API key. Model-specific formats and limits still apply.

Token-counting requests use the Anthropic request shape with model and messages, plus supported fields such as system and tools. The JSON response contains input_tokens; it is not a final billing settlement. This path does not stream and uses the same Tokener.ai API key and Anthropic headers as /messages. Availability depends on the selected model and your key's access.

Base URL

https://api-staging.tokener.dev/v1

The compatible paths above use this base URL. It exposes OpenAI-compatible endpoints and an Anthropic-compatible /messages endpoint. The website and console never proxy LLM calls. Send your Tokener.ai API key as the Bearer token, or as x-api-key for /messages.

TypeScript
import OpenAI from "openai";
 
const client = new OpenAI({
  apiKey: process.env.TOKENER_API_KEY,
  baseURL: "https://api.tokener.ai/v1",
});

Create a key in API keys before calling these paths.

Native Gemini paths

On the same API origin, without the /v1 prefix, the facade accepts:

  • POST /v1beta/models/{model}:generateContent
  • POST /v1beta/models/{model}:streamGenerateContent?alt=sse
  • POST /v1beta/models/{model}:countTokens
  • POST /v1beta/models/{model}:embedContent
  • POST /v1beta/models/{model}:batchEmbedContents
  • POST /v1beta/interactions

Use a public model ID and your Tokener.ai key as Bearer or x-goog-api-key, not a Google provider key. Query keys and provider/deployment overrides are rejected. Interactions requires an explicit model; agents and previous interaction IDs are not supported. Native provider configuration and key access are still required; compatible API availability does not prove native parameter parity. Native embedding is non-streaming and limited to gemini-embedding-001 text and gemini-embedding-2-preview text/PNG/JPEG, with at most 100 items and 6 images per request. Native configuration, ordinary key access and input-only budgeting still apply. Resource management is not exposed by these model routes. Errors use the Google protocol shape.

Treat generation continuationToken values as opaque. Return the token unchanged with the same org/key, model, generation operation and request configuration. Do not substitute a token from Google or another endpoint, or retry a request whose outcome is unknown.

Gemini Files resources

When Files support is enabled, the same API origin accepts these finite paths:

Text
POST   /upload/v1beta/files
POST   /upload/v1beta/files/{session-UUID}
GET    /v1beta/files/{owned-token}
DELETE /v1beta/files/{owned-token}

Every request, including binary chunks, requires your Tokener.ai org key. Use only the upload URL and opaque File name/URI returned by this API; they remain scoped to their original org/key. START uses bounded snake_case File metadata, and chunks retain the SDK's upload protocol/size/MIME headers. Provide a known Content-Length and identity encoding: START is limited to 32 KiB and each chunk to 8 MiB. Do not put a key or provider URL in the query.

Final upload returns a file wrapper; GET returns direct File metadata with its live processing state. An owned stale/expired resource returns 410. Other errors do not authorize a reupload or a retry of an uncertain model call. These paths do not provide file listing, download, registration or cached-content APIs. CountTokens file references are not supported.

Agent clients

Coding agents run directly against these paths. See the setup guides for Codex (/responses) and Claude Code (/messages).

Every response — success or error — carries x-request-id and request-id headers; include them when contacting support. There is no browser CORS support: call these paths from your backend, not directly from a browser. See Errors for error response shapes and the full error code table.