Chat Completions
POST /v1/chat/completions
Creates a model response for the given chat conversation. Compatible with the OpenAI Chat Completions API.
Request Body
| Parameter | Type | Description |
|---|---|---|
model* | string | ID of the model to use (e.g. gpt-5.4, qwen3.5-flash, gemini-2.5-flash). |
messages* | array | List of messages in the conversation. Each item has role and content. |
stream | boolean | If true, return a stream of SSE events. Default: false. |
temperature | number | Sampling temperature 0–2. Higher = more random. Default: 1. |
max_tokens | integer | Max tokens to generate. Model-dependent ceiling. |
top_p | number | Nucleus sampling probability. 0–1. Default: 1. |
stop | string[] | Up to 4 sequences where generation will stop. |
n | integer | Number of completion choices to generate. Default: 1. |
Example Request
POST /v1/chat/completions
Authorization: Bearer YOUR_API_KEY
{
"model": "gpt-5.4-mini",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
"temperature": 0.7,
"max_tokens": 256
} Example Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1714000000,
"model": "qwen3.5-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The capital of France is Paris."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 26,
"completion_tokens": 9,
"total_tokens": 35
}
} This endpoint routes to every provider behind the gateway — pick a model from the model price comparison to see per-token pricing side by side.