/v1/messages, with x-api-key accepted
as well as Authorization: Bearer. Claude Code and the Anthropic SDKs work by changing
base_url alone.
Quickstart
A key, an environment variable, and a working call. About two minutes.
API reference
Every endpoint, parameter and status code, with a runnable example each.
What you get
One key, every model
Models are named by slug (
deepseek-v4.1-flash), never by whoever runs the hardware.
Switching models is a string change, not an integration.Usage you can audit
The
usage object in every response is the number you are billed on, not an estimate
of it. The console shows the same figures per request.A handle on every call
Every response carries
x-request-id, successes and failures alike. It reaches the
whole path the request took.Failures that cost nothing
Of the 28 errors this API can return, 26 are free. The two that are not are the ones
where the model had already produced output.
What this API is not
Being straight about the edges saves you an afternoon:- It is not a proxy to a specific vendor. Model names are ours. Responses never name
who served them, and
x-provider-classtells you only whether you got the first choice or a standby. - There is no
claude-*aliasing on/v1/messages. The endpoint speaks Anthropic’s wire format; the model names stay ours. - Parameters we do not implement are ignored, not rejected — except the handful marked
not supported in the reference, which return
INVALID_REQUESTrather than quietly giving you an answer that ignored what you asked for.
Where to go next
Authentication
Bearer keys, the
x-api-key alias, and what happens when a key is revoked.Models and resource names
When to write a bare slug and when to write a full resource name.
Rate limits and quotas
What throttles you, and which of the three 429s you are looking at.
Errors
Every code, whether to retry it, and whether it is billed.