Skip to main content
POST
  • 请求与响应格式与 OpenAI Responses API 一致,可以使用 OpenAI SDK 的 client.responses.create。
  • 适合推理模型、函数调用、远程 MCP 等场景,也是 Codex CLI 使用的接口。
  • 支持该接口的模型在 模型列表 的 supported_endpoint_types 中包含 openai-response。

鉴权

string
必填
Bearer <API Key>。在 API 密钥 页面创建。

请求参数

string
必填
模型 ID,例如 gpt-6。可用模型以 模型广场 为准。
string | array
必填
模型输入。字符串等同于一条用户消息;数组形式可以包含多条消息和多模态内容:
string
系统指令,作用相当于 Chat Completions 中的 system 消息。
boolean
默认值:"false"
是否以 SSE 流式返回。事件类型包括 response.created、response.output_text.delta、response.output_text.done、response.completed 等。
integer
最大输出 token 数,包含推理 token。
object
推理配置。
array
工具列表。函数工具使用扁平结构:
远程 MCP 工具:
string | object
工具调用策略:auto、none、required,或 {"type": "function", "name": "..."}。
object
文本输出配置。结构化输出写法:{"format": {"type": "json_schema", "name": "...", "schema": {...}}}。
number
采样温度。推理模型通常不支持。
string
上一轮响应的 id,用于多轮对话。是否可用取决于上游是否保存了该响应,建议在 input 中自行携带历史消息。
boolean
是否让上游保存本次响应。

响应

string
响应 ID。
string
固定为 response。
string
响应状态:completed、incomplete、failed 等。
array
输出项列表,按生成顺序排列。
object
token 用量。

函数调用

在 Codex CLI 中使用

在 ~/.codex/config.toml 中添加:
然后设置环境变量 NODYLINK_API_KEY 并运行 codex。