Skip to content

Responses API

OpenAI Responses 兼容接口,Codex 客户端默认使用该协议。

POST https://api.ashpetals.com/v1/responses

基础请求

bash
curl https://api.ashpetals.com/v1/responses \
  -H "Authorization: Bearer sk-你的APIKey" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-sol",
    "input": "用 Python 写一个快速排序",
    "max_output_tokens": 500
  }'

关键字段

参数类型说明
modelstring必填,模型 ID
inputstring/array输入内容,支持字符串或消息数组
instructionsstring系统指令
toolsarray工具列表(function / web_search 等)
max_output_tokensint最大输出 token 数
streamboolean是否流式返回

注意事项

  • Responses 协议主要面向 Codex 等 Agent 客户端;普通对话场景使用 Chat Completions 即可。
  • 模型是否支持该协议以 /v1/models 返回的 supports_responses 字段为准。

AshPetals API — 单主站 · OpenAI 兼容