https://router.flatkey.ai
Text generation runs through POST /v1/chat/completions, which matches the OpenAI Chat Completions API exactly. Any OpenAI-compatible client works after you change the base URL.
No rewrite needed
Keep your existing request code and point
base_url at https://router.flatkey.ai/v1.One key, every model
Switch models by changing the
model field. Nothing else changes.Make your first call
Choose a model
List everything your account can reach and keep the text models:Stream the response
Setstream: true to receive tokens as they are produced:
delta instead of a complete message.
Call your own functions
Pass tool definitions and the model decides when to invoke them:tool_call_id, and send the whole thread back.
Tool calling is a capability of the model, not of Flatkey. The GPT, Claude, Gemini, Qwen, DeepSeek, and GLM families support it. Image, video, and speech models ignore a tools array.
Force a JSON shape
Useresponse_format when you need to parse the answer:
{"type": "json_object"} also works when you only need valid JSON without a fixed schema.
Read token usage
Every response carries the counts you are billed on:usage rather than estimating from character counts. Per-request cost also appears in Usage logs.
Troubleshooting
No available channel for model ...
That model is not routable right now. Pick another id from /v1/models. Retrying the same model does not clear this.
The response stops mid-sentence
finish_reason is length. Raise max_tokens.
Tool calls never fire
Confirm the model supports tools, and check that tool_choice is not set to none.
Next steps
API reference
Every parameter and response field.
OpenAI SDK guide
Drop Flatkey into an existing OpenAI project.