Create Chat Completion
Creates a model response from conversation history with streaming, tools, and usage accounting.
ProtocolOpenAI Chat Completions
Reference category聊天
Compatible model examples
gpt-4ogpt-4.1gpt-5o3o4-mini
Keep the format. Choose your model.
curl -X POST https://api.routekey.ai/v1/chat/completions \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "Hello from Route Key"
}
],
"stream": false
}'參數
| Name | 類型 | 必填 | Description |
|---|---|---|---|
model | string | 是 | 模型名稱 |
messages | array<object> | 是 | 聊天 |
temperature | number | 否 | Temperature |
top_p | number | 否 | Top P |
stream | boolean | 否 | 即時 |
max_tokens | integer | 否 | Max tokens |
tools | array<object> | 否 | Tools |
response_format | object | 否 | Response format |
回應
| Name | 類型 | 必填 | Description |
|---|---|---|---|
id | string | - | ID |
object | string | - | Object |
created | integer | - | Created |
model | string | - | 模型名稱 |
choices | array<object> | - | Choices |
usage | object | - | Usage |
備註
- OpenAI Chat Completions
- Use the same request shape as the matching provider API when the backend channel is enabled.
Your applicationRouteKeyOpenAI