Api reference
POST /v1/chat/completions
Create a chat completion with GLM 5.2 on Drise.
POST https://platform.drise.ai/v1/chat/completions
OpenAI-compatible chat completion endpoint. Returns a chat completion JSON response.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer <your_drise_key> |
Content-Type | yes | application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | yes | One of the Drise GLM 5.2 model IDs (see below). |
messages | array | yes | OpenAI-style messages array. |
stream | boolean | no | Set to true for SSE streaming. |
temperature | number | no | Sampling temperature. |
max_tokens | integer | no | Maximum tokens to generate. |
Model IDs
| ID | Context | Reasoning |
|---|---|---|
drise-glm-5.2 | 1,000,000 tokens | yes |
drise-glm-5.2-fast | 1,000,000 tokens | no |
drise-glm-5.2-short | 200,000 tokens | yes |
drise-glm-5.2-short-fast | 200,000 tokens | no |
drise-vision | GLM 5.2 with vision | yes |
All variants are FP8-quantised. See Models for the full breakdown.
Example request
curl https://platform.drise.ai/v1/chat/completions \
-H "Authorization: Bearer $DRISE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "drise-glm-5.2",
"messages": [
{"role": "system", "content": "You are a helpful coding assistant."},
{"role": "user", "content": "Write a Python function that reads a CSV file."}
]
}'For fast, no-reasoning throughput:
curl https://platform.drise.ai/v1/chat/completions \
-H "Authorization: Bearer $DRISE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "drise-glm-5.2-fast",
"messages": [{"role": "user", "content": "Summarise this file in 3 lines."}]
}'Example response
{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "drise-glm-5.2",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "import csv\n..."
},
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 12, "completion_tokens": 48, "total_tokens": 60 }
}