Overview
One OpenAI-compatible endpoint for every LLM provider, with metering, credits, and enforcement you own end-to-end.
What is the Token Factory Inference API?
The Token Factory Inference API is a sovereign, multi-tenant AI gateway exposed on
https://api.<domain>/v1/*. It gives you:
- One endpoint for every provider — OpenAI, Anthropic, and on-cluster open-weight models (vLLM, NVIDIA NIM) behind a single base URL.
- OpenAI compatibility on purpose — point the standard OpenAI SDK at the
gateway and it works. Anthropic SDKs are supported on
/v1/messages. - Curated model aliases — you request a stable public name (
gpt-4o,bge-m3); the gateway routes to the serving provider and virtualizes the model name. Failover can change the provider under you without changing your code or themodelfield you see back. - Enforcement before the provider is called — API-key auth, model allowlists, IP allowlists, rate limits, token quotas, and prepaid credit reservations are all checked before your request is sent to the provider, so a denied request never incurs any spend.
Base URL
https://api.<domain>/v1All paths in this documentation are relative to that base. <domain> is your
deployment's domain (shown in the portal Dashboard and Project pages).
Two dialects, one contract
The gateway serves two wire dialects — OpenAI (/v1/*) and Anthropic
(/v1/messages) — over the same keys, models, limits, and ledger (auth
headers: Authentication):
| Dialect | Path prefix | Auth header | Error envelope |
|---|---|---|---|
| OpenAI | /v1/* (except /v1/messages) | Authorization: Bearer <key> | OpenAI-shaped, with request_id |
| Anthropic | /v1/messages | x-api-key: <key> (Bearer also accepted) | Anthropic-shaped, with request_id |
Both dialects observe the same underlying contract: the model you send is
echoed back verbatim, every successful body carries a provider_metadata
object, and every error carries a server-minted request_id. Full
side-by-side and worked examples:
OpenAI & Anthropic Compatibility.
What makes it different from calling providers directly
| Capability | Behaviour |
|---|---|
| Failover | If a serving provider fails or is degraded, the alias routes elsewhere; your request shape does not change. |
| Metering | Usage is read from the provider's own usage report — never estimated — and priced per model at nano-USD precision. |
| Prepaid credits | A reservation is held against your wallet before the provider runs, so concurrent requests cannot overspend a small balance. |
| Provider credential safety | Provider-internal fields are stripped or relocated, and provider credentials are never exposed. If a provider rejects our credential, you get a clean, actionable 502 provider_unavailable instead of a confusing provider auth failure. |
Full OpenAPI spec
A machine-readable OpenAPI 3.1 description of this surface ships with
TokenFactory (docs/api/openapi/inference-v1.yaml). Where it and these pages
disagree, the contract pages here win.
Next steps
- Make your first call in five minutes: Quickstart
- Get and use an API key: Authentication
- Pick aliases for your workload: Models & Aliases
- Handle failures properly: Errors