AI Agent
鉴权
签名方式:每个请求用 App Key / Secret 签名。请求头如下:
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
Authorization | string · header | 必填 | OpenAPI 后台 上的账户 Access Token,作为原始 token 传入(不带 Bearer 前缀),并参与签名计算。 |
X-Api-Key | string · header | 必填 | 你的 App Key。 |
X-Timestamp | string · header | 必填 | 请求时间戳,单位秒(Unix 时间)。 |
X-Api-Signature | string · header | 必填 | HMAC-SHA256 签名。格式:HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=。 |
获取指定 Workspace 下的 Agent 列表。返回的 uid 即 发起对话 接口路径中的 Agent 标识;只有 is_published 为 true 的 Agent 才能发起对话。
请求
路径参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
workspace_id | string | 必填 | 工作区 ID |
查询参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
page | integer | 可选 | 页码,从 1 开始,默认 1 |
limit | integer | 可选 | 每页数量,默认 20 |
响应
响应字段
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
agents | object[] | 必填 | Agent 列表 |
└ uid | string | 必填 | Agent UID,用于 [发起对话](/zh-CN/docs/ai/chat/conversation) 的路径参数 |
└ name | string | 必填 | Agent 名称 |
└ description | string | 可选 | Agent 描述 |
└ mode | string | 必填 | Agent 模式,如 `chat` |
└ icon | string | 可选 | 图标 URL |
└ is_published | boolean | 必填 | 是否已发布,仅已发布的 Agent 可发起对话 |
└ published_at | int64 | 可选 | 发布时间,Unix 时间戳(秒),未发布为 0 |
└ created_at | int64 | 可选 | 创建时间,Unix 时间戳(秒) |
└ updated_at | int64 | 可选 | 最后更新时间,Unix 时间戳(秒) |
total | int32 | 必填 | 符合条件的 Agent 总数 |
响应 JSON 示例
{
"code": 0,
"message": "success",
"data": {
"agents": [
{
"uid": "ag_7d3f9b2c",
"name": "US Stock Analyst",
"description": "Answers US stock questions with market and fundamental data",
"mode": "chat",
"icon": "https://cdn.longbridge.com/icons/agent.png",
"is_published": true,
"published_at": 1742000000,
"created_at": 1741000000,
"updated_at": 1742001000
}
],
"total": 12
}
}错误码
参见错误码文档。