Source: https://01router.com/zh/docs/models/gpt-5.6-luna/chat Base URL: https://01router.com/api/v1 # GPT-5.6 Luna · 对话补全 对话模型(GPT、Claude、Gemini、Grok、DeepSeek 等)使用 OpenAI Chat Completions 格式,官方 OpenAI SDK 将 base URL 设为 https://01router.com/api/v1 即可调用。传 "stream": true 获得 SSE 流式输出。调用前按输入 + max_tokens(未传时为 4096)预扣积分,回复结束后按实际 token 用量结算;请求 ID 会出现在 X-Gateway-Request-Id 响应头和任务日志中。 `POST /api/v1/chat/completions` 需要 Bearer API Key ## 输入参数 | Field | Type | Required | Description | Constraints | | --- | --- | --- | --- | --- | | model | string | yes | 模型目录中的 slug;项目密钥也可使用项目自定义的模型 slug。 | options: [ "gpt-5.6-luna" ] | | messages | object[] | yes | 非空消息数组,每项包含 role 和 content;content 可包含模型支持的多模态内容。 | | | provider | string | no | 可选供应商 slug。不传时自动路由;项目配置可能固定供应商。 | | | project | string | no | 可选项目 ID,使用该项目公开的模型目录和路由配置。 | | | stream | boolean | no | 默认 false;true 返回 text/event-stream 数据流,以 data: [DONE] 结束。 | default: false | | max_tokens | integer | no | 正整数,默认 4096,不可与 max_completion_tokens 同时传入。 | default: 4096; min: 1 | | max_completion_tokens | integer | no | 正整数,默认 4096,不可与 max_completion_tokens 同时传入。 | | | temperature | number | no | OpenAI 兼容的采样、工具调用与结构化输出能力取决于模型和供应商。仅支持 n = 1。 | | | tools | object[] | no | OpenAI 兼容的采样、工具调用与结构化输出能力取决于模型和供应商。仅支持 n = 1。 | | | response_format | object | no | OpenAI 兼容的采样、工具调用与结构化输出能力取决于模型和供应商。仅支持 n = 1。 | | ## 输出字段 | Field | Type | Required | Description | Constraints | | --- | --- | --- | --- | --- | | id | string | — | 创建任务返回的生成 ID。 | | | object | string | — | chat.completion / chat.completion.chunk | | | model | string | — | 模型目录中的 slug;项目密钥也可使用项目自定义的模型 slug。 | | | choices | array | — | 回答列表。非流式使用 choices[].message,流式数据块使用 choices[].delta。 | | | usage | object | — | 包含 prompt_tokens、completion_tokens、total_tokens。流式响应在供应商提供时包含用量。 | | ## cURL ```bash curl 'https://01router.com/api/v1/chat/completions' \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.6-luna", "messages": [ { "role": "user", "content": "Hello!" } ], "max_tokens": 512, "stream": false }' ``` ## 200 · application/json ```json { "id": "chat_example", "object": "chat.completion", "model": "gpt-5.6-luna", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello!" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 8, "completion_tokens": 2, "total_tokens": 10 } } ``` ## SSE · stream: true ```text data: {"id":"chat_example","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Hello!"},"finish_reason":null}]} data: [DONE] ``` ## 使用说明 - OpenAI 兼容的采样、工具调用与结构化输出能力取决于模型和供应商。仅支持 n = 1。