Skip to main content
Dreams

列出 Dreams

分页查询当前账号创建的 Dream 历史。

GET /api/v1/forward/dreams 结果按创建时间倒序排列。默认不返回已归档的 Dream。

请求头

Header是否必填说明
Authorization是Bearer <PAT 或管理员 SAT>。

查询参数

参数类型是否必填默认值说明
limitinteger否20每页数量,取值范围 1-100。
after_idstring否—当前页最后一条 Dream 的 ID,用于继续读取更早的记录。
before_idstring否—当前页第一条 Dream 的 ID,用于返回上一页较新的记录。
include_archivedboolean否false是否包含已归档的 Dream,只接受 true 或 false。
before_id 和 after_id 不能同时使用。查询参数不能重复,也不接受未定义的参数。

示例请求

curl -s 'https://api.qoder.com/api/v1/forward/dreams?limit=20&include_archived=true' \
  -H "Authorization: Bearer $QODER_PAT"

示例响应

HTTP 200 OK
{
  "data": [
    {
      "id": "drm_019e86b4a8f070a3b6c5d4e3f2a1b0c9",
      "type": "dream",
      "status": "completed",
      "inputs": [{
        "type": "identity_template",
        "identity_id": "idn_019eabc123",
        "template_id": "tmpl_support"
      }],
      "outputs": [{
        "type": "memory_store",
        "memory_store_id": "memstore_019e86b4b10578059435632bb357c5ed",
        "files_touched": ["preferences.md"]
      }],
      "model": { "id": "auto" },
      "instructions": "重点整理用户确认过的长期偏好",
      "usage": {
        "input_tokens": 12500,
        "output_tokens": 3200,
        "cache_creation_input_tokens": 0,
        "cache_read_input_tokens": 8000
      },
      "error": null,
      "created_at": "2026-09-15T03:00:00Z",
      "ended_at": "2026-09-15T03:03:42Z",
      "archived_at": null
    }
  ],
  "first_id": "drm_019e86b4a8f070a3b6c5d4e3f2a1b0c9",
  "last_id": "drm_019e86b4a8f070a3b6c5d4e3f2a1b0c9",
  "has_more": false
}

空列表响应

{
  "data": [],
  "first_id": null,
  "last_id": null,
  "has_more": false
}

响应字段

字段类型说明
dataobject[]当前页的 Dream 对象。
first_idstring/null当前页第一条 Dream 的 ID;空列表时为 null。
last_idstring/null当前页最后一条 Dream 的 ID;空列表时为 null。
has_moreboolean当前分页方向上是否还有更多记录。

错误

HTTPType触发条件
400invalid_request_error分页参数、布尔参数或查询参数不合法;error.code 为 invalid_pagination。
401authentication_error认证信息缺失、无效或已过期。
403permission_error当前令牌不能查询 Dream;Identity SAT 不支持此接口。
404not_found_errorbefore_id 或 after_id 指向的 Dream 不存在或当前调用方不可见;error.code 为 dream_not_found。
500/502/503api_error服务或内部依赖暂时不可用。

相关