跳转到主要内容
Adventure

HappyOyster-Adventure-查询Travel列表 API参考

分页查询当前千问AI平台账号名下的 Adventure Travel,可按状态或关联 World 筛选。

GET
/api/v2/apps/happyoyster-1.0-adventure/openapi/v1/travels
cURL - 查询Travel列表
curl --location 'https://maas.qianwenaiapi.com/api/v2/apps/happyoyster-1.0-adventure/openapi/v1/travels?page=1&pageSize=20&status=completed&encryptedWorldId={encryptedWorldId}' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"
{
  "code": 0,
  "message": null,
  "data": {
    "items": [
      {
        "encryptedTravelId": "trvl_a1b2****",
        "status": "completed",
        "mode": 1,
        "encryptedWorldId": "enc_a1b2****",
        "durationSec": 90,
        "createdAt": "2026-06-03T10:00:00Z",
        "endedAt": "2026-06-03T10:01:30Z"
      },
      {
        "encryptedTravelId": "trvl_g7h8****",
        "status": "running",
        "mode": 1,
        "encryptedWorldId": "enc_a1b2****",
        "durationSec": null,
        "createdAt": "2026-06-03T11:00:00Z",
        "endedAt": null
      }
    ],
    "pagination": {
      "page": 1,
      "pageSize": 20,
      "total": 2,
      "hasMore": false
    }
  }
}

适用范围

分页查询当前千问AI平台账号名下的 Adventure Travel,可按状态或关联 World 筛选。调用前请确认:
  • 仅支持主 API Key调用,临时 API Key 不可用(错误码 403003)。
  • 接口自动只返回 Adventure Travel,items[].mode 恒为 1。
  • 空结果不是错误,返回 items=[] 和对应分页信息。
调用失败时,请参见HappyOyster 错误码。

鉴权

string
header
必填

千问AI平台 API Key。仅支持主 API Key(sk- 开头)。详见获取 API Key。

Header 参数

string
必填

API Key 鉴权。仅支持主 API Key,以 sk- 开头,如 sk-xxx。通常配置为环境变量 $DASHSCOPE_API_KEY。临时 API Key(st- 开头)调用返回 403003。

查询参数

integer
默认值1

页码,默认 1。page <= 0 时按 1 处理。

integer
默认值20

每页条数,默认 20。pageSize <= 0 时按 20,大于 100 时按 100 处理。

enum<string>

按 Travel 状态筛选。未知值不筛选。可选值:init(正在初始化会话资源)、pending(排队或等待服务资源)、running(正在运行)、failed(Travel 失败)、completed(Travel 已结束,可查询产物)。

init,pending,running,failed,completed
string

当前千问AI平台账号名下的 Adventure World ID。传入时仅返回该 World 的 Travel。本接口不支持 mode Query 参数,模型专属入口会自动限定为 Adventure。

响应

200-application/json
integer

返回码。0 表示成功,非 0 为错误码。

string

错误信息。成功时为 null。

object

响应数据。失败时为 null。