Build with flatkey
The official-model gateway. Route to 160+ real lab endpoints — text, video and audio — through one key, at 60–90% of list price, with a signed SLA behind every call.
Router API
OpenAI-compatible endpoint at router.flatkey.ai/v1. Change the base_url, keep your SDK — chat, tools, streaming, structured output.
Anthropic endpoint NATIVE
Native Anthropic API shape — point Claude Code or Cline at the same base URL with your sk-fk-… key. No translation layer.
Media models
Seedance 2.5 video, realtime speech, TTS and transcription — metered per second or per character on the same balance.
Team governance
One key per member with caps and model allowlists; per-request ledger, quotas and spend API for finance.
Start with one call
Most users start here: create a key in the console, change the base_url, send a request. Three lines, no infrastructure.
from openai import OpenAI
client = OpenAI(base_url="https://router.flatkey.ai/v1", api_key="sk-fk-…")
r = client.chat.completions.create(model="gpt-5.5", messages=[{"role":"user","content":"hi"}])
Building with an AI agent? Fetch the full docs index at /llms.txt — every page also ships a plain-markdown mirror (.md).
Guides — the four things everyone asks
Connect Codex
- One-liner: curl -fsSL https://flatkey.ai/install.sh | bash then pick
Codex CLIwhen asked. - Manual: in Codex choose API key login, base URL
https://router.flatkey.ai/v1, paste yoursk-fk-…key. - Group returning 503? Switch the key to another group in the key editor (see Groups & routing below).
Connect Claude Code / Cline
- Two environment variables:export ANTHROPIC_BASE_URL=https://router.flatkey.ai
export ANTHROPIC_API_KEY=sk-fk-…Windows:
setx ANTHROPIC_BASE_URL … - Or persist in
~/.claude/settings.json:{"env": { "ANTHROPIC_BASE_URL": "https://router.flatkey.ai", "ANTHROPIC_API_KEY": "sk-fk-…" }} - Run
claudeas usual. Cline: provider Anthropic, same base URL + key.
One key per person, one cap per key
- Create one key per teammate in Console → API Keys; set a monthly
capand optional model allowlist per key. - Groups pick the routing pool, not the person:
Standard= aggregated official channels (default);Economy= lowest-cost dedicated line. A key belongs to one group and can be moved anytime. - Per-key spend, tokens by type and quota left: Usage & Logs or the ledger API.
What each number means
| PRICE | MEANING |
|---|---|
| Input /M | per 1M prompt tokens sent |
| Output /M | per 1M tokens generated |
| Cached /M | re-sent prefix tokens, ~10% of input · cache lives 5–60 min per lab |
- 30-day health = % of successful requests over the last 30 days, real production traffic.
- Failed requests (5xx) are never billed; failovers bill only the model that answered. Full SLA →
Community
Builders answering builders — routing configs, agent setups, model picks. The team reads everything; gateway-bench and the audit log are developed in the open.