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/completions
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.

Request body

JSON, with Content-Type: application/json. A dash in the Required column means that requiredness is not stated.

FieldTypeRequiredDescription
modelstring—Model id from `GET /v1/models`.
promptstring—The text to complete.
max_tokensinteger—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.

FieldTypeDescription
idstring—
objectstring—
createdinteger—
modelstring—
choices[]array—
choices[].finish_reasonstring—
choices[].indexinteger—
choices[].textstring—
choices[].logprobsnull—
usageobject—
usage.completion_tokensinteger—
usage.prompt_tokensinteger—
usage.total_tokensinteger—
usage.completion_tokens_detailsobject—
usage.completion_tokens_details.accepted_prediction_tokensnull—
usage.completion_tokens_details.audio_tokensnull—
usage.completion_tokens_details.reasoning_tokensnull—
usage.completion_tokens_details.rejected_prediction_tokensnull—
usage.completion_tokens_details.text_tokensinteger—
usage.completion_tokens_details.image_tokensnull—
usage.completion_tokens_details.video_tokensnull—
usage.prompt_tokens_detailsobject—
usage.prompt_tokens_details.audio_tokensnull—
usage.prompt_tokens_details.cached_tokensnull—
usage.prompt_tokens_details.text_tokensinteger—
usage.prompt_tokens_details.image_tokensnull—
usage.prompt_tokens_details.video_tokensnull—
usage.cache_read_input_tokensnull—

Response 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.—
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.8
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.248630