ChatCompletions Format
Create model responses based on conversation history. Supports streaming and non-streaming responses. Compatible with the OpenAI Chat Completions API.
Base URL
https://api.autorouter.top— Production
Authentication
BearerAuth: http (bearer)
Authenticate using a Bearer Token.
Format: Authorization: Bearer sk-xxxxxx
Endpoints
POST /v1/chat/completions
Chat Completions Format
Create model responses based on conversation history. Supports streaming and non-streaming responses.
Compatible with the OpenAI Chat Completions API.
Request Body
Content-Type: application/json
Example:
{
"model": "gpt-5.4-nano",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}Properties:
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID |
messages | array | Yes | List of conversation messages |
temperature | number | No | Sampling temperature |
top_p | number | No | Nucleus sampling parameter |
n | integer | No | Number of completions to generate |
stream | boolean | No | Whether to stream the response |
stream_options | object | No | - |
stop | string | No | Stop sequences. Can also be an array of strings. |
max_tokens | integer | No | Maximum number of tokens to generate |
max_completion_tokens | integer | No | Maximum completion tokens |
presence_penalty | number | No | - |
frequency_penalty | number | No | - |
logit_bias | object | No | - |
user | string | No | - |
tools | array | No | - |
tool_choice | string | No | Tool selection mode. Can also be an object to specify a particular function. |
response_format | object | No | - |
seed | integer | No | - |
reasoning_effort | string | No | Reasoning effort (for models that support reasoning) |
modalities | array | No | - |
audio | object | No | - |
Responses
200: Successfully created response
Content-Type: application/json
400: Bad request / invalid parameters
Content-Type: application/json
429: Rate limit exceeded
Content-Type: application/json
Request Example
curl -X POST "https://api.autorouter.top/v1/chat/completions" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4-nano",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}'Response Examples
{
"id": "string",
"object": "chat.completion",
"created": 0,
"model": "string",
"choices": [
{
"index": 0,
"message": {
"role": "system",
"content": "string",
"name": "string",
"tool_calls": [
{
"id": "string",
"type": "string",
"function": {
"name": "string",
"arguments": "string"
}
}
],
"tool_call_id": "string",
"reasoning_content": "string"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0,
"prompt_tokens_details": {
"cached_tokens": 0,
"text_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0
}
},
"system_fingerprint": "string"
}Gemini Media Recognition
Gemini Image, PDF, Audio, Video Recognition Request ⚠️Note: Only supports uploading images, PDFs, audio, and video via inlineData in base64 format. fileData.fileUri or File API are not supported.
Responses Format
OpenAI Responses API for creating model responses. Supports multi-turn conversations, tool calling, reasoning, and more.