Chat completions
Example
Common parameters
Streaming
Related
For Grok Build, prefer the Responses path (api_backend = "responses").Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
POST /v1/chat/completions
POST /v1/chat/completions
curl https://sub2api.lingshichat.top/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4.5",
"messages": [
{"role": "system", "content": "You are a helpful assistant"},
{"role": "user", "content": "Hello"}
],
"temperature": 0.7,
"stream": false
}'
| Param | Type | Required | Notes |
|---|---|---|---|
model | string | yes | Prefer grok-4.5 |
messages | array | yes | Chat messages |
temperature | number | no | Sampling temperature |
max_tokens | integer | no | Max output tokens |
stream | boolean | no | SSE streaming |
{
"model": "grok-4.5",
"stream": true,
"messages": [{"role": "user", "content": "Hello"}]
}
api_backend = "responses").