获取 Agent

更新时间:
复制为 MD 格式

获取指定 Agent 的详细信息。

请求头

头部

必选

说明

Authorization

Bearer <PAT>

路径参数

参数

类型

必选

说明

agent_id

string

Agent 唯一标识,格式为 "agent_" 前缀加 UUID

示例请求

curl -X GET "https://api.qoder.com.cn/api/v1/cloud/agents/agent_019eXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "Authorization: Bearer $QODER_PAT"

示例响应

HTTP 200 OK

{
  "type": "agent",
  "id": "agent_019eXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "name": "doc-test-agent",
  "description": "",
  "model": "ultimate",
  "system": "你是文档测试助手",
  "instructions": "你是文档测试助手",
  "tools": [],
  "mcp_servers": [],
  "default_environment": "",
  "version": 1,
  "archived": false,
  "archived_at": null,
  "created_at": "2026-05-18T15:26:39.61669Z",
  "updated_at": "2026-05-18T15:26:39.61669Z"
}

响应字段

字段

类型

说明

type

string

固定值 "agent"

id

string

Agent 唯一标识

name

string

Agent 名称

description

string

Agent 描述

model

string

模型标识

instructions

string

系统提示词

system

string

instructions 的别名(已弃用,建议使用 instructions

tools

array

工具配置列表

mcp_servers

array

MCP 服务器配置

default_environment

string

默认运行环境

version

integer

当前版本号

archived

boolean

是否已归档

archived_at

string|null

归档时间(ISO 8601),未归档时为 null

created_at

string

创建时间(ISO 8601)

updated_at

string

最后更新时间(ISO 8601)

错误码

HTTP

type

触发条件

401

authentication_error

PAT 无效或过期

403

permission_error

无权限访问此 Agent

404

not_found_error

指定 ID 的 Agent 不存在

错误响应示例:

{
  "type": "error",
  "error": {
    "type": "not_found_error",
    "message": "Agent 'agent_nonexistent' was not found."
  }
}