Chat Completions
The LLMTR gateway is compatible with the OpenAI Chat Completions API. All requests POST to https://llmtr.com/v1/chat/completions.
Request
Section titled “Request”POST /v1/chat/completionsAuthorization: Bearer sk_your_keyContent-Type: application/jsonBody parameters
Section titled “Body parameters”| Field | Type | Required | Description |
|---|---|---|---|
model | string | yes | Canonical model ID (e.g. openai/gpt-4o) |
messages | array | yes | OpenAI messages format |
stream | boolean | no | true enables SSE stream |
temperature | number | no | 0-2 range, model-specific default |
max_tokens | integer | no | Output token cap |
top_p | number | no | Nucleus sampling |
frequency_penalty | number | no | -2 to 2 |
presence_penalty | number | no | -2 to 2 |
stop | string/array | no | Stop sequences |
response_format | object | no | { "type": "json_object" } on supported models |
tools | array | no | Function calling (supported models) |
tool_choice | string/object | no | auto, none or specific tool |
Basic example
Section titled “Basic example”curl https://llmtr.com/v1/chat/completions \ -H "Authorization: Bearer sk_your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/gpt-4o", "messages": [ {"role": "system", "content": "You are a concise assistant."}, {"role": "user", "content": "What is LLMTR?"} ], "temperature": 0.3, "max_tokens": 200 }'Response
Section titled “Response”Successful response mirrors OpenAI’s format exactly:
{ "id": "chatcmpl-xxx", "object": "chat.completion", "created": 1739200000, "model": "openai/gpt-4o", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "LLMTR is a unified gateway..." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 24, "completion_tokens": 52, "total_tokens": 76 }}Model identifier format
Section titled “Model identifier format”Models are always referenced as provider/model:
openai/gpt-4oanthropic/claude-sonnet-4.5google/gemini-2.5-flashdeepseek/deepseek-v4-flashmistral/mistral-large-latest
Use the dashboard model list or /api/models for the full catalog.
Provider-specific behaviors
Section titled “Provider-specific behaviors”Some providers support extra body fields or custom options. You can include supported fields directly in the request body.
Xiaomi MiMo
Section titled “Xiaomi MiMo”Applies to mimo/mimo-v2-pro, mimo/mimo-v2-omni, mimo/mimo-v2-flash.
Enabling web search. Both forms are accepted:
// Option 1: Via the tools field{ "tools": [{ "type": "web_search" }] }
// Option 2: Via the body field{ "webSearchEnabled": true }Search-enabled requests may carry extra provider-side charges. Check the current model pricing before sending production traffic.
Thinking control. On supported models, add thinking to the body to control this behavior:
{ "thinking": { "type": "enabled" } } // or "disabled"Error codes
Section titled “Error codes”| HTTP | error.type | Meaning |
|---|---|---|
| 400 | invalid_request_error | Invalid parameter / missing field |
| 401 | auth_error | Invalid or expired API key |
| 403 | forbidden | No access to the model |
| 429 | rate_limit_exceeded | Rate limit hit |
| 500 | internal_error | Gateway internal error |
| 502 | provider_error | Upstream provider failure |
See Errors for the full list.