| 用途 | 地址 |
|---|---|
| 模型调用与 OpenAI 兼容查询 | https://studio.dataeyes.ai |
| 密钥额度、用户信息及订阅查询 | https://www.dataeyes.ai/apex |
| 登录与完整密钥查询(3.2 节) | https://www.dataeyes.ai/api |
Authorization: Bearer sk-xxxxxxxxxxxxxxxxAuthorization: Bearer <系统访问令牌>
apex-api-user: <用户数字ID>Authorization: Bearer <登录令牌>apex-api-user。按 3.2 节的三个步骤获取登录令牌、查询密钥 ID,再获取完整密钥。https://studio.dataeyes.aiGET /v1/dashboard/billing/subscription| 名称 | 必填 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <API-Key> |
{
"object": "billing_subscription",
"has_payment_method": true,
"soft_limit_usd": 100000000,
"hard_limit_usd": 100000000,
"system_hard_limit_usd": 100000000,
"access_until": 0
}| 字段 | 类型 | 说明 |
|---|---|---|
object | String | 固定值 "billing_subscription" |
has_payment_method | Boolean | 兼容字段,返回 true |
soft_limit_usd | Number | 接口返回的软性额度上限,单位为美元 |
hard_limit_usd | Number | 接口返回的硬性额度上限,单位为美元 |
system_hard_limit_usd | Number | 系统级硬限额,与 hard_limit_usd 一致 |
access_until | Integer | 订阅到期时间(Unix 时间戳),0 表示永不过期 |
100000000。该值表示密钥额度不受限制,不代表账号余额为 1 亿美元。GET /v1/dashboard/billing/usage| 名称 | 必填 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <API-Key> |
start_date 和 end_date 参数不用于筛选结果。本接口返回累计用量,不按日期范围过滤。{
"object": "list",
"total_usage": 601.41
}| 字段 | 类型 | 说明 |
|---|---|---|
object | String | 固定值 "list" |
total_usage | Number | 累计消费金额,单位为美分。除以 100 可换算为美元:601.41 美分 = 6.01 |
GET /v1/models| 名称 | 必填 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <API-Key> |
{
"data": [
{
"id": "gpt-4o",
"object": "model",
"created": 1626777600,
"owned_by": "openai",
"supported_endpoint_types": ["openai"]
},
{
"id": "claude-opus-4-6",
"object": "model",
"created": 1626777600,
"owned_by": "vertex-ai",
"supported_endpoint_types": ["openai", "anthropic"]
},
{
"id": "gemini-2.5-pro-thinking",
"object": "model",
"created": 1626777600,
"owned_by": "custom",
"supported_endpoint_types": ["openai", "gemini"]
}
],
"object": "list",
"success": true
}| 字段 | 类型 | 说明 |
|---|---|---|
data | Array | 模型列表 |
data[].id | String | 模型标识符,调用时使用此值 |
data[].object | String | 固定值 "model" |
data[].created | Integer | 接口返回的创建时间,Unix 秒级时间戳 |
data[].owned_by | String | 接口返回的所有者或提供方标识,如 openai、vertex-ai、custom |
data[].supported_endpoint_types | Array | 支持的调用格式:openai、anthropic、gemini、image-generation、embeddings、rerank 等 |
object | String | 固定值 "list" |
success | Boolean | 请求是否成功 |
https://www.dataeyes.ai/apexGET /api/usage/token/| 名称 | 必填 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <API-Key> |
{
"code": true,
"message": "ok",
"data": {
"object": "token_usage",
"name": "my-production-key",
"total_granted": 5000000,
"total_used": 20,
"total_available": 4999980,
"unlimited_quota": false,
"model_limits": {},
"model_limits_enabled": false,
"expires_at": 0
}
}{
"code": true,
"message": "ok",
"data": {
"object": "token_usage",
"name": "default-key",
"total_granted": 500000,
"total_used": 3007043,
"total_available": -2507043,
"unlimited_quota": true,
"model_limits": {},
"model_limits_enabled": false,
"expires_at": 0
}
}| 字段 | 类型 | 说明 |
|---|---|---|
code | Boolean | 请求是否成功,true 表示成功 |
message | String | 状态描述,成功时为 "ok" |
data.object | String | 固定值 "token_usage" |
data.name | String | API Key 备注名称 |
data.total_granted | Integer | 总分配额度(内部单位)。换算公式:÷ 500,000 = 美元 |
data.total_used | Integer | 已消耗累计额度(内部单位) |
data.total_available | Integer | 剩余可用额度(total_granted − total_used) |
data.unlimited_quota | Boolean | 是否不限制密钥额度;不代表账号余额无限 |
data.model_limits | Object | 模型访问限制规则。空对象 {} 表示无限制 |
data.model_limits_enabled | Boolean | 是否启用模型级访问控制 |
data.expires_at | Integer | Key 过期时间(Unix 时间戳),0 表示永不过期 |
美元金额 = 内部额度值 ÷ 500,000| 内部额度值 | 对应美元 | 计算过程 |
|---|---|---|
5,000,000 | $10.00 | 5000000 ÷ 500000 = 10 |
3,007,043 | $6.01 | 3007043 ÷ 500000 ≈ 6.01 |
500,000 | $1.00 | 500000 ÷ 500000 = 1 |
unlimited_quota 为 true 时,total_available 可能为负值,表示累计消耗超过分配额度。不能仅凭该负值判断密钥额度已耗尽。GET /api/user/self| 名称 | 必填 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <系统访问令牌> |
apex-api-user | 是 | 与系统访问令牌对应的用户数字 ID |
{
"success": true,
"message": "",
"data": {
"id": 669,
"username": "example_user",
"display_name": "example_user",
"email": "user@example.com",
"role": 1,
"status": 1,
"group": "pro",
"quota": 4084864,
"used_quota": 269527941,
"request_count": 9412,
"aff_code": "xxxx",
"aff_count": 0,
"aff_quota": 0,
"aff_history_quota": 0,
"inviter_id": 0
}
}data 对象)| 字段 | 类型 | 说明 |
|---|---|---|
id | Integer | 用户数字 ID |
username | String | 登录用户名 |
display_name | String | 显示名称 |
email | String | 注册邮箱 |
role | Integer | 用户角色。1 = 普通用户,10 = 管理员,100 = 超级管理员 |
status | Integer | 账户状态。1 = 正常,2 = 已禁用 |
group | String | 用户所属计费分组 |
quota | Integer | 账户级剩余额度(内部单位,÷500000 = 美元) |
used_quota | Integer | 账户级已消耗总额度 |
request_count | Integer | API 累计请求次数 |
aff_code | String | 推荐码 |
aff_count | Integer | 已推荐用户数 |
aff_quota | Integer | 待发放推荐奖励额度 |
aff_history_quota | Integer | 历史累计推荐奖励总额 |
inviter_id | Integer | 邀请人用户 ID,0 表示无邀请人 |
| 步骤 | 请求 | 获取的字段 |
|---|---|---|
| 1. 登录 | POST /api/client/login | data.token:登录令牌 |
| 2. 查询密钥 ID | GET /api/apex/api/token/search | data.items[].id:密钥 ID |
| 3. 查询完整密钥 | POST /api/client/token/plain | data.key:完整 API 密钥 |
POST https://www.dataeyes.ai/api/client/login| 请求头 | 必填 | 说明 |
|---|---|---|
Content-Type | 是 | application/json |
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
account | String | 是 | 用于登录国际站的邮箱或手机号;手机号使用与登录页面一致的国家区号,不含空格 |
password | String | 是 | 当前账号的登录密码 |
{
"code": 0,
"data": {
"token": "<登录令牌>"
},
"msg": ""
}| 字段 | 类型 | 说明 |
|---|---|---|
code | Integer | 0 表示登录成功 |
data.token | String | 登录令牌,用于后续请求 |
msg | String | 响应提示 |
code 为 0 时,复制完整的 data.token,不包含两侧的双引号。其他账号信息无需复制。GET https://www.dataeyes.ai/api/apex/api/token/search| 请求头 | 必填 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <登录令牌>,使用第一步返回的 data.token |
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
keyword | String | 本示例必填 | 要查询的密钥完整名称 |
p | Integer | 否 | 页码,从 1 开始,本例传入 1 |
size | Integer | 否 | 每页条数,本例传入 20 |
<密钥名称> 替换为实际的密钥名称,例如 default。{
"success": true,
"message": "",
"data": {
"page": 1,
"page_size": 20,
"total": 1,
"items": [
{
"id": 12345,
"name": "default"
}
]
}
}| 字段 | 类型 | 说明 |
|---|---|---|
success | Boolean | true 表示查询成功 |
message | String | 响应提示 |
data.page | Integer | 当前页码 |
data.page_size | Integer | 每页条数 |
data.total | Integer | 符合条件的密钥总数 |
data.items[].id | Integer | 密钥 ID,第三步作为 token_id 提交 |
data.items[].name | String | 密钥名称 |
id 填入第三步的 token_id。例如,上面的 default 对应 12345;实际请求时请使用你查询到的 ID。p 翻页;data.items 为空表示本页没有记录。key 为脱敏值。完整密钥通过第三步获取。data.items[] 中的字段 | 类型 | 说明 |
|---|---|---|
user_id | Integer | 密钥所属用户的数字 ID |
key | String | 脱敏密钥,不能用于模型调用 |
status | Integer | 1 = 启用,2 = 禁用,3 = 已过期,4 = 额度已耗尽 |
created_time | Integer | 创建时间,Unix 秒级时间戳 |
accessed_time | Integer | 最后访问时间,Unix 秒级时间戳 |
expired_time | Integer | 过期时间,Unix 秒级时间戳;-1 表示永不过期 |
remain_quota | Integer | 密钥剩余额度,使用内部额度单位 |
unlimited_quota | Boolean | 是否不限制密钥额度 |
used_quota | Integer | 已消耗额度,使用内部额度单位 |
model_limits_enabled | Boolean | 是否启用密钥的模型限制 |
model_limits | String | 已配置的模型限制 |
allow_ips | String | 允许访问的 IP 地址;为空表示不限制该密钥的访问 IP |
group | String | 密钥配置的分组 |
cross_group_retry | Boolean | 是否启用跨分组重试 |
POST https://www.dataeyes.ai/api/client/token/plain| 请求头 | 必填 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <登录令牌>,使用第一步返回的 data.token |
Content-Type | 是 | application/json |
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
token_id | Integer | 是 | 第二步返回的密钥 id |
password | String | 是 | 当前账号的登录密码 |
12345 替换为第二步取得的 ID。本请求使用 POST,请求体使用 JSON。{
"code": 0,
"data": {
"key": "sk-<完整密钥内容>"
},
"msg": ""
}| 字段 | 类型 | 说明 |
|---|---|---|
code | Integer | 0 表示查询成功 |
data.key | String | 完整 API 密钥,已包含 sk- 前缀,可直接用于模型调用 |
msg | String | 响应提示,成功时为空字符串 |
data.key,不包含两侧的双引号,也不要再添加 sk- 前缀。模型调用的请求头填写如下:Authorization: Bearer <data.key 的完整值>GET /api/subscription/self| 名称 | 必填 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <系统访问令牌> |
apex-api-user | 是 | 与系统访问令牌对应的用户数字 ID |
{
"success": true,
"message": "",
"data": {
"subscriptions": [],
"all_subscriptions": [],
"billing_preference": "subscription_first"
}
}| 字段 | 类型 | 说明 |
|---|---|---|
data.subscriptions | Array | 当前生效的订阅计划 |
data.all_subscriptions | Array | 全部订阅计划(含已过期) |
data.billing_preference | String | 计费优先级。"subscription_first" = 优先使用订阅额度 |
| 用途 | 章节 | 鉴权方式 |
|---|---|---|
| 查询额度上限 | 1.1 | API Key |
| 查询累计消费金额 | 1.2 | API Key |
| 查询可用模型 | 1.3 | API Key |
| 查询单个密钥的额度与用量(内部单位) | 2.1 | API Key |
| 查询用户信息 | 3.1 | 系统访问令牌和用户数字 ID |
| 获取完整 API 密钥 | 3.2 | 账号密码登录;查询时使用登录令牌和密码 |
| 查询订阅信息 | 3.3 | 系统访问令牌和用户数字 ID |
| 请求 | 成功条件 |
|---|---|
| 登录 | code 为整数 0,且返回 data.token |
| 完整密钥查询 | code 为整数 0,且返回 data.key |
| 密钥额度与用量查询(2.1 节) | code 为布尔值 true |
| 用户信息、密钥搜索与列表、订阅查询 | success 为 true,并返回对应数据 |
| OpenAI 兼容查询 | HTTP 2xx,返回预期字段,且不包含 error 对象 |
msg、message 或 error.message 中的原因。| 场景 | 响应 | 处理方式 |
|---|---|---|
| 未提供 API Key | HTTP 401 | 添加 Authorization: Bearer <API-Key> 请求头 |
| 登录参数校验失败 | code 非 0,msg 返回原因 | 检查账号格式和当前登录密码 |
| 登录要求额外验证 | 登录响应提示需要额外验证 | 在网站完成验证,不要反复提交相同的 cURL 请求 |
| 登录令牌缺失或已失效 | code: 401,msg 返回原因 | 重新登录,用新的 data.token 更新请求头 |
| 系统访问令牌鉴权失败 | code: 401,msg 返回原因 | 检查系统访问令牌及其对应的用户数字 ID |
| 搜索无结果 | success: true,结果为空 | 检查密钥名称和页码,或使用第二步的列表查询 |
| 查询完整密钥时未提交密码 | code: 400,不返回密钥 | 在 JSON 请求体中填写 password |
| 账号未设置登录密码 | 点击「查看」后弹出「设置登录密码」窗口 | 在控制台设置密码后,按 3.2 节查询 |
| 完整密钥查询失败 | code 非 0,msg 返回原因 | 检查登录令牌、token_id 和当前登录密码 |
| 请求地址或方法错误 | HTTP 404 | 登录和完整密钥查询使用 POST,搜索使用 GET;核对完整地址 |
| 分组无权限 | 消息提示分组权限问题 | 检查密钥配置的分组及可用模型 |
model 填写该密钥调用 /v1/models 返回的模型 ID。unlimited_quota 为 false 的密钥,在 total_available 低于设定阈值时触发告警。| 版本 | 日期 | 说明 |
|---|---|---|
| v2.1 | 2026-09-29 | 增加密码验证的完整密钥查询流程,补充登录、密钥 ID 获取、请求参数和响应示例 |
