https://router.flatkey.ai/v1.
Before you begin
You need:- A Flatkey account
- cURL, Python 3.8+, Node.js 16+, or PowerShell
- Prepaid credit for the model request
1
Set up your account and API key
Sign in to the Flatkey Console. Open Wallet and choose a prepaid package that fits your workload.
Next, open API Keys and select Create API Key.
Give the key a clear name. You can also set a credit limit and expiration time before selecting Save changes.
Copy the generated secret and store it securely. Flatkey API keys start with



sk-fk-.2
Send your first request
Set the API key in your current shell:For Python, install the OpenAI SDK with After the request completes, open Usage Logs in the Flatkey Console. Enter 
If the table still shows No Logs Found, wait a few seconds and search again. If it remains empty, confirm the API key and Base URL used by the request.
pip install openai. For TypeScript, run npm install openai. cURL and PowerShell need no SDK.The following examples call the same model through the same Flatkey endpoint:gpt-4o-mini in Model Name and select Search. The screenshot shows where to apply the filter; your completed request should appear in the table with token counts, latency, and cost.
3
Keep building
Connect Flatkey to the coding tool you use:
Claude Code
Configure Claude Code manually or with CC Switch.
Codex CLI
Route Codex CLI requests through Flatkey.
Codex Desktop
Configure the Codex desktop app manually or with CC Switch.
Read the response
For Chat Completions responses, the fields you will use most often are:choices[0].message.content— generated textmodel— the model that handled the requestusage— prompt, completion, and total token counts
Stream the response
Setstream to true when you want tokens as they are generated.
Handle common errors
See API errors for response formats and troubleshooting details.
Next steps
Authentication
Learn how Flatkey API keys and authorization headers work.
Model Directory
Find supported model IDs and current pricing.
OpenAI SDK
Use Flatkey with the OpenAI Python and TypeScript SDKs.
Usage Logs
Monitor requests, token usage, latency, and cost.
Billing
Understand prepaid credit and usage charges.