Overview
The complete Token Factory inference surface — every endpoint across chat, completions, messages, embeddings, images, audio, rerank, video, 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 — Claude SDKs, native Anthropic body.
Embeddings
POST /v1/embeddings — vector embeddings.
Image Generation & Edits
POST /v1/images/generations — b64_json, size allowlist; /edits for multipart editing.
Text to Speech
POST /v1/audio/speech — raw audio body.
Transcriptions & Translations
POST /v1/audio/transcriptions — speech to text (+ /translations for audio to English).
Rerank
POST /v1/rerank — relevance ranking.
Videos — Create
POST /v1/videos — async job, idempotent submit.
Videos — Poll
GET /v1/videos/{id} — 200 for every state.
Videos — Cancel
POST /v1/videos/{id}/cancel — not charged.
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.