账户信息查询

user-infoGET
GEThttps://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
打开 Markdown

鉴权

小白三步:控制台复制 API Key → GET https://v1.apizero.cn/api/user-info → 请求头 Authorization: Bearer 你的Key。 没有业务参数。不要传 user_id / email(忽略,不能查别人)。必须带 Key,不支持匿名。不扣费。每把 Key QPS 1、每天 720 次,建议 5 分钟查一次。不要把 Key 写成 ?api_key=(会进访问日志)。 告警看这三个就够:data.balance.yuan(还剩多少元)、data.plans[].remaining(套餐还剩多少次)、data.vip.days_left(会员还剩几天)。

获取 API Key

请求头

Authorizationstring选填

推荐: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

scopestring

account=普通 Key,下面余额/套餐都有;key=预付费可售 Key,只看 key.quota_remaining,钱包是 null

as_ofstring

这次数据的时间(北京时间)

balance.yuanstring

【告警常用】钱包还剩多少人民币,例如 "12.3400"。预付费 Key 为 null

balance.fennumber

钱包余额(分,1 元=100 分)

points.remainingnumber

还剩多少点数

usage.today_callsnumber

今天已经调用了多少次(所有接口合计)

usage.month_callsnumber

本月已经调用了多少次

usage.month_spent.yuanstring

本月钱包花了多少元

vip.expire_atstring

会员哪天到期;没有开通会员则整个 vip 为 null

vip.days_leftnumber

【告警常用】会员还剩几天

vip.credit_remaining.yuanstring

企业会员接口额度还剩多少元(没有则无此字段)

vip.ai_credit_remaining.yuanstring

企业会员大模型额度还剩多少元

trial.remainingnumber

各接口试用次数加起来还剩多少

trial.usednumber

试用已经用掉多少

plansarray

正在生效的包月/包年套餐列表(最多 40 条)

namestring

套餐名称

usednumber

这个套餐已经用了多少次

remainingnumber

【告警常用】这个套餐还剩多少次;不限次为 null

expire_atstring

这个套餐哪天到期

key.idstring

当前这把 Key 的公开编号(key_xxxx),不是 sk_live_ 那串密钥

key.kindstring

standard=普通 Key;prepaid=预付费可售 Key

key.quota_remainingnumber

预付费 Key 还剩多少次

key.quota_usednumber

预付费 Key 已经用了多少次

key.expires_atstring

这把 Key 自己哪天过期;没有限制则为 null

tipsstring

品牌提示(所有接口统一返回):极数本源 · 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 各有常规写法和官方库。

curl -sS -H "Authorization: Bearer YOUR_API_KEY" "https://v1.apizero.cn/api/user-info"

错误码

先看业务 code。HTTP 也可能不是 200。

0200

成功

4000400

参数错误

4011401

API Key 无效

4013403

API Key 已暂停

4014403

当前 IP 不在 Key 白名单

4015401

此接口需要 API Key

4022402

余额不足

4029429

调用过快(QPS)

4030429

今日免费额度已用完

4040503

接口已下线

4041404

接口不存在

5000500

服务器内部错误

5020502

上游暂时不可用

5021502

上游返回格式异常

5030502

暂无可用节点

调用限制

计费模式
完全免费
QPS 限制
QPS 1
登录免费额度
720 次(已认证)
匿名每日额度
无
黄金会员
每天 720 次 · QPS 10
钻石会员
每天 100,000 次 · QPS 30
企业会员
每天 720 次 · QPS 120

购买套餐、看评价请走商城详情。 购买 / 调试

更新日志

  • 1.0.02026-09-09

    上架账户只读查询,支持余额 / 次数 / 套餐到期 预付费 Key 隔离卖家钱包;本接口不计费

免责声明

本接口只读,不扣余额/点数/预付费额度。请勿把 API Key 写进前端页面、公开仓库或 URL 参数(会进访问日志)。返回内容仅为当前凭证对应的账户或该 Key 自身额度,不能查别人,也列不出账号下其它 Key。