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 URL | https://models.convergestudios.ai |
|---|---|
| Authentication | A 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 formats | OpenAI Chat Completions, Completions and Responses; Anthropic Messages |
| OpenAPI document | /openapi/ai-gateway.json |
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.
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
}'{
"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.
Chat
Generate text with the OpenAI and Anthropic request formats.
Models
Discover the models available to a key and their capabilities.
Tokens
Count tokens before a call.
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 id | Input tokens | Output tokens | Image input | Function calling | response_format | Reasoning efforts |
|---|---|---|---|---|---|---|
| gemini/gemini-4-carbon | 1,048,576 | 1,048,576 | Yes | Yes, parallel | Yes | none, low, medium, high |
| gemini/gemini-4-hydrogen | 1,048,576 | 1,048,576 | Yes | Yes, parallel | Yes | none, low, medium, high |
| gemini/gemini-4-argon | 1,048,576 | 1,048,576 | Yes | Yes, parallel | Yes | none, low, medium, high |
| gemini/gemini-3.8-flash | 1,048,576 | 65,536 | Yes | Yes, parallel | Yes | none, low, medium, high |
| gemini/gemini-3.6-flash | 1,048,576 | 65,536 | Yes | Yes, parallel | Yes | — |
| gemini/gemini-3.5-flash-lite | 1,048,576 | 65,536 | Yes | Yes, parallel | Yes | — |
| gemini/gemini-3.1-flash-lite | 1,048,576 | 65,536 | Yes | Yes, parallel | Yes | — |
| gemini/gemini-3.1-pro-preview | 1,048,576 | 65,536 | Yes | Yes | Yes | — |
| gemini/gemini-3-flash-preview | 1,048,576 | 65,536 | Yes | Yes, parallel | Yes | — |
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.
On some models, reasoning_effort: "none" still produces a small number of reasoning tokens.
Rate limits
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.
| Header | Description | Example |
|---|---|---|
| x-ratelimit-limit-requests | Request limit per minute of the deployment that served the call. | 15 |
| x-ratelimit-remaining-requests | Requests that remain in the current minute on the deployment that served the call. | 11 |
| x-ratelimit-limit-tokens | Token limit per minute of the deployment that served the call. | 250000 |
| x-ratelimit-remaining-tokens | Tokens that remain in the current minute on the deployment that served the call. | 249982 |
Budgets and spend
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 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.
When the budget is exceeded, GET /v1/models still returns 200. Only model calls are rejected.
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
| Header | Description | Example |
|---|---|---|
| x-litellm-call-id | Identifier of this call on the gateway. Quote it in a support request. | — |
| x-litellm-model-group | The model id that served the call, as sent in model. | gemini/gemini-3.1-flash-lite |
| x-litellm-response-cost | Spend 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-spend | Approximate 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. | — |
{
"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": {
"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"
}
}| HTTP | error.type | Meaning |
|---|---|---|
| 400 | invalid_request_error | The 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. |
| 401 | auth_error | The request has no key. Send Authorization: Bearer <virtual key>. |
| 401 | token_not_found_in_db | The key is not known to the gateway: it is mistyped, deleted or expired. |
| 403 | team_model_access_denied | The 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. |
| 422 | budget_exceeded | The spend of the team has reached its budget. Model calls stay rejected until the budget is raised or reset. |
Limitations
No model of the gateway supports embeddings. POST /v1/embeddings returns 404.
- POST/v1/embeddings404
{
"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"
}
}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
{
"detail": "Not Found"
}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
{
"error": {
"message": "Multiple candidates is not enabled for this model",
"type": "invalid_request_error",
"param": null,
"code": "400"
}
}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
{
"detail": "Virtual key is not allowed to call this route. Only allowed to call routes: ['llm_api_routes']. Tried to call route: /key/info"
}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
Forbidden