Converge AI Gateway

Converge AI Gateway

The Converge AI Gateway gives one endpoint and one virtual key for the language models that Converge makes available. The gateway accepts the OpenAI Chat Completions, Completions and Responses formats, and the Anthropic Messages format. Each team has a spend budget. The gateway reports per-call spend and rate-limit state in response headers.

Connection

Base URLhttps://models.convergestudios.ai
AuthenticationA Converge AI Gateway virtual key, sent as Authorization: Bearer <virtual key>. The key is issued per team and is valid only for the model routes of the gateway.
The same virtual key in the x-api-key header. Accepted on POST /v1/messages, as the Anthropic SDKs send it.
Request formatsOpenAI Chat Completions, Completions and Responses; Anthropic Messages
OpenAPI document/openapi/ai-gateway.json
Client libraries

A client written for the OpenAI API uses https://models.convergestudios.ai/v1 as its base URL. A client written for the Anthropic API uses https://models.convergestudios.ai as its base URL and sends the key in x-api-key. The virtual key must stay on the server side of an application: a key in browser code is visible to every user of the page.

First call

The examples on this portal read the key from the environment variable GATEWAY_API_KEY.

Request (curl)
curl -sS -X POST https://models.convergestudios.ai/v1/chat/completions \
  -H "Authorization: Bearer $GATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini/gemini-3.1-flash-lite",
  "messages": [
    {
      "role": "user",
      "content": "Reply with the single word: pong"
    }
  ],
  "max_tokens": 10
}'
Response — 200
{
  "id": "example-1",
  "created": 1795612209,
  "model": "gemini/gemini-3.1-flash-lite",
  "object": "chat.completion",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "pong",
        "role": "assistant",
        "images": [],
        "thinking_blocks": [],
        "provider_specific_fields": {
          "thought_signatures": [
            "EqkBCqYBAWkU…[truncated 232 chars]"
          ],
          "thinking_blocks": []
        }
      },
      "provider_specific_fields": {}
    }
  ],
  "usage": {
    "completion_tokens": 1,
    "prompt_tokens": 8,
    "total_tokens": 9,
    "completion_tokens_details": {
      "text_tokens": 1
    },
    "prompt_tokens_details": {
      "text_tokens": 8
    }
  },
  "service_tier": "default"
}

Operations

Each operation page gives the parameters, request and response examples, response headers and errors.

Models

Discover the models available to a key and their capabilities.

Health

Liveness and readiness of the gateway. No key is necessary.

Models

The model parameter takes one of the ids below. The capabilities are those that GET /model_group/info returns. The list that applies to a key is the one that GET /v1/models returns for that key.

Model idInput tokensOutput tokensImage inputFunction callingresponse_formatReasoning efforts
gemini/gemini-4-carbon1,048,5761,048,576YesYes, parallelYesnone, low, medium, high
gemini/gemini-4-hydrogen1,048,5761,048,576YesYes, parallelYesnone, low, medium, high
gemini/gemini-4-argon1,048,5761,048,576YesYes, parallelYesnone, low, medium, high
gemini/gemini-3.8-flash1,048,57665,536YesYes, parallelYesnone, low, medium, high
gemini/gemini-3.6-flash1,048,57665,536YesYes, parallelYes—
gemini/gemini-3.5-flash-lite1,048,57665,536YesYes, parallelYes—
gemini/gemini-3.1-flash-lite1,048,57665,536YesYes, parallelYes—
gemini/gemini-3.1-pro-preview1,048,57665,536YesYesYes—
gemini/gemini-3-flash-preview1,048,57665,536YesYes, parallelYes—
Hidden reasoning tokens count against max_tokens

Reasoning models spend completion tokens on hidden reasoning before the visible answer. These tokens count against max_tokens and appear in usage.completion_tokens_details.reasoning_tokens. When max_tokens is small, a reasoning model can use the full limit on reasoning and return finish_reason: "length" with no content. Set max_tokens high enough for reasoning and the answer, or lower reasoning_effort.

reasoning_effort none does not always remove reasoning

On some models, reasoning_effort: "none" still produces a small number of reasoning tokens.

Rate limits

Rate limits are per deployment

The x-ratelimit-* headers give the limits and the remaining capacity of the deployment that served the call, not of the key. A model can be served by more than one deployment, each with its own counters, so consecutive responses for the same model can show different remaining values. The limits differ between models.

HeaderDescriptionExample
x-ratelimit-limit-requestsRequest limit per minute of the deployment that served the call.15
x-ratelimit-remaining-requestsRequests that remain in the current minute on the deployment that served the call.11
x-ratelimit-limit-tokensToken limit per minute of the deployment that served the call.250000
x-ratelimit-remaining-tokensTokens that remain in the current minute on the deployment that served the call.249982

