Tokenify

Tokenify documentation

Frontier models at wholesale rates, behind the API your code already speaks. Keep your SDK; change the base URL and the key.

Tokenify is an inference gateway. It exposes the OpenAI Chat Completions API at /v1/chat/completions and the Anthropic Messages API at /v1/messages, routes each request to whichever supplier can serve it cheapest and fastest, and bills you per token against prepaid credit. There is no subscription and no minimum.

curl https://api.tokenify.dev/v1/chat/completions \
-H "Authorization: Bearer $TOKENIFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek/deepseek-v4-flash",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 256,
"reasoning": {"enabled": false}
}'

If you already call OpenAI, that is the whole migration: point base_url at https://api.tokenify.dev/v1, use a Tokenify key, and name a Tokenify model. Everything else — streaming, tools, JSON mode, the response shape — is unchanged.

Start here

Quickstart
A key, a base URL and your first completion, in four languages.
Authentication
API keys, scopes, rate limits and how to keep one out of a repository.
Chat completions
The OpenAI-compatible endpoint: parameters, responses and tool calls.
Streaming
Server-sent events, usage on the final frame, and cancelling a generation.
Anthropic Messages
The same models behind /v1/messages, for clients that speak Anthropic.
Codex and the Responses API
The /v1/responses endpoint, and the four lines of config that point OpenAI Codex at Tokenify.
Claude Code
Every variable the client reads, and what to check when something looks wrong.
Structured outputs
Send a JSON schema and get JSON shaped like it — and which models actually enforce it.
Coming from OpenRouter
What is identical, what is missing, and why a headline price comparison misleads.
Coming from DeepSeek
The two lines you change, the model names that differ, and the beta features we do not have.
Coming from Z.AI (GLM)
Model names carry over unchanged. What thinking does to your bill, and the fields we ignore.
Video generation
Submit a job, poll it, fetch the result from our own domain. What each model takes, and why concurrency is the limit that binds.
Video: the fal.ai queue API
Point fal.ai queue code at us: the one line you change, and every difference worth knowing before you hit it.
Video: the OpenAI Videos API
Their Videos API shut down in September 2026 with no replacement. Point that code here: what maps across, and what is refused rather than guessed.
Image generation
The sizes each model takes, the price per image, and what every parameter does.
Images: the OpenAI SDK
images.generate and images.edit against our base URL, and where we differ from OpenAI.
Images: the Seedream API format
The model maker’s own request shape, on our base URL: fields, defaults and error codes.
Images: the google-genai SDK
generateContent with your parts array unchanged, answered by Seedream. Not Google’s models.
Layer decomposition
One image in, a base and up to sixteen layers out, with where each one sits.
Errors
Every status this API returns, what causes it, and whether to retry.
Models and pricing
What each model costs, what it can do, and how to choose.
Prompt caching
How cache hits are detected and billed, and how to earn more of them.
Rate limits and quotas
Per-key and per-model ceilings, and what happens at the edge of one.

For agents and crawlers

Every page here is static HTML with no client-side rendering, so a plain fetch returns the same words a browser shows. If you are pointing a coding agent at this API, these two files are written for it:

  • /llms.txt — the base URL, the auth header, the model ids and the endpoints, in about forty lines.
  • /llms-full.txt — the same, plus every parameter, error code and worked example, as one plain-text document.

You will need a key to make a request. Creating an account takes a minute and issues one immediately.

Last updated 2026-09-28.