获取 AI 聚合平台模型列表
返回平台公开的对话模型目录,响应采用 OpenAI 风格的 { "object": "list", "data": [...] } 结构。该目录用于模型选择和能力发现,不代表当前账户一定已经申请了对应服务。图像、音频、视频等类型的完整目录使用 GET /api/v1/models/catalog/。
¶ 接口概览
| 项 | 内容 |
|---|---|
| 方法 | GET |
| URL | https://yxai-tech.platform.acedata.cloud/api/v1/models/ |
| 鉴权 | 公开,无需账户令牌 |
| 分页 | 不分页,全部匹配项位于 data |
¶ 查询参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
owned_by |
string | 否 | 按目录中的模型提供方标识精确筛选 |
type |
string | 否 | 按模型类型精确筛选,例如 chat |
capability |
string | 否 | 仅返回 capabilities 包含该能力的模型,例如 vision |
with_pricing |
boolean | 否 | 1、true 或 yes 时附加公开价格信息 |
service_id、tag、limit、offset 和 ordering 当前不受支持;传入后不会产生相应筛选或分页效果。
¶ 请求示例
# 全部公开模型
curl 'https://yxai-tech.platform.acedata.cloud/api/v1/models/' \
-H 'Accept: application/json'
# 支持视觉的 chat 模型,并附价格
curl --get 'https://yxai-tech.platform.acedata.cloud/api/v1/models/' \
--data-urlencode 'type=chat' \
--data-urlencode 'capability=vision' \
--data-urlencode 'with_pricing=true' \
-H 'Accept: application/json'
import requests
response = requests.get(
"https://yxai-tech.platform.acedata.cloud/api/v1/models/",
params={"type": "chat", "capability": "vision", "with_pricing": "true"},
timeout=10,
)
response.raise_for_status()
payload = response.json()
for model in payload["data"]:
print(model["id"], model["capabilities"], model.get("pricing"))
¶ 真实响应结构
{
"object": "list",
"data": [
{
"id": "example-model",
"label": "Example Model",
"owned_by": "example",
"service_prefix": "acedatacloud-example",
"group_label": "Example",
"type": "chat",
"capabilities": ["vision"],
"object": "model",
"endpoints": [
{
"api_id": "example-api-id",
"path": "/v1/chat/completions",
"protocol": "chat_completions",
"base_url": "https://api.yxai-tech.top/v1",
"auth": "bearer",
"unit": "1M tokens",
"pricing": {
"kind": "tokens",
"input_credits": 10,
"output_credits": 20,
"source": {"kind": "api", "id": "example-api-id"}
}
}
],
"pricing": {
"currency": "USD",
"kind": "tokens",
"unit": "1M_tokens",
"input_usd": 1,
"output_usd": 2,
"basis": "lowest_public_package_rate",
"source": {"kind": "service", "id": "example-service-id"},
"credit_usd_rate": 0.1
},
"rates": [{"id": "example-package", "amount": 100, "price": 10, "rate": 0.1}]
}
],
"credit_usd_rate": 0.1
}
示例中的模型、套餐和价格仅说明结构。顶层模型 pricing、rates 和响应的 credit_usd_rate 仅在 with_pricing=true 时出现。模型清单来自已发布的 API 绑定和请求模型枚举,客户端应忽略新增字段。
endpoints 在两种目录中始终返回。客户端应按每个模型的 protocol 选择接口:chat_completions、responses 或 messages,不能仅凭 type=chat 假设支持 Chat Completions。base_url 是对应 SDK 的基础地址;Messages 使用站点根地址,其余两个协议使用 /v1。所有这些接口使用 Authorization: Bearer <token>;使用 Anthropic SDK 时应配置 auth_token,而非仅发送 x-api-key。
每个 endpoint 的 pricing 来自该 API 的计费规则,金额单位为 Credits;pricing=null 表示无法投影价格,不等于免费。乘以所选 rates[].rate 可换算美元。按请求计价的模型保留 kind=unit,不能转换成 token 单价。token 价格为普通上下文的基准投影,缓存、长上下文等条件仍以 API 规则为准。
模型顶层 pricing 是目录展示价格,按最低公开套餐汇率换算;official_* 如出现则是参考价格,不是 AI 聚合的售价。未声明的上下文上限或能力应保留未知,不应从同名厂商模型推断。
价格字段是目录展示数据。实际业务调用仍以对应 API/Service 的计费规则和最终用量记录为准。

