model 字段即可。| 线路 | Base URL | 说明 |
|---|---|---|
| 国内加速(推荐) | https://cdn.wusag.com | 走国内 CDN 节点 |
| 海外直连 | https://api.xinliu.one | 海外服务器或加速节点异常时使用 |
POST {Base URL}/v1/chat/completionsAuthorization: Bearer 你的令牌Content-Type: application/json| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 模型名,调 GET /v1/models 拉取真实列表,常见:gpt-4o-mini gpt-4o claude-opus-4-7 claude-sonnet-4-6 deepseek-v4-pro qwen3.6-plus glm-5.1 等 |
messages | array | 是 | 对话历史,元素 {role, content},role 取 system / user / assistant / tool |
stream | bool | 否 | 流式返回,默认 false。设 true 时按 SSE 推送 |
temperature | number | 否 | 0~2,默认 1 |
max_tokens | int | 否 | 单次最大输出 token 数 |
top_p | number | 否 | 核采样,0~1 |
tools | array | 否 | Function Calling 工具列表 |
response_format | object | 否 | 响应格式约束,如 {"type": "json_object"} |
messages[].content 数组里:{
"content": [
{"type": "text", "text": "这张图是什么"},
{"type": "image_url", "image_url": {"url": "https://xxx.jpg"}}
]
}"stream": true,服务端返回 text/event-stream,每行 data: {chunk_json},最后 data: [DONE] 结束。prompt_tokens + completion_tokens × 模型倍率,详见后台「模型价格」。401 令牌无效或未提供402 余额不足404 模型不存在或未开通429 速率限制500 服务端错误