跳转到主要内容
GET /api/v1/cloud/sessions 列出当前账号下的 Sessions。默认不包含已归档 Session。

请求头

头部必选说明
AuthorizationBearer $QODER_PAT

查询参数

参数类型必填说明
limitinteger最大返回数量。默认 20,范围 1-100。超过 100 返回 400 invalid_request_error
pagestring上一次响应 next_page 返回的不透明游标
orderstring排序方向:desc(默认)或 asc
include_archivedboolean是否包含已归档 Sessions
statusesstring 或 array按 Session 生命周期状态过滤。允许值:runningidlereschedulingterminated。归档 Session 通过 include_archived 单独过滤
agent_idstring按 Agent ID 过滤
agent_versioninteger按 Agent 版本过滤
deployment_idstring按 Deployment ID 过滤
memory_store_idstring筛选挂载了指定 Memory Store 的 Sessions
created_at[gt]string返回创建时间晚于该 RFC 3339 时间的 Sessions
created_at[gte]string返回创建时间不早于该 RFC 3339 时间的 Sessions
created_at[lt]string返回创建时间早于该 RFC 3339 时间的 Sessions
created_at[lte]string返回创建时间不晚于该 RFC 3339 时间的 Sessions

示例请求

curl -X GET "https://api.qoder.com/api/v1/cloud/sessions?limit=3&include_archived=true" \
  -H "Authorization: Bearer $QODER_PAT"

示例响应

HTTP 200 OK
{
  "data": [
    {
      "id": "sess_019e3bb1e8c171fd9abbb1477ffb84cc",
      "type": "session",
      "agent": {
        "id": "agent_019e390add9f7bac9b6cc806db46fcbd",
        "type": "agent",
        "version": 2,
        "name": "doc-verification-agent",
        "description": "",
        "model": {"id": "ultimate", "effective_context_window": 200000},
        "system": "You are an expert software engineer.",
        "tools": [{"enabled_tools": ["Bash", "Read", "Write", "Edit", "Glob", "Grep"], "type": "agent_toolset_20260401"}],
        "skills": [],
        "mcp_servers": []
      },
      "environment_id": "env_019e2590d33f711fabf42f2857cecd8a",
      "title": "API-doc-verification-session",
      "status": "idle",
      "metadata": {},
      "resources": [],
      "vault_ids": [],
      "deployment_id": null,
      "outcome_evaluations": [],
      "stats": {"active_seconds": 0, "duration_seconds": 0},
      "environment_variables": {},
      "archived_at": null,
      "created_at": "2026-05-18T15:26:15.747298Z",
      "updated_at": "2026-05-18T15:26:15.747298Z"
    }
  ],
  "first_id": "sess_019e3bb1e8c171fd9abbb1477ffb84cc",
  "has_more": false,
  "last_id": "sess_019e3bb1e8c171fd9abbb1477ffb84cc",
  "next_page": null
}

响应字段

字段类型说明
dataarraySession 对象 数组
has_moreboolean当前结果集之后还有更多页时为 true
first_idstring当前页第一个 Session 的 ID
last_idstring当前页最后一个 Session 的 ID
next_pagestring | null下一页的不透明游标,无更多结果时为 null

错误码

HTTP类型触发条件
400invalid_request_error分页或过滤参数无效
401authentication_errorPAT 无效或过期
HTTP 400 Bad Request
{
  "type": "error",
  "request_id": "cb80235f-76a2-4ff3-9e28-5aa2da12dc14",
  "error": {
    "type": "invalid_request_error",
    "message": "Field 'limit' must be a positive integer."
  }
}
完整错误信封格式见 错误参考

相关

启动 Session

让 Agent 在环境中以有状态对话的方式运行。