OpenAI Responses
/v1/responses 兼容接口,适用于 Codex 类工具与多轮 previous_response_id 链式调用。
端点
POST/v1/responses
| 字段 | 类型 | 说明 | |
|---|---|---|---|
| model | string | 必填 | 模型名称。 |
| input | string | array | 必填 | 文本或结构化输入项。 |
| instructions | string | 可选 | 系统指令。 |
| previous_response_id | string | 可选 | 续接上一轮响应。 |
| tools | array | 可选 | 工具定义,透传上游。 |
| stream | boolean | 可选 | SSE 事件流:response.created … response.output_text.delta … response.completed。 |
curl https://www.link42.ai/v1/responses \
-H "Authorization: Bearer $LINK42_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-v4-flash", "input": "写一个判断素数的 Python 函数"}'- Codex CLI / OpenAI Agents SDK 只需把 base_url 指向 https://www.link42.ai/v1。
按模型对照
以下两个模型的原生形态就是 Responses:私有协议里用顶层 input[] 提交,标准接口上用本页的 /v1/responses。
| 模型 ID | 名称 | 上游 | 计费 | 差异字段 | 限制与注意 |
|---|---|---|---|---|---|
| seed-1-6-250915 | Seed-1.6 | BytePlus Ark | 按 token | input[].content 支持 input_text 与 input_image;output[] 里除 message 外还会出现 reasoning 项(summary[].summary_text);usage 为 input_tokens / output_tokens,带 input_tokens_details.cached_tokens 与 output_tokens_details.reasoning_tokens | 单次输入超过 128,000 token 后整次调用单价 ×2;图片输入计入 input_tokens 并按文本输入价结算 |
| deepseek-v3-2-251201 | DeepSeek-3.2 | BytePlus Ark | 按 token | tools 支持 [{"type": "web_search", "max_keyword": 3}];命中搜索时 output[] 里会插入 web_search_call 项(带 action.query),usage 增加 tool_usage.web_search 与 tool_usage_details.web_search | 长上下文阈值是 32,000 token,比 Seed 系列低;超过后整次调用单价 ×2。工具调用次数本身不计费,只计 token |
- stream=true 时,standard_v1 密钥拿到逐帧转发的真实 SSE,legacy_v1 密钥拿到缓冲成一整段的响应体——这是旧系统的伪流式行为。