Documentation Index
Fetch the complete documentation index at: https://docs.crazyrouter.com/llms.txt
Use this file to discover all available pages before exploring further.
Claude OpenAI 兼容格式
POST /v1/chat/completions
截至 2026 年 3 月 23 日,Crazyrouter 生产环境已验证:
claude-sonnet-4-6 非流式请求返回 object: "chat.completion"
message 当前稳定包含 role、content
- 流式请求返回
chat.completion.chunk
- SSE 仍以
data: [DONE] 结束
非流式请求
curl https://crazyrouter.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Compare PostgreSQL and MySQL in one paragraph."}
],
"max_tokens": 256,
"temperature": 0.2
}'
关键响应形态:
{
"object": "chat.completion",
"model": "claude-sonnet-4-6",
"choices": [
{
"message": {
"role": "assistant",
"content": "PostgreSQL and MySQL are both popular..."
}
}
]
}
流式请求
curl https://crazyrouter.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [
{"role": "user", "content": "Say hello in one sentence."}
],
"max_tokens": 128,
"stream": true
}'
2026-03-23 的生产环境流式探针里,开头片段如下:
data: {"object":"chat.completion.chunk","model":"claude-sonnet-4-6","choices":[{"delta":{"role":"assistant"}}]}
data: {"object":"chat.completion.chunk","model":"claude-sonnet-4-6","choices":[{"delta":{"content":"Hello! ..."}}]}
data: [DONE]