跳转到主要内容
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": "qwen3.6-flash",
  "messages": [
    {
      "content": "<string>"
    }
  ],
  "max_completion_tokens": 65536,
  "temperature": 1,
  "top_p": 0.5,
  "frequency_penalty": 0,
  "presence_penalty": 0,
  "stream": false,
  "enable_thinking": false,
  "stop": [
    "<string>"
  ]
}
'
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 123,
  "model": "qwen3.6-flash",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "assistant",
        "content": "你好!有什么可以帮你的?",
        "reasoning_content": "<string>"
      }
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123,
    "prompt_tokens_details": {
      "cached_tokens": 123,
      "text_tokens": 123,
      "image_tokens": 123,
      "video_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

可用选项:
qwen3.6-flash
示例:

"qwen3.6-flash"

messages
object[]
必填

对话消息数组。content 可以是字符串或内容部件数组,用于多模态输入。

Minimum array length: 1
示例:
{
"text-only": [{ "role": "user", "content": "你好!" }]
}
{
"image-input": [
{
"role": "user",
"content": [
{ "type": "text", "text": "请描述这张图片。" },
{
"type": "image_url",
"image_url": { "url": "https://example.com/photo.jpg" }
}
]
}
]
}
{
"video-input": [
{
"role": "user",
"content": [
{ "type": "text", "text": "请总结这个视频的内容。" },
{
"type": "video_url",
"video_url": { "url": "https://example.com/sample.mp4" }
}
]
}
]
}
max_completion_tokens
integer
默认值:65536

最大生成 Token 数。

必填范围: 1 <= x <= 65536
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
stream
boolean
默认值:false

开启后通过 SSE 流式传输部分消息增量。

enable_thinking
boolean
默认值:false

启用推理能力。开启后会在 content 的同时返回 reasoning_content。

stop
string[]

触发停止生成 further tokens 的序列。必须为数组格式,如 [".", "?"]。

响应

补全生成成功

id
string
必填
示例:

"chatcmpl-abc123"

object
string
必填
示例:

"chat.completion"

created
integer
必填

Unix 时间戳

model
string
必填
示例:

"qwen3.6-flash"

choices
object[]
必填
usage
object