Skip to main content
Your Crevio API key is also an LLM key. Point any OpenAI-compatible SDK at 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

Server-side only. The gateway spends your credits, so treat the key like any other secret. Never ship it to a browser, and never put an unauthenticated route in front of it — an open chat endpoint is a free LLM for anyone who finds it, billed to you.

Inside a Crevio-built app

Apps that Crevio deploys already have CREVIO_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.
How it differs from a bare model:
  • 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_working with the run id to read later at GET /v1/task_runs/{id}. usage is 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-id header (the run id), and passing it back as previous_response_id in the body (or the x-crevio-previous-response-id header for Messages) with only the new message continues that chat. On the Responses API the response id is that value, so previous_response_id works as it does on OpenAI.
  • Structured output. response_format (Chat Completions), text.format (Responses) or output_format (Messages) with a JSON Schema makes the reply the validated JSON. The full validation result is in the crevio object beside the reply: json, json_error, plus run_id, chat_id, status, credits_consumed and artifacts.
  • 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 answers 502 with the reason.
  • Tool declarations in the request are ignored: the agent uses your connected integrations, not tools you pass.
The key needs the agent:run scope. Raw models need models:run (see API keys).

Streaming

Set stream: 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 as provider/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.
The response’s 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:
A 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:
Charges appear in your credit history as AI gateway, tagged with the model. See Usage & billing for how credits work.
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.