Converge AI Gateway
Converge AI Gateway · Chat
Create a message (Anthropic format)
POST
Generates the next assistant message in the Anthropic Messages format. Clients built on the Anthropic SDKs can use the gateway with the base URL changed. The key is accepted in Authorization: Bearer or in x-api-key.
Request
Request line
POST https://models.convergestudios.ai/v1/messagesAuthentication
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 body
JSON, with Content-Type: application/json. A dash in the Required column means that requiredness is not stated.
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | — | Model id from `GET /v1/models`. |
| max_tokens | integer | — | Maximum number of output tokens. |
| messages | array | — | The conversation, as `role` and `content` pairs. |
Request headers
| Header | Description | Example |
|---|---|---|
| anthropic-version | Anthropic API version, as the Anthropic SDKs send it. | 2023-06-01 |
Examples
Message, key in AuthorizationShow
Request (curl)
curl -sS -X POST https://models.convergestudios.ai/v1/messages \
-H "Authorization: Bearer $GATEWAY_API_KEY" \
-H 'anthropic-version: 2023-06-01' \
-H "Content-Type: application/json" \
-d '{
"model": "gemini/gemini-3.1-flash-lite",
"max_tokens": 16,
"messages": [
{
"role": "user",
"content": "Reply with the single word: pong"
}
]
}'Response — 200
{
"id": "example-16",
"type": "message",
"role": "assistant",
"model": "gemini/gemini-3.1-flash-lite",
"stop_sequence": null,
"usage": {
"input_tokens": 8,
"output_tokens": 1
},
"content": [
{
"type": "text",
"text": "pong"
}
],
"stop_reason": "end_turn",
"stop_details": null
}Message, key in x-api-keyShow
Request (curl)
curl -sS -X POST https://models.convergestudios.ai/v1/messages \
-H "x-api-key: $GATEWAY_API_KEY" \
-H 'anthropic-version: 2023-06-01' \
-H "Content-Type: application/json" \
-d '{
"model": "gemini/gemini-3.1-flash-lite",
"max_tokens": 16,
"messages": [
{
"role": "user",
"content": "Reply with the single word: pong"
}
]
}'Response — 200
{
"id": "example-16",
"type": "message",
"role": "assistant",
"model": "gemini/gemini-3.1-flash-lite",
"stop_sequence": null,
"usage": {
"input_tokens": 8,
"output_tokens": 1
},
"content": [
{
"type": "text",
"text": "pong"
}
],
"stop_reason": "end_turn",
"stop_details": null
}Response
200. A message object with the text in content[0].text, the reason that generation stopped in stop_reason, and token counts in usage.
| Field | Type | Description |
|---|---|---|
| id | string | — |
| type | string | — |
| role | string | — |
| model | string | — |
| stop_sequence | null | — |
| usage | object | — |
| usage.input_tokens | integer | — |
| usage.output_tokens | integer | — |
| content[] | array | — |
| content[].type | string | — |
| content[].text | string | — |
| stop_reason | string | — |
| stop_details | null | — |
Response 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. | — |
| 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. | 6 |
| 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. | 248612 |
