请求
GET https://oneapi.zeotrue.com/v1/models 使用匹配网关的 Bearer 密钥。查询单个模型使用 GET /v1/models/{model},路径中的模型 ID 需要 URL 编码。
先设置环境变量
将 ZEO_NEXUS_API_KEY 设置为对应网关的密钥,将示例中的 YOUR_MODEL_ID 替换为平台模型 ID。Python 先安装 requests;Node.js 使用 18 或更高版本。这里的 JavaScript 在服务端运行。
cURL · Bash / Zsh
curl --fail-with-body --show-error 'https://oneapi.zeotrue.com/v1/models' \
-H "Authorization: Bearer $ZEO_NEXUS_API_KEY"Python · requests
import os
import requests
url = 'https://oneapi.zeotrue.com/v1/models'
headers = {'Authorization': "Bearer " + os.environ["ZEO_NEXUS_API_KEY"]}
response = requests.get(url, headers=headers, timeout=(10, 120))
response.raise_for_status()
print(response.json())Node.js · fetch
// Node.js 18+
if (!process.env.ZEO_NEXUS_API_KEY) throw new Error('请设置 ZEO_NEXUS_API_KEY');
const response = await fetch("https://oneapi.zeotrue.com/v1/models", {
method: "GET",
headers: {
"Authorization": `Bearer ${process.env.ZEO_NEXUS_API_KEY}`
},
signal: AbortSignal.timeout(120000),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
console.log(await response.json());返回结构
{"object":"list","data":[{"id":"YOUR_MODEL_ID","object":"model","owned_by":"ZeoNexus"}]}读取 data[].id 作为请求模型 ID。其他元数据以实际返回为准,不从供应商展示名推测别名。
列表与调用条件
网关按密钥范围、有效授权和发布路由筛选模型;实际生成仍检查余额、限额、并发、接口类型及上游状态。列表为空时检查服务类型、模型授权和同步状态;能看到模型但调用失败时保存错误代码和请求 ID。
工具中的模型发现
部分客户端过滤模型名或要求额外的模型能力元数据。自动发现失败时手工添加精确模型 ID。Codex 所需的模型目录包含能力与指令信息,普通模型 ID 列表不能替代它。