跳转到主要内容
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.6-terra",
  "input": [
    {
      "role": "user",
      "content": "你好!"
    }
  ],
  "stream": false,
  "temperature": 1,
  "frequency_penalty": 0,
  "presence_penalty": 0,
  "max_output_tokens": 17,
  "stop": "<string>",
  "n": 1,
  "text": {
    "format": {}
  },
  "reasoning": {
    "mode": "pro"
  },
  "tools": [
    {}
  ],
  "prompt_cache_options": {},
  "tool_choice": "<string>",
  "store": true,
  "safety_identifier": "<string>",
  "user": "<string>"
}
'
import requests

url = "https://www.anyfast.ai/v1/responses"

payload = {
"model": "gpt-5.6-terra",
"input": [
{
"role": "user",
"content": "你好!"
}
],
"stream": False,
"temperature": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"max_output_tokens": 17,
"stop": "<string>",
"n": 1,
"text": { "format": {} },
"reasoning": { "mode": "pro" },
"tools": [{}],
"prompt_cache_options": {},
"tool_choice": "<string>",
"store": True,
"safety_identifier": "<string>",
"user": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-5.6-terra',
input: [{role: 'user', content: '你好!'}],
stream: false,
temperature: 1,
frequency_penalty: 0,
presence_penalty: 0,
max_output_tokens: 17,
stop: '<string>',
n: 1,
text: {format: {}},
reasoning: {mode: 'pro'},
tools: [{}],
prompt_cache_options: {},
tool_choice: '<string>',
store: true,
safety_identifier: '<string>',
user: '<string>'
})
};

fetch('https://www.anyfast.ai/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://www.anyfast.ai/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'gpt-5.6-terra',
'input' => [
[
'role' => 'user',
'content' => '你好!'
]
],
'stream' => false,
'temperature' => 1,
'frequency_penalty' => 0,
'presence_penalty' => 0,
'max_output_tokens' => 17,
'stop' => '<string>',
'n' => 1,
'text' => [
'format' => [

]
],
'reasoning' => [
'mode' => 'pro'
],
'tools' => [
[

]
],
'prompt_cache_options' => [

],
'tool_choice' => '<string>',
'store' => true,
'safety_identifier' => '<string>',
'user' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://www.anyfast.ai/v1/responses"

payload := strings.NewReader("{\n \"model\": \"gpt-5.6-terra\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": \"你好!\"\n }\n ],\n \"stream\": false,\n \"temperature\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"max_output_tokens\": 17,\n \"stop\": \"<string>\",\n \"n\": 1,\n \"text\": {\n \"format\": {}\n },\n \"reasoning\": {\n \"mode\": \"pro\"\n },\n \"tools\": [\n {}\n ],\n \"prompt_cache_options\": {},\n \"tool_choice\": \"<string>\",\n \"store\": true,\n \"safety_identifier\": \"<string>\",\n \"user\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://www.anyfast.ai/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-5.6-terra\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": \"你好!\"\n }\n ],\n \"stream\": false,\n \"temperature\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"max_output_tokens\": 17,\n \"stop\": \"<string>\",\n \"n\": 1,\n \"text\": {\n \"format\": {}\n },\n \"reasoning\": {\n \"mode\": \"pro\"\n },\n \"tools\": [\n {}\n ],\n \"prompt_cache_options\": {},\n \"tool_choice\": \"<string>\",\n \"store\": true,\n \"safety_identifier\": \"<string>\",\n \"user\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://www.anyfast.ai/v1/responses")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gpt-5.6-terra\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": \"你好!\"\n }\n ],\n \"stream\": false,\n \"temperature\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"max_output_tokens\": 17,\n \"stop\": \"<string>\",\n \"n\": 1,\n \"text\": {\n \"format\": {}\n },\n \"reasoning\": {\n \"mode\": \"pro\"\n },\n \"tools\": [\n {}\n ],\n \"prompt_cache_options\": {},\n \"tool_choice\": \"<string>\",\n \"store\": true,\n \"safety_identifier\": \"<string>\",\n \"user\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "resp_0ed94fe7ec73cf560169afd97bba648194b8661d445cfa4244",
  "object": "response",
  "created_at": 1773132155,
  "model": "gpt-5.6-terra",
  "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"
  }
}
{
"error": {
"code": "<string>",
"message": "<string>"
}
}
{
"error": {
"code": "<string>",
"message": "<string>"
}
}
{
"error": {
"code": "<string>",
"message": "<string>"
}
}

授权

Authorization
string
header
必填

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

请求体

application/json
model
enum<string>
必填

GPT-5.6 Terra 均衡模型 ID。

可用选项:
gpt-5.6-terra
示例:

"gpt-5.6-terra"

input
object[]
必填

供模型生成响应的文本或图像输入。

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

为 true 时通过 SSE 流式传输响应增量。

temperature
number
默认值:1

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

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

1

frequency_penalty
number
默认值:0

根据 Token 在文本中出现的频率对其进行惩罚。

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

对已在文本中出现过的 Token 进行惩罚。

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

最大输出 Token 数。

必填范围: x >= 16
stop
string

触发停止生成的序列。

n
integer
默认值:1

生成的响应候选数量。

必填范围: x >= 1
text
object

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

reasoning
object

模型推理/思考的配置。

tools
object[]

模型可调用的工具列表。

prompt_cache_options
object

在支持时配置显式提示缓存。

tool_choice
string

控制模型调用哪个(如果有)工具。

store
boolean
默认值:true

是否存储生成的响应以供后续通过 API 检索,默认为 true。

safety_identifier
string

稳定且保护隐私的终端用户标识,用于安全系统。

user
string

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

响应

响应生成成功

id
string
必填
示例:

"resp_0ed94fe7ec73cf560169afd97bba648194b8661d445cfa4244"

object
string
必填
示例:

"response"

created_at
integer
必填

响应创建时的 Unix 时间戳。

示例:

1773132155

model
string
必填
示例:

"gpt-5.6-terra"

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

"completed"

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

响应完成时的 Unix 时间戳。

示例:

1773132156

reasoning
object
text
object