AI Gateway overview
One API key and one address for Claude, GPT and your own models. The Gateway picks the model, reserves each request's cost against your limits, and logs it.
What the Gateway does#
Your tools call https://api.agentlab.cresclab.com with a Gateway API key instead of calling a model provider directly. For each request the Gateway:
- Checks the key The key belongs to your workspace and can be charged to departments.
- Picks the model A model you name is used as named;
autopicks one by how hard the task is. - Holds the cost The most the request can cost is held against your limits before it is sent. A request that does not fit is refused and costs nothing.
- Records it Key, model, tokens, cost and timing are recorded. Prompt and response text are not.
It speaks three protocols, so existing clients connect by changing their base URL:
| Endpoint | Protocol | Used by |
|---|---|---|
POST /v1/messages | Anthropic Messages | Claude Code, the Anthropic SDK |
POST /v1/responses | OpenAI Responses | Codex, the OpenAI SDK (responses) |
POST /v1/chat/completions | OpenAI Chat Completions | The OpenAI SDK, most frameworks, raw HTTP |
GET /v1/models | OpenAI or Anthropic list | Every client: auto and the models allowed |
Start here#
QuickstartConnect Claude Code, Codex, the OpenAI SDK, the Anthropic SDK or curl in a few copyable steps.API keysCreate, charge to departments, limit, rotate and revoke keys.Auto model choiceHow
auto picks a model and how a response says which one answered.Limits and budgetsMonthly budgets, department ceilings, rate limits, and the three kinds of 429.Usage and exportThe usage page, end-user attribution and the monthly CSV export.ErrorsEvery error code with its status, whether to retry and what fixes it.Reference#
- API reference: endpoints, headers and the OpenAPI document.
- Data handling: what is stored about a request and what is not.
- Self-hosting: running the Gateway inside your own network.