跳转到主要内容
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-1-6-251015",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "image_url",
          "image_url": {
            "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/ark_demo_img_1.png"
          }
        },
        {
          "type": "text",
          "text": "图片里有什么?"
        }
      ]
    }
  ],
  "max_tokens": 1024,
  "temperature": 1,
  "top_p": 0.5,
  "stream": false,
  "stop": [
    "<string>"
  ]
}
'
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1774236644,
  "model": "doubao-seed-1-6-251015",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "assistant",
        "content": "图片里有3个模型:Doubao-Seed-1.8、DeepSeek-V3.2、GLM-4.7。",
        "reasoning_content": "<string>"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 1355,
    "completion_tokens": 87,
    "total_tokens": 1442,
    "completion_tokens_details": {
      "reasoning_tokens": 53
    }
  }
}

授权

Authorization
string
header
必填

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

请求体

application/json
model
enum<string>
必填

使用的模型。

可用选项:
doubao-seed-2.0-pro,
doubao-seed-2.0-code,
doubao-seed-2.0-lite,
doubao-seed-2.0-mini,
doubao-seed-1-8-251228,
doubao-seed-1-6-flash-250828,
doubao-seed-1-6-251015,
doubao-seed-1-6-lite-251015,
doubao-seed-1-6-vision-250815,
glm-4-7-251222
示例:

"doubao-seed-1-6-251015"

messages
object[]
必填

对话消息列表,每条包含 rolecontent

content 数组项类型:

  • text{"type": "text", "text": "..."}
  • image_url{"type": "image_url", "image_url": {"url": "https://..."}}
  • video_url{"type": "video_url", "video_url": {"url": "https://...", "fps": 2}}
Minimum array length: 1
示例:
[
  {
    "role": "user",
    "content": [
      {
        "type": "image_url",
        "image_url": {
          "url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/ark_demo_img_1.png"
        }
      },
      { "type": "text", "text": "图片里有什么?" }
    ]
  }
]
max_tokens
integer

生成的最大 token 数。

必填范围: x >= 1
示例:

1024

temperature
number
默认值:1

采样温度。

必填范围: 0 <= x <= 2
top_p
number

核采样参数。

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

是否通过 SSE 流式返回。

stop
string[]

最多 4 个停止序列。

响应

对话补全创建成功

id
string
示例:

"chatcmpl-abc123"

object
string
示例:

"chat.completion"

created
integer
示例:

1774236644

model
string
示例:

"doubao-seed-1-6-251015"

choices
object[]
usage
object