Appearance
1. 快速开始
1.1 接口地址
POST https://{host}/v1/experience/run1.2 认证方式
每个请求须在请求头中携带有效的 API Key:
| 请求头 | 必填 | 说明 |
|---|---|---|
X-Api-Key: <api_key> | 是 | API Key,在控制台 → API Keys 页面创建。 |
Authorization: Bearer <user_token> | 视账号要求 | 用户认证 Token;部分账号或场景需同时提供,请参阅你的账号接入说明。 |
在控制台 API Keys 页面获取或创建 API Key。
1.3 cURL 示例
bash
curl --request POST \
--url 'https://{host}/v1/experience/run' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api_key>' \
--header 'Authorization: Bearer <user_token>' \
--data '{
"model": "qwen3.6-plus",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "你好"}
],
"stream": false
}'1.4 成功响应示例
json
{
"id": "chatcmpl-e30f5ae7-3063-93c4-90fe-beb5f900bd57",
"object": "chat.completion",
"created": 1749600000,
"model": "qwen3.6-plus",
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "你好!很高兴见到你,有什么我可以帮助你的吗?"
}
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 20,
"total_tokens": 32,
"prompt_tokens_details": {
"cached_tokens": 0
}
}
}1.5 流式调用示例
bash
curl --request POST \
--url 'https://{host}/v1/experience/run' \
--header 'Content-Type: application/json' \
--header 'Accept: text/event-stream' \
--header 'X-Api-Key: <api_key>' \
--header 'Authorization: Bearer <user_token>' \
--data '{
"model": "qwen3.6-plus",
"messages": [
{"role": "user", "content": "请用三句话介绍你自己"}
],
"stream": true
}'