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 的列表,支持分页和排序。
请求头
| 头部 | 必选 | 说明 |
|---|
Authorization | 是 | Bearer <PAT> |
查询参数
| 参数 | 类型 | 必选 | 默认值 | 说明 |
|---|
limit | integer | 否 | 20 | 每页返回数量,范围 1-100 |
order | string | 否 | desc | 排序方向,可选 "asc" 或 "desc" |
after_id | string | 否 | - | 游标分页,返回此 ID 之后的记录 |
before_id | string | 否 | - | 游标分页,返回此 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
}
响应字段
| 字段 | 类型 | 说明 |
|---|
data | array | Agent 对象数组 |
first_id | string | 当前页第一条记录的 ID |
last_id | string | 当前页最后一条记录的 ID |
has_more | boolean | 是否还有更多数据 |
分页用法
向后翻页(获取下一页):
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"
错误码
| HTTP | type | 触发条件 |
|---|
| 400 | invalid_request_error | limit 超出范围或参数格式错误 |
| 401 | authentication_error | PAT 无效或过期 |
| 403 | permission_error | 无权限执行此操作 |
注意事项
- 默认按创建时间降序排列(最新的在前)
- 已归档的 Agent 不会出现在默认列表中
- 使用游标分页(cursor-based pagination),不支持 offset 方式