账户信息查询
user-infoGEThttps://v1.apizero.cn/api/user-info概述
用你自己的 API Key,查询自己账户还剩多少钱、还剩多少次、套餐哪天到期。给监控告警用:余额不够自动提醒,避免额度突然用完业务中断。 怎么用(三步): 1)登录控制台 → API Key,复制一把 sk_live_ 开头的密钥; 2)请求 GET https://v1.apizero.cn/api/user-info ; 3)请求头写 Authorization: Bearer 你的Key。没有城市、条码这类查询参数,也不要传 user_id(传了也会被忽略,不能查别人)。 本接口只读,不扣费、不改账户。预付费可售 Key 只能看到这把 Key 还剩几次,看不到卖家钱包。请把 Key 放在请求头,不要写进网页或 URL。
调用约定
- 网关 ·
https://v1.apizero.cn - 鉴权 ·
Authorization: Bearer <API Key> - 回包 · JSON {code, msg, data}。成功看 code === 0,不要只看 HTTP 200。
/aidocs/user-info/raw.md鉴权
小白三步:控制台复制 API Key → GET https://v1.apizero.cn/api/user-info → 请求头 Authorization: Bearer 你的Key。 没有业务参数。不要传 user_id / email(忽略,不能查别人)。必须带 Key,不支持匿名。不扣费。每把 Key 每秒 1 次、每天 720 次,建议 5 分钟查一次。不要把 Key 写成 ?api_key=(会进访问日志)。 告警看这三个就够:data.balance.yuan(还剩多少元)、data.plans[].remaining(套餐还剩多少次)、data.vip.days_left(会员还剩几天)。
获取 API Key:/account/keys
请求头
| Header | 类型 | 必填 | 说明 |
|---|---|---|---|
| Authorization | string | 否 | 推荐:Bearer <API Key>。兼容请求头 X-API-Key,以及 Query api_key / apikey / key(key 仅当值为 sk_live_/sk_test_/sk_stag_ 形态时生效)。匿名可不传,受每日免费额度限制。 |
请求参数
GET · QUERY STRING · https://v1.apizero.cn/api/user-info?%28%E6%97%A0%E6%9F%A5%E8%AF%A2%E5%8F%82%E6%95%B0%29=%28%E6%97%A0%E6%9F%A5%E8%AF%A2%E5%8F%82%E6%95%B0%29
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| (无查询参数) | — | 否 | 本接口没有查询参数,URL 不用加 ?xxx=。不要传 user_id / email / key_id,传了也会被忽略,只能查当前这把 Key 自己的账户。 |
返回结果
顶层固定为 code / msg / data。下表一般是 data 内字段。 code · msg · data · tips · request_id
| 字段 | 类型 | 说明 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| scope | string | account=普通 Key,下面余额/套餐都有;key=预付费可售 Key,只看 key.quota_remaining,钱包是 null | ||||||||||||
| as_of | string | 这次数据的时间(北京时间) | ||||||||||||
| balance.yuan | string | 【告警常用】钱包还剩多少人民币,例如 "12.3400"。预付费 Key 为 null | ||||||||||||
| balance.fen | number | 钱包余额(分,1 元=100 分) | ||||||||||||
| points.remaining | number | 还剩多少点数 | ||||||||||||
| usage.today_calls | number | 今天已经调用了多少次(所有接口合计) | ||||||||||||
| usage.month_calls | number | 本月已经调用了多少次 | ||||||||||||
| usage.month_spent.yuan | string | 本月钱包花了多少元 | ||||||||||||
| vip.expire_at | string | 会员哪天到期;没有开通会员则整个 vip 为 null | ||||||||||||
| vip.days_left | number | 【告警常用】会员还剩几天 | ||||||||||||
| vip.credit_remaining.yuan | string | 企业会员接口额度还剩多少元(没有则无此字段) | ||||||||||||
| vip.ai_credit_remaining.yuan | string | 企业会员大模型额度还剩多少元 | ||||||||||||
| trial.remaining | number | 各接口试用次数加起来还剩多少 | ||||||||||||
| trial.used | number | 试用已经用掉多少 | ||||||||||||
| plans | array | 正在生效的包月/包年套餐列表(最多 40 条) | ||||||||||||
| ||||||||||||||
| key.id | string | 当前这把 Key 的公开编号(key_xxxx),不是 sk_live_ 那串密钥 | ||||||||||||
| key.kind | string | standard=普通 Key;prepaid=预付费可售 Key | ||||||||||||
| key.quota_remaining | number | 预付费 Key 还剩多少次 | ||||||||||||
| key.quota_used | number | 预付费 Key 已经用了多少次 | ||||||||||||
| key.expires_at | string | 这把 Key 自己哪天过期;没有限制则为 null | ||||||||||||
| tips | string | 品牌提示(所有接口统一返回):极数本源 · https://apizero.cn | ||||||||||||
返回示例
{
"code": 0,
"msg": "成功",
"data": {
"scope": "account",
"as_of": "2026-09-09T10:00:00+08:00",
"balance": {
"fen": 12340,
"yuan": "123.4000"
},
"points": {
"remaining": 80
},
"usage": {
"today_calls": 12,
"month_calls": 340,
"month_spent": {
"fen": 256.5,
"yuan": "2.5650"
}
},
"vip": {
"level": "黄金会员",
"level_num": 1,
"active": true,
"expire_at": "2026-10-01 23:59:59",
"days_left": 22,
"auto_renew": false,
"month_calls_used": 3
},
"trial": {
"remaining": 5,
"granted": 20,
"used": 15
},
"plans": [
{
"api_id": "weather",
"name": "天气包月",
"plan": "monthly",
"used": 80,
"quota": 3000,
"remaining": 2920,
"expire_at": "2026-10-09 12:00:00"
}
],
"key": {
"id": "key_xxxx",
"kind": "standard",
"last4": "ab12",
"daily_limit": null,
"expires_at": null
}
},
"request_id": "req_example",
"tips": "极数本源 · https://apizero.cn"
}请求示例
示例都是服务端写法。Python / JavaScript 各有常规写法和官方库。把 Key 放在环境变量 APIZERO_KEY,不要写进浏览器、小程序或前端打包。
# 服务端执行:export APIZERO_KEY=...
# 密钥:https://apizero.cn/account/keys
curl -sS -H "Authorization: Bearer $APIZERO_KEY" "https://v1.apizero.cn/api/user-info"错误码
先看业务 code。HTTP 也可能不是 200。
| 业务码 | HTTP | 说明 |
|---|---|---|
| 0 | 200 | 成功 |
| 4000 | 400 | 参数错误 |
| 4011 | 401 | API Key 无效 |
| 4013 | 403 | API Key 已暂停 |
| 4014 | 403 | 当前 IP 不在 Key 白名单 |
| 4015 | 401 | 此接口需要 API Key |
| 4022 | 402 | 余额不足 |
| 4029 | 429 | 调用过快(QPS) |
| 4030 | 429 | 今日免费额度已用完 |
| 4040 | 503 | 接口已下线 |
| 4041 | 404 | 接口不存在 |
| 5000 | 500 | 服务器内部错误 |
| 5020 | 502 | 上游暂时不可用 |
| 5021 | 502 | 上游返回格式异常 |
| 5030 | 502 | 暂无可用节点 |
调用限制
| 计费模式 | 完全免费 |
|---|---|
| QPS 限制 | 1 req/s |
| 登录免费额度 | 720 次(已认证) |
| 匿名每日额度 | 无 |
| 黄金会员 | 每日 720 次 · QPS 10 |
| 钻石会员 | 每日 100000 次 · QPS 30 |
| 企业会员 | 企业接口额度 · QPS 120 |
购买套餐、看评价请走商城详情。 购买 / 调试
更新日志
- 1.0.02026-09-09
上架账户只读查询,支持余额 / 次数 / 套餐到期 预付费 Key 隔离卖家钱包;本接口不计费
免责声明
本接口只读,不扣余额/点数/预付费额度。请勿把 API Key 写进前端页面、公开仓库或 URL 参数(会进访问日志)。返回内容仅为当前凭证对应的账户或该 Key 自身额度,不能查别人,也列不出账号下其它 Key。