Budgets and spend

The budget belongs to the team

Spend is limited by a budget on the team of the key. When the spend of the team reaches the budget, every model call with a key of that team returns 422 with error.type budget_exceeded, for all models.

The budget is checked before a call

The gateway compares the team spend with the budget before it sends a call to the model. A call that starts below the budget completes, even when its own spend takes the team over the budget. Spend can therefore end above the budget by the spend of the last call. The next model call is rejected.

Discovery routes answer after the budget is reached

When the budget is exceeded, GET /v1/models still returns 200. Only model calls are rejected.

x-litellm-key-spend is approximate

x-litellm-key-spend is the spend cached on the gateway replica that served the call, plus the spend of that call. The cached part lags, and different replicas can report different values for the same key. x-litellm-response-cost is the spend of the one call. Neither header gives the exact remaining budget.

Spend and call headers

HeaderDescriptionExample
x-litellm-call-idIdentifier of this call on the gateway. Quote it in a support request.—
x-litellm-model-groupThe model id that served the call, as sent in model.gemini/gemini-3.1-flash-lite
x-litellm-response-costSpend of this call, as a decimal number in the unit of the team budget. Some responses do not carry this header, for example streamed responses.—
x-litellm-key-spendApproximate spend of the key, as a decimal number in the unit of the team budget. The value is the spend cached on the gateway replica that served the call, plus the spend of this call. The cached part lags behind the real total and can differ between replicas. Do not use it as an exact balance.—
Budget exceeded — 422
{
  "error": {
    "message": "Budget has been exceeded! Team=<team id> Current cost: <spend>, Max budget: <budget>",
    "type": "budget_exceeded",
    "param": null,
    "code": "422"
  }
}

Errors

The model routes return errors with a real HTTP status and a JSON error object. error.type is the field to branch on; error.code repeats the HTTP status as a string.

Error shape
{
  "error": {
    "message": "The requested model 'no-such-model' is not available for this API key, or the model name is invalid. Check the models available to you and try again.",
    "type": "team_model_access_denied",
    "param": "model",
    "code": "403"
  }
}
HTTPerror.typeMeaning
400invalid_request_errorThe request is not valid: the body is not JSON, a required parameter is missing, or the model rejects a parameter value. error.param names the parameter when the gateway knows it.
401auth_errorThe request has no key. Send Authorization: Bearer <virtual key>.
401token_not_found_in_dbThe key is not known to the gateway: it is mistyped, deleted or expired.
403team_model_access_deniedThe model id is not available to the team of the key, or does not exist. GET /v1/models lists the model ids that the key can use.
422budget_exceededThe spend of the team has reached its budget. Model calls stay rejected until the budget is raised or reset.

Limitations

No embeddings

No model of the gateway supports embeddings. POST /v1/embeddings returns 404.

  • POST/v1/embeddings404
Response — 404
{
  "error": {
    "message": "models/gemini-3.1-flash-lite is not found for API version v1beta, or is not supported for embedContent.",
    "type": "invalid_request_error",
    "param": null,
    "code": "404"
  }
}
No single-model lookup

Model ids contain a slash, so GET /v1/models/{model} does not resolve and returns 404. Use GET /v1/models or GET /model_group/info and select the model from the list.

  • GET/v1/models/gemini/gemini-3.1-flash-lite404
Response — 404
{
  "detail": "Not Found"
}
One choice per call

n greater than 1 returns 400, although GET /model_group/info lists n in supported_openai_params. Send one call for each choice.

  • POST/v1/chat/completions400
Response — 400
{
  "error": {
    "message": "Multiple candidates is not enabled for this model",
    "type": "invalid_request_error",
    "param": null,
    "code": "400"
  }
}
Management routes are closed to virtual keys

A virtual key can call only the model routes. Management routes, for example GET /key/info, GET /user/info, GET /spend/logs and GET /health, return 403. For health checks, use GET /health/liveliness and GET /health/readiness, which need no key. For spend, use the spend headers of each response.

  • GET/key/info403
  • GET/user/info403
  • GET/spend/logs403
  • GET/health403
Response — 403
{
  "detail": "Virtual key is not allowed to call this route. Only allowed to call routes: ['llm_api_routes']. Tried to call route: /key/info"
}
The gateway does not serve its own OpenAPI document

GET /openapi.json on the gateway returns 403 with a plain-text body. The OpenAPI document of the gateway is published on this portal.

  • GET/openapi.json403
Response — 403
Forbidden