跳转到主要内容
POST
/
v1
/
chat
/
completions
curl --request POST \
  --url https://api.powertokens.ai/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "qwen3.6-plus",
  "messages": [
    {
      "role": "system",
      "content": "你是一个有帮助的助手。"
    },
    {
      "role": "user",
      "content": "你好,请介绍一下自己。"
    }
  ],
  "temperature": 0.7,
  "max_tokens": 2000
}
'
{
  "id": "<string>",
  "object": "chat.completion",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "system",
        "content": "<string>",
        "tool_calls": [
          {}
        ]
      },
      "finish_reason": "<string>"
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_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>
必填

模型名称。仅支持当前阿里渠道最终白名单中的公开对话模型。

可用选项:
qwen3-max,
qwen3.6-plus,
qwen3.5-flash,
qwen3-coder-plus,
deepseek-v3.2
示例:

"qwen3.6-plus"

messages
object[]
必填

对话消息列表。支持文本内容和多模态内容(图像+文本)。

stream
boolean
默认值:false

是否使用流式输出。默认为 false。

temperature
number
默认值:0.7

采样温度,控制输出随机性。取值范围 [0, 2]。

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

核采样概率阈值。

必填范围: 0 <= x <= 1
max_tokens
integer

生成的最大 token 数。

必填范围: x >= 1
stop
string[]

停止词列表。

seed
integer

随机数种子,用于复现生成结果。

tools
object[]

工具列表,用于 Function Calling。

tool_choice
string

工具选择策略。可选值:auto、none、required。

是否启用搜索增强功能。仅部分模型支持。

response_format
object

响应格式,用于强制模型输出 JSON。

响应

调用成功,返回对话补全结果。流式模式下返回 SSE 流。

id
string

响应唯一标识。

object
string
示例:

"chat.completion"

created
integer<int64>

创建时间的 Unix 时间戳(秒)。

model
string

使用的模型名称。

choices
object[]
usage
object