跳转到主要内容
POST
/
v1
/
chat
/
completions
对话补全
curl --request POST \
  --url https://www.anyfast.ai/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "doubao-seed-evolving",
  "messages": [
    {
      "role": "user",
      "content": "你好!"
    }
  ],
  "thinking": {
    "type": "enabled"
  },
  "reasoning_effort": "high",
  "max_tokens": 65536,
  "temperature": 1,
  "top_p": 1,
  "stream": false,
  "tools": [
    {}
  ],
  "response_format": {
    "type": "text"
  },
  "stop": "<string>"
}
'
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 123,
  "model": "doubao-seed-evolving",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "assistant",
        "content": "你好!有什么我可以帮助你的吗?",
        "reasoning_content": "<string>"
      }
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "prompt_tokens_details": {
      "cached_tokens": 123
    },
    "total_tokens": 123
  }
}

授权

Authorization
string
header
必填

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

请求体

application/json
model
enum<string>
必填

模型 ID

可用选项:
doubao-seed-evolving
示例:

"doubao-seed-evolving"

messages
object[]
必填

对话消息列表。

Minimum array length: 1
示例:
[{ "role": "user", "content": "你好!" }]
thinking
object

控制深度思考。Doubao-Seed-2.1 默认开启。

reasoning_effort
enum<string>
默认值:high

控制思考长度,仅在思考开启时生效。

可用选项:
minimal,
low,
medium,
high
max_tokens
integer
默认值:65536

最大生成 Token 数(最高 256K)。

必填范围: 1 <= x <= 262144
temperature
number
默认值:1

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

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

1

top_p
number
默认值:1

核采样阈值。

必填范围: 0 <= x <= 1
stream
boolean
默认值:false

为 true 时通过 SSE 流式返回结果。

tools
object[]

模型可调用的工具(函数)列表。

response_format
object

输出格式。使用 { "type": "json_object" } 输出结构化 JSON(beta)。

stop

触发停止生成的序列。

响应

成功生成响应

id
string
必填
示例:

"chatcmpl-abc123"

object
string
必填
示例:

"chat.completion"

created
integer
必填

Unix 时间戳

model
string
必填
示例:

"doubao-seed-evolving"

choices
object[]
必填
usage
object