跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.qoder.com/llms.txt

Use this file to discover all available pages before exploring further.

GET /v1/agents 获取当前账户下所有 Agent 的列表,支持分页和排序。

请求头

头部必选说明
AuthorizationBearer <PAT>

查询参数

参数类型必选默认值说明
limitinteger20每页返回数量,范围 1-100
orderstringdesc排序方向,可选 "asc""desc"
after_idstring-游标分页,返回此 ID 之后的记录
before_idstring-游标分页,返回此 ID 之前的记录
完整分页规范详见 分页

示例请求

curl -X GET "https://openapi.qoder.sh/api/v1/cloud/agents?limit=2&order=desc" \
  -H "Authorization: Bearer $QODER_PAT"

示例响应

HTTP 200 OK
{
  "data": [
    {
      "type": "agent",
      "id": "agent_019eXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "name": "doc-test-agent",
      "description": "",
      "model": "ultimate",
      "system": "你是文档测试助手",
      "instructions": "你是文档测试助手",
      "tools": [],
      "mcp_servers": [],
      "default_environment": "",
      "version": 1,
      "created_at": "2026-05-18T15:26:39.61669Z",
      "updated_at": "2026-05-18T15:26:39.61669Z"
    },
    {
      "type": "agent",
      "id": "agent_019eYYYYYYYYYYYYYYYYYYYYYYYYYYYY",
      "name": "test-agent-e2e",
      "description": "E2E 测试用 Agent",
      "model": "ultimate",
      "system": "你是一个测试助手",
      "instructions": "你是一个测试助手",
      "tools": [],
      "mcp_servers": [],
      "default_environment": "",
      "version": 2,
      "created_at": "2026-05-18T03:04:33.952256Z",
      "updated_at": "2026-05-18T03:05:28.023697Z"
    }
  ],
  "first_id": "agent_019eXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "last_id": "agent_019eYYYYYYYYYYYYYYYYYYYYYYYYYYYY",
  "has_more": true
}

响应字段

字段类型说明
dataarrayAgent 对象数组
first_idstring当前页第一条记录的 ID
last_idstring当前页最后一条记录的 ID
has_moreboolean是否还有更多数据

分页用法

向后翻页(获取下一页):
curl "https://openapi.qoder.sh/api/v1/cloud/agents?limit=20&after_id=agent_019eYYYY..." \
  -H "Authorization: Bearer $QODER_PAT"
向前翻页(获取上一页):
curl "https://openapi.qoder.sh/api/v1/cloud/agents?limit=20&before_id=agent_019eXXXX..." \
  -H "Authorization: Bearer $QODER_PAT"

错误码

HTTPtype触发条件
400invalid_request_errorlimit 超出范围或参数格式错误
401authentication_errorPAT 无效或过期
403permission_error无权限执行此操作

注意事项

  • 默认按创建时间降序排列(最新的在前)
  • 已归档的 Agent 不会出现在默认列表中
  • 使用游标分页(cursor-based pagination),不支持 offset 方式