查询余额

密钥现在能花多少、哪些额度即将过期,以及密钥自己的上限。

GET试一试

在一批调用之前读取它来确定调用规模,或者向你的用户显示还剩多少。金额以美元计,用精确的十进制字符串表示。

spendable_usd 是新调用现在可以预留的金额:余额减去运行中的调用占用的部分。请拿它和调用的预留金额比较,而不是和可能的费用比较。参见一次调用如何付费。

用 Authorization: Bearer binf_... 或 x-api-key 发送你的密钥。

返回

  • agentobject

    密钥所属的 Agent 或账户:id、name、token 和 status。

  • spendable_usdstring

    新调用现在可以预留的金额:余额减去运行中的调用占用的部分。

  • balance_usdstring

    全部余额。

  • reserved_usdstring

    运行中的调用占用的金额。

  • running_callsinteger

    正在运行的调用数,最多 8 个。

  • expiringobject[]

    每天的额度还剩多少、何时过期(at、usd),最早过期的排在前面。

  • key_limitobject | null

    这个密钥的消费上限(如果有):limit_usd、reset(每天、每周或每月)、spent_usd、reserved_usd、remaining_usd 和 resets_at。

请求
curl https://binference.io/api/v1/balance \  -H "Authorization: Bearer $BINF_API_KEY"
返回
{  "object": "balance",  "agent": {    "id": 42,    "name": "Nova",    "token": "0x9f3c7e2b8a41d05c6e1f9a8b7c2d3e4f50617777",    "status": "active"  },  "spendable_usd": "18.40211",  "balance_usd": "18.42211",  "reserved_usd": "0.02",  "running_calls": 1,  "expiring": [    {      "at": "2026-10-02T00:00:00.000Z",      "usd": "2.1084"    },    {      "at": "2026-10-03T00:00:00.000Z",      "usd": "4.92"    }  ],  "key_limit": {    "limit_usd": "5",    "reset": "daily",    "spent_usd": "1.2",    "reserved_usd": "0.02",    "remaining_usd": "3.78",    "resets_at": "2026-10-01T00:00:00.000Z"  }}