Crescendo Lab Docs
English
Sign up

How the AI Gateway works: endpoints and requests

One API key and one address for Claude, GPT, Gemini and your own models. The Gateway picks the model, reserves each request's cost against limits, and logs it.

Last updated

For what an AI gateway is, how it differs from an API proxy and how to choose one, see AI Gateway. This page covers how to connect and how it works.

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:

  1. Checks the key The key belongs to your workspace and can be charged to departments.
  2. Picks the model A model you name is used as named; auto picks one by how hard the task is.
  3. 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.
  4. 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:

EndpointProtocolUsed by
POST /v1/messagesAnthropic MessagesClaude Code, the Anthropic SDK
POST /v1/responsesOpenAI ResponsesCodex, the OpenAI SDK (responses)
POST /v1/chat/completionsOpenAI Chat CompletionsCursor, the OpenAI SDK, most frameworks, raw HTTP
GET /v1/modelsOpenAI or Anthropic listEvery client: auto and the models allowed

Start here#

Reference#