Converge AI Gateway
Converge AI Gateway · Chat
Create a text completion
POST
Completes a text prompt, in the legacy OpenAI Completions format.
Request
Request line
POST https://models.convergestudios.ai/v1/completionsAuthentication
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.
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`. |
| prompt | string | — | The text to complete. |
| max_tokens | integer | — | Maximum number of completion tokens. |
Examples
Text completionShow
Request (curl)
curl -sS -X POST https://models.convergestudios.ai/v1/completions \
-H "Authorization: Bearer $GATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini/gemini-3.1-flash-lite",
"prompt": "Say hi",
"max_tokens": 10
}'Response — 200
{
"id": "example-13",
"object": "text_completion",
"created": 1795611800,
"model": "gemini/gemini-3.1-flash-lite",
"choices": [
{
"finish_reason": "length",
"index": 0,
"text": "Hi! How can I help",
"logprobs": null
}
],
"usage": {
"completion_tokens": 6,
"prompt_tokens": 3,
"total_tokens": 9,
"completion_tokens_details": {
"accepted_prediction_tokens": null,
"audio_tokens": null,
"reasoning_tokens": null,
"rejected_prediction_tokens": null,
"text_tokens": 6,
"image_tokens": null,
"video_tokens": null
},
"prompt_tokens_details": {
"audio_tokens": null,
"cached_tokens": null,
"text_tokens": 3,
"image_tokens": null,
"video_tokens": null
},
"cache_read_input_tokens": null
}
}Response
200. The completion in choices[0].text and token counts in usage.
| Field | Type | Description |
|---|---|---|
| id | string | — |
| object | string | — |
| created | integer | — |
| model | string | — |
| choices[] | array | — |
| choices[].finish_reason | string | — |
| choices[].index | integer | — |
| choices[].text | string | — |
| choices[].logprobs | null | — |
| usage | object | — |
| usage.completion_tokens | integer | — |
| usage.prompt_tokens | integer | — |
| usage.total_tokens | integer | — |
| usage.completion_tokens_details | object | — |
| usage.completion_tokens_details.accepted_prediction_tokens | null | — |
| usage.completion_tokens_details.audio_tokens | null | — |
| usage.completion_tokens_details.reasoning_tokens | null | — |
| usage.completion_tokens_details.rejected_prediction_tokens | null | — |
| usage.completion_tokens_details.text_tokens | integer | — |
| usage.completion_tokens_details.image_tokens | null | — |
| usage.completion_tokens_details.video_tokens | null | — |
| usage.prompt_tokens_details | object | — |
| usage.prompt_tokens_details.audio_tokens | null | — |
| usage.prompt_tokens_details.cached_tokens | null | — |
| usage.prompt_tokens_details.text_tokens | integer | — |
| usage.prompt_tokens_details.image_tokens | null | — |
| usage.prompt_tokens_details.video_tokens | null | — |
| usage.cache_read_input_tokens | 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. | 8 |
| 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. | 248630 |
