LLM Gateway

Chat Completions

Create a completion for the chat conversation

POST
/v1/chat/completions
AuthorizationBearer <token>

Bearer token authentication using API keys

In: header

modelstring
messages
temperature?number|null
max_tokens?number|null
top_p?number|null
frequency_penalty?number|null
presence_penalty?number|null
response_format?
stream?boolean
Defaultfalse
tools?
tool_choice?string|
Value in"required" | "none" | "auto"
reasoning_effort?string|null

Controls the reasoning effort for reasoning-capable models

Value in"minimal" | "low" | "medium" | "high" | "xhigh"
reasoning?

Unified reasoning configuration object for controlling reasoning behavior

effort?string|null

Controls the computational effort for supported models (currently only claude-opus-4-5-20251101)

Value in"low" | "medium" | "high"
free_models_only?boolean

When used with auto routing, only route to free models (models with zero input and output pricing)

Defaultfalse
onboarding?boolean

When true, skips email verification for free model usage. Intended for onboarding flows.

Defaultfalse
no_reasoning?boolean

When used with auto routing, exclude reasoning models from selection

Defaultfalse
sensitive_word_check?
image_config?
web_search?boolean

Enable native web search for models that support it. When enabled, the model can search the web for real-time information.

Defaultfalse
plugins?

Plugins to enable for this request. Currently supported: response-healing (automatically repairs malformed JSON responses when using response_format)

Response Body

curl -X POST "https://api.llmgateway.io/v1/chat/completions" \  -H "Content-Type: application/json" \  -d '{    "model": "gpt-5",    "messages": [      {        "role": "user"      }    ]  }'
{
  "id": "string",
  "object": "string",
  "created": 0,
  "model": "string",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "string",
        "content": "string",
        "reasoning": "string",
        "tool_calls": [
          {
            "id": "string",
            "type": "function",
            "function": {
              "name": "string",
              "arguments": "string"
            }
          }
        ],
        "images": [
          {
            "type": "image_url",
            "image_url": {
              "url": "string"
            }
          }
        ]
      },
      "finish_reason": "string"
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0,
    "reasoning_tokens": 0,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "cost_usd_total": 0,
    "cost_usd_input": 0,
    "cost_usd_output": 0,
    "cost_usd_cached_input": 0,
    "info": "string",
    "cost_usd_request": 0
  },
  "metadata": {
    "requested_model": "string",
    "requested_provider": "string",
    "used_model": "string",
    "used_provider": "string",
    "underlying_used_model": "string",
    "routing": [
      {
        "provider": "string",
        "model": "string",
        "status_code": 0,
        "error_type": "string"
      }
    ]
  }
}
{
  "error": {
    "message": "string",
    "type": "string",
    "param": "string",
    "code": "string"
  }
}

How is this guide?

Last updated on