Inference API · By invitation

Open models, one endpoint.

Chat, transcription and speech from open-weight models, on GPUs we run or rent. OpenAI- and Anthropic-compatible: change the base URL, keep your code.

OpenAI SDKs
https://api.tokenflow.dev/v1
Anthropic SDKs
https://api.tokenflow.dev
curl · JSON response
curl https://api.tokenflow.dev/v1/chat/completions \
  -H "Authorization: Bearer $TOKENFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "qwen3.8-27b", "messages": [{"role": "user", "content": "Hello"}]}'

OpenAI SDK · Python · base URL ends in /v1
import os
from openai import OpenAI

client = OpenAI(base_url="https://api.tokenflow.dev/v1", api_key=os.environ["TOKENFLOW_API_KEY"])
reply = client.chat.completions.create(model="qwen3.8-27b", messages=[{"role": "user", "content": "Hello"}])
print(reply.choices[0].message.content)

Anthropic SDK · Python · base URL without /v1
import os
from anthropic import Anthropic

client = Anthropic(base_url="https://api.tokenflow.dev", api_key=os.environ["TOKENFLOW_API_KEY"])
reply = client.messages.create(model="qwen3.8-27b", max_tokens=1024, messages=[{"role": "user", "content": "Hello"}])
print(reply.content[0].text)

OpenAI SDK · TypeScript · base URL ends in /v1
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.tokenflow.dev/v1", apiKey: process.env.TOKENFLOW_API_KEY });
const reply = await client.chat.completions.create({ model: "qwen3.8-27b", messages: [{ role: "user", content: "Hello" }] });
console.log(reply.choices[0].message.content);

Speaks
  • OpenAI Chat Completions /v1/chat/completions
  • OpenAI Responses /v1/responses
  • Anthropic Messages /v1/messages
  • OpenAI Audio /v1/audio/transcriptions /v1/audio/speech

Models

What you can run

Published reference prices in USD; your customer agreement governs fees. Limits, examples and live performance are on each model’s page.

Language-model prices per 1M tokens; speech per hour of audio.
ModelTypeGood forPrice
qwen3.8-27bLanguage & chatGeneral chat, coding agents and tool use. Our default model.$0.50 in$0.10 cached$3.00 out
qwen3.8-27b-directLanguage & chatQwen3.8 27B with an adapter that declines fewer requests.$0.50 in$0.10 cached$3.00 out
qwen3.8-27b-cuteLanguage & chatThe direct model with a casual, short, emoji-friendly chat persona.$0.50 in$0.10 cached$3.00 out
gemma4-12bLanguage & chatSmaller and faster. Good for short chat, extraction and image questions.$0.30 in$0.06 cached$1.80 out
gemma4-12b-directLanguage & chatGemma 4 12B with an adapter that declines fewer requests.$0.30 in$0.06 cached$1.80 out
sensevoice-smallSpeech to textTranscribe short WAV recordings to text.$0.054 / audio hour
tokenflow-tts-1Text to speechGenerate speech from text using preset or described voices.$1.00 / audio hour

All models → · Pricing and how usage is counted →

Features

Built for long agent sessions

Agents resend the same growing conversation on every turn. tokenflow is designed around that.

01

Cache-aware routing

Each conversation is routed to a GPU that may already hold its prompt prefix, so a turn usually prefills only what is new.

02

Failover within a model

If a node fails before your response starts, the request is retried on another node serving the same model, without your client doing anything. That node may run a different quantization.

03

Native protocols

OpenAI and Anthropic requests reach the engine in their own format. Tool calls, streaming events and usage come back as your SDK expects.

04

Metering you can check

Every key’s usage is split into cached input, uncached input and output tokens, with monthly quotas per organization.

05

Images in context

Up to 16 inline PNG, JPEG, WebP or GIF images per request, including screenshots that browser agents carry in their history.

06

Stops when you do

Close the connection and generation stops on the GPU. Usage counts the input and the output sent so far, not the tokens that would have followed.

How it works

One endpoint in front of a pool of GPUs

The gateway runs at the edge. The GPUs run wherever capacity is: our own hardware or rented servers.

Your application sends requests to api.tokenflow.dev, which routes each conversation to one of several GPU nodes serving the model. Your app OpenAI / Anthropic SDK api.tokenflow.dev route · meter GPU node same model GPU node has your prefix cached GPU node same model Your application sends requests to api.tokenflow.dev, which routes each conversation to one of several GPU nodes serving the model. Your app OpenAI / Anthropic SDK api.tokenflow.dev route · meter GPU node same model GPU node your cache GPU node same model
  1. Your request arrives at the gateway with your key and is checked against your quota.
  2. It is routed preferably to a node that served the earlier turns of the same conversation, when that node is healthy and has room.
  3. Tokens stream back through the gateway, and the usage is recorded against your key.

Quickstart

Change the base URL. That’s it.

Use the SDK you already have: the OpenAI SDK with https://api.tokenflow.dev/v1, the Anthropic SDK with https://api.tokenflow.dev. The quickstart has a first request in cURL, Python and TypeScript, the model list and the usual first errors.

Coding agents

Runs in the agent you already use

Claude Code and Codex work on tokenflow with a few environment variables or one profile file. No proxy, no plugin.

Questions

Before you start

How do I get access?

tokenflow is available by invitation. Once you are in, an owner of your organization creates API keys in the console.

How is usage billed?

Tokens for language models, split into uncached input, cached input and output; audio duration for transcription and speech. The pricing page has the published reference prices; your customer agreement governs fees and payment terms.

What does the prompt cache do for me?

Agents resend a growing conversation. Input the engine already holds is cached input: it costs less and does not use your monthly quota. See the worked example.

What happens to my requests?

The privacy policy says what is kept, for how long and why.

Which APIs does it speak?

OpenAI Chat Completions and Responses, Anthropic Messages, and OpenAI-style transcription and speech. Each model page lists its endpoints.

A request failed. What now?

Every error has a code; API errors says what each one means and whether to retry.

By invitation, for now

tokenflow is open to existing customers while we grow capacity. Tell us what you’re building and how much you expect to run.

Request access