Overview
TokenLab supports OpenAI-compatible endpoints plus Anthropic and Gemini request formats. Existing OpenAI clients can use/v1; choose another format only when your application needs behavior specific to that API. POST /v1/responses is optional and depends on model support.
Base URL
Authentication
All API endpoints require authentication using a Bearer token:Delivery policy
Generation requests acceptX-TokenLab-Delivery-Policy: auto | verified | official. A request header overrides the API key setting, which overrides the Workspace default.
Autouses TokenLab Verified when available, then Official if needed. You pay for the option that completes your request.TokenLab Verifiedis delivery verified by TokenLab. TokenLab prices apply.Officialis based on the model maker’s public price. The price shown on TokenLab is what you pay.- Realtime sessions use the API key or Workspace setting and do not accept a query-string override.
400. If the requested option is unavailable, TokenLab returns 503 with code: delivery_tier_unavailable, retryable: true, and a request ID.
Supported Endpoints
Chat & Text Generation
Embeddings & Rerank
Images
Image models may return a finished image or an asynchronous task. If the response includes
poll_url, use that URL to check the task.Audio
Realtime
Use
/v1/realtime for WebSocket upgrades. A plain GET /v1/realtime returns endpoint metadata. This is not the OpenAI Realtime REST surface; client-secret, Calls, and legacy beta session endpoints are not available.Video
Use the
poll_url returned when the task is created. /v1/videos/generations/{id} remains available for older clients.Async Tasks
Video, music, 3D, and some image requests may return this endpoint in
poll_url.Music
Use the returned
poll_url. /v1/music/generations/{id} remains available for clients that need the music-specific path.3D Generation
Use the returned
poll_url. /v1/3d/generations/{id} remains available for clients that need the 3D-specific path.Models
Gemini (v1beta)
Native Google Gemini API format support:Gemini endpoints support
?key= query parameter authentication in addition to standard Bearer token.Response Format
Each endpoint keeps the response shape documented for its API format. This is a Chat Completions example:Success Response
Request identifiers
Private delivery details are not part of the public response contract. Use the public headers below when they are present.Error Response
Rate Limits
Rate limits are role-based and configurable by administrators. Default values:Contact support for custom rate limits. Exact values may vary by account configuration.
429 status code with a Retry-After header indicating how long to wait.
OpenAPI Specification
OpenAPI Spec
Download the complete OpenAPI 3.0 specification