Overview
The complete Token Factory inference surface — every endpoint across chat, completions, messages, embeddings, audio and the model catalogue.
The surface at a glance
Every endpoint lives under https://api.<domain>/v1/*. Auth is
Authorization: Bearer <key> (or x-api-key on the Anthropic path) —
which header, when. The model field in every
request must be a curated alias; every response echoes that alias back and
carries provider_metadata.
- Inference OpenAPI specification: YAML · JSON
- Import by URL (Postman, Insomnia, code generators):
/docs/api-reference/openapi.json
Chat Completions
POST /v1/chat/completions — OpenAI dialect, tools and vision.
Text Completions
POST /v1/completions — legacy OpenAI dialect.
Anthropic Messages
POST /v1/messages — Anthropic-compatible SDKs, native Messages body.
Embeddings
POST /v1/embeddings — vector embeddings.
Text to Speech
POST /v1/audio/speech — raw audio body.
Transcriptions & Translations
POST /v1/audio/transcriptions — speech to text (+ /translations for audio to English).
List Models
GET /v1/models — routable aliases for your key.
Shared behaviour
| Behaviour | Rule |
|---|---|
| Errors | One uniform envelope with request_id on every error — see Errors. |
| Streaming | SSE with a guaranteed final usage chunk; ends with [DONE] — see Streaming. |
| Rate limits | x-ratelimit-* headers on 200 and 429; honour Retry-After — see Rate Limits. |
| Funds | 402 insufficient_funds — never 429, never SDK-retried; top up — see Billing. |
| Deprecation | provider_metadata.deprecation + X-TF-Deprecation header, then 410 past sunset — lifecycle: Models & Aliases. |
Note
Where a page here and the OpenAPI specification above disagree, the specification wins.