| 接口 | 协议 | 适用客户端 |
|---|---|---|
POST /v1/chat/completions | OpenAI Chat Completions | OpenAI SDK / NextChat 等 |
POST /v1/messages | Anthropic Messages | Claude Desktop / Claude Code |
POST /v1/responses | OpenAI Responses | Codex |
生图 / 生视频 / 向量 / 语音合成 / 文件上传 / 素材管理等能力,均有专项文档,见其他文件夹内的文档。
https://api.numspirit.com/sk-silievo-xxxxxxxx。/v1 接口均需要):| 方式 | Header / 参数 | 示例 |
|---|---|---|
| Bearer Token | Authorization: Bearer sk-silievo-xxx | 推荐,各协议通用 |
| OpenAI 兼容 | x-api-key: sk-silievo-xxx | Claude Code 等 |
| Gemini / Vertex 兼容 | x-goog-api-key: sk-silievo-xxx | Gemini CLI |
| 写法 | 示例 | 路由行为 |
|---|---|---|
渠道前缀 渠道code/模型ID | aliyun/qwen3.6-flash | 确定路由到指定渠道(同一模型多渠道时用它区分) |
POST /v1/chat/completionsstream 字段决定(不是靠 Accept 头)。Content-Type: application/json
Authorization: Bearer sk-silievo-xxxxxxxx| 参数 | 类型 | 说明 |
|---|---|---|
model | string | 必填,模型 ID(支持渠道前缀,如 aliyun/qwen3.6-flash) |
messages | array | 必填,消息列表 [{role: system/user/assistant, content}] |
stream | boolean | 是否流式输出,true 返回 SSE |
max_tokens | integer | 最大输出 token |
temperature | number | 采样温度 |
tools / tool_choice | array / object | 工具调用(定义 + 选择策略,可选) |
| 其它 | — | top_p/top_k/stop/stream_options/max_completion_tokens/user/seed 等自动透传 |
chat.completion 格式,含 usage):{
"id": "chatcmpl-a92e1dfb5fe642ae8bd115af2c8300e0",
"object": "chat.completion",
"created": 1781526640,
"model": "qwen3.6-plus",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "你好!很高兴见到你。" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 12, "completion_tokens": 2058, "total_tokens": 2070 }
}[DONE] 结尾):POST /v1/messagesContent-Type: application/json
Authorization: Bearer sk-silievo-xxxxxxxx
x-api-key: sk-silievo-xxxxxxxxAuthorization与x-api-key任选其一,均可通过鉴权。
| 参数 | 类型 | 说明 |
|---|---|---|
model | string | 必填,模型 ID |
messages | array | 必填,消息列表 [{role: user/assistant, content: 文本 或 多模态列表}] |
system | string / array | 可选,系统提示(顶层字段) |
max_tokens | integer | 最大输出 token(Anthropic 协议要求必传) |
temperature | number | 采样温度 |
stream | boolean | 是否流式输出 |
tools / tool_choice | array / object | 工具调用(定义 + 选择策略,可选) |
| 其它 | — | thinking/top_p/top_k/stop_sequences/metadata/output_config/cache_control 等自动透传 |
message 类型):{
"id": "msg_bdrk_017rzXgLFmmVktFasHm7Ecse",
"type": "message",
"role": "assistant",
"model": "gpt-5.2",
"content": [ { "type": "text", "text": "因为……" } ],
"stop_reason": "end_turn",
"usage": { "input_tokens": 11, "output_tokens": 19 }
}message_start → content_block_start → content_block_delta → content_block_stop → message_delta → message_stop):POST /v1/responsesContent-Type: application/json
Authorization: Bearer sk-silievo-xxxxxxxx| 参数 | 类型 | 说明 |
|---|---|---|
model | string | 必填,模型 ID |
input | string / array | 必填,输入内容,字符串或结构化输入列表 |
stream | boolean | 是否流式输出 |
max_output_tokens | integer | 最大输出 token |
reasoning | object | 推理强度 {effort: low/medium/high} |
tools / tool_choice | array / object | 工具调用(定义 + 选择策略,可选) |
| 其它 | — | temperature/top_p/top_k/stream_options/metadata/include_reasoning 等自动透传 |
response 对象,含 output / usage):{
"id": "chatcmpl-9a1d18cd-e83b-96d4-90e8-c0b8ce4d5d6e",
"object": "response",
"created": 1781527443,
"model": "qwen3.6-flash",
"status": "completed",
"output": [
{
"type": "message",
"role": "assistant",
"content": [ { "type": "output_text", "text": "猪八戒在《西游记》中屡次嚷着“分行李”……" } ]
}
],
"usage": { "input_tokens": 31, "output_tokens": 2097, "total_tokens": 2128 }
}stream: true 时返回 SSE,事件含 response.output_text.delta 等):| 错误类型 | HTTP 状态码 | 说明 | 解决方案 |
|---|---|---|---|
auth_error | 401 | 认证失败,API Key 无效或未提供 | 检查 Authorization Header 格式与 Key |
quota_exceeded | 402 | 额度已用尽 / 余额不足 | 充值或联系客服 |
invalid_request | 400 | 请求参数错误 | 检查请求体 JSON 格式和必填字段 |
no_channel | 503 | 模型未配置 有效渠道 | 检查 model 参数是否正确 |
upstream_error | 502/500 | 上游 API 错误 | 稍后重试或联系客服 |
MODEL_NOT_FOUND | 404 | proxy_channel_models 未配置该 model_id | 检查模型 ID 是否可用 |
CHANNEL_NOT_FOUND | 502 | 渠道未配置 / 被禁用 / 前缀与 channel_code 不一致 | 检查渠道配置 |
CHANNEL_NO_DEFAULT | 502 | 纯模型 ID 没有可用渠道兜底 | 使用 渠道code/模型ID 写法 |