跳转到主要内容
POST
/
v1
/
responses
创建模型响应
curl --request POST \
  --url https://www.anyfast.ai/v1/responses \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-5.4",
  "input": [
    {
      "role": "user",
      "content": "你好!"
    }
  ],
  "stream": false,
  "temperature": 1,
  "top_p": 0.5,
  "frequency_penalty": 0,
  "presence_penalty": 0,
  "max_output_tokens": 2,
  "stop": "<string>",
  "n": 1,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "low"
  },
  "reasoning": {
    "effort": "minimal",
    "summary": "auto"
  },
  "tools": [
    {}
  ],
  "tool_choice": "<string>",
  "store": true,
  "user": "<string>"
}
'
{
  "id": "resp_0ed94fe7ec73cf560169afd97bba648194b8661d445cfa4244",
  "object": "response",
  "created_at": 1773132155,
  "model": "gpt-5.4",
  "status": "completed",
  "output": [
    {
      "id": "msg_0ed94fe7ec73cf56",
      "type": "message",
      "role": "assistant",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "text": "你好!有什么可以帮您的?",
          "annotations": [
            {}
          ]
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 8,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 15,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 23
  },
  "completed_at": 1773132156,
  "reasoning": {
    "effort": "high",
    "summary": "detailed"
  },
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "medium"
  }
}

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
model
enum<string>
必填

模型 ID

可用选项:
gpt-5.4
示例:

"gpt-5.4"

input
object[]
必填

模型的文本或图像输入,用于生成响应。

Minimum array length: 1
示例:
[{ "role": "user", "content": "你好!" }]
stream
boolean
默认值:false

开启后通过 SSE 流式返回结果。

temperature
number
默认值:1

采样温度,值越高输出越随机。

必填范围: 0 <= x <= 2
示例:

1

top_p
number

核采样阈值。

必填范围: 0 <= x <= 1
frequency_penalty
number
默认值:0

基于频率惩罚重复 Token。

必填范围: -2 <= x <= 2
presence_penalty
number
默认值:0

惩罚已出现过的 Token。

必填范围: -2 <= x <= 2
max_output_tokens
integer

最大输出 Token 数。

必填范围: x >= 1
stop
string

触发停止生成的字符序列。

n
integer
默认值:1

生成多少个响应选项。

必填范围: x >= 1
text
object

模型文本响应的配置选项。

reasoning
object

模型推理/思考配置。

tools
object[]

模型可调用的工具列表。

tool_choice
string

控制模型调用哪个工具。

store
boolean
默认值:true

是否存储生成的模型响应以供后续通过 API 检索。

user
string

代表终端用户的唯一标识符。

响应

响应生成成功

id
string
必填
示例:

"resp_0ed94fe7ec73cf560169afd97bba648194b8661d445cfa4244"

object
string
必填
示例:

"response"

created_at
integer
必填

响应创建的 Unix 时间戳。

示例:

1773132155

model
string
必填
示例:

"gpt-5.4"

status
enum<string>
必填
可用选项:
completed,
failed,
in_progress,
incomplete
示例:

"completed"

output
object[]
必填
usage
object
必填
completed_at
integer

响应完成的 Unix 时间戳。

示例:

1773132156

reasoning
object
text
object