https://ai-gateway.crevio.co/v1, pass the key you already have, and call GPT, Claude, Gemini, Grok, or any other model in the catalog. Tokens are billed to your Crevio credit balance at the provider’s price plus a 50% platform fee.
There is no separate signup, no provider account, and no second key to rotate. Apps that Crevio builds and deploys for you get the endpoint wired up automatically.
Quickstart
Inside a Crevio-built app
Apps that Crevio deploys already haveCREVIO_API_KEY and CREVIO_AI_GATEWAY_URL in their environment. Nothing to configure:
The crevio model: your agent behind the API
Pass model: "crevio" and the request runs your Crevio agent instead of a bare model. It works your account through the Crevio API and every connected integration, the same as a chat in Crevio, and answers in the wire format you called. Existing OpenAI and Anthropic code works with only the base URL, key and model changed.
- Each call is an agent run, so it takes from seconds to minutes and spends credits like any other run, not per token. Calls are capped at 10 minutes; a longer run answers
504 run_still_workingwith the run id to read later atGET /v1/task_runs/{id}.usageis always zero. - Your system messages are added to the agent’s instructions, never swapped in for them. Earlier messages in the request are passed along as the conversation so far.
- Continuing a conversation. Chat Completions and Messages are stateless: send the history each time. Or continue the agent’s own chat, with its earlier tool results: every reply carries an
x-crevio-response-idheader (the run id), and passing it back asprevious_response_idin the body (or thex-crevio-previous-response-idheader for Messages) with only the new message continues that chat. On the Responses API the responseidis that value, soprevious_response_idworks as it does on OpenAI. - Structured output.
response_format(Chat Completions),text.format(Responses) oroutput_format(Messages) with a JSON Schema makes the reply the validated JSON. The full validation result is in thecrevioobject beside the reply:json,json_error, plusrun_id,chat_id,status,credits_consumedandartifacts. - Streaming (
stream: true) is supported on all three. The stream opens at once and stays alive while the agent works, then carries the whole reply in one piece when the run finishes. It does not stream the agent’s tokens as it writes them. - Approvals. A run that stops to ask you something (status
needs_input) answers with its question as the reply. Answer by continuing the chat. A run that fails or is cancelled answers502with the reason. - Tool declarations in the request are ignored: the agent uses your connected integrations, not tools you pass.
agent:run scope. Raw models need models:run (see API keys).
Streaming
Setstream: true and read the response as you would from OpenAI. Tokens are forwarded as they arrive — the gateway adds no buffering of its own.
Models
Models are addressed asprovider/model, the same ids the Cloudflare model catalog uses (Workers AI models start with @cf/).
Aliases
A slug you pin today is a slug that retires. The gateway also answers to three stable names, and Crevio repoints them as models are released and retired — an app built against an alias keeps working without a redeploy.model field names the slug that actually served the request, and that is what the charge is recorded against.
GET /v1/models returns the aliases followed by the full live catalog:
model that isn’t in that list is rejected with model_not_found rather than silently substituted.
What it costs
Gateway usage is billed at the provider’s list price plus a 50% platform fee, which covers payment processing and provider top-up fees. The cost of a request is converted to credits and deducted from your balance once the response completes, including for streamed responses. Every request answers with your remaining balance:Credits are only deducted for requests that reach a model. A rejected request — bad model, failed auth, provider error — costs nothing.
Limits and errors
Errors use the same envelope as the OpenAI API, so SDK error handling works unchanged:
Each key carries a daily credit cap that bounds the damage from a leaked key or a runaway loop. Contact support if your workload needs a higher one.
Errors returned by the model provider itself — rate limits, context-length overruns, content filters — pass through unchanged, so you see the real reason rather than a rewritten one.

