哪吒网关
POST https://nezhagate.com/v1/chat/completions

OpenAI 兼容的对话补全接口,支持流式输出(stream)、多轮对话与结构化任务。仅需更换 model 字段即可在不同对话模型间切换。

在 Playground 试用 →

认证

Header
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

在控制台创建 API Key 后即可调用。

请求参数

参数类型必填说明
model string 模型 ID,固定为 gpt-5.5。
messages array 对话消息数组,每项含 role(system/user/assistant)与 content。
stream boolean 是否以 SSE 流式返回。默认 false。
temperature number 采样温度,0–2,越高越随机。
max_tokens integer 最大生成 token 数。

请求示例

cURL
curl https://nezhagate.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [{"role": "user", "content": "Hello"}],
    "stream": false
  }'

响应示例

200 · JSON
{
  "id": "chatcmpl_xxx",
  "object": "chat.completion",
  "model": "gpt-5.5",
  "choices": [
    {"index": 0, "message": {"role": "assistant", "content": "Hello!"}, "finish_reason": "stop"}
  ],
  "usage": {"prompt_tokens": 11, "completion_tokens": 7, "total_tokens": 18}
}

错误码

Code说明
401Invalid or missing API key
402Insufficient balance / key limit reached
400Invalid parameters or model
429Rate limited
502All upstream providers failed