Simplified architecture
THE-CODE API
One request, from key to settled cost.
Every paid request follows the same six steps. Credits are held before the provider is called, then settled on what the request actually used.
Visit thecodeapi.com (opens in a new tab)API key
A named key, with optional expiry, that you can suspend, resume or delete.
Reserve credits
An estimate is reserved first, within an optional per-request ceiling.
Route to provider
To the provider behind the model you chose — OpenAI, Anthropic, Google Gemini and more.
Respond
OpenAI-compatible chat, responses and embeddings, with streaming.
Settle actual usage
Exactly one charge, on what the request actually used.
Usage and cost APIs
Cost per request, and usage by day or by model.