跳到正文
API 参考
API 参考

获取余额

获取剩余的付费和奖励余额,以及当前用量汇总。

获取剩余的付费和奖励余额,以及当前用量汇总。

端点

GET /api/v1/me/balance
基础 URL
https://runapi.ai
API 版本
v1
身份验证
Authorization: Bearer YOUR_API_KEY
授权
返回当前 Standard API 密钥绑定账户的余额。
02

成功响应

HTTP 200

GET /api/v1/me/balance

JSON
{
  "balance_cents": 1200,
  "bonus_balance_cents": 200,
  "paid_balance_cents": 1000,
  "spent_cents_today": 75,
  "spent_cents_total": 4300
}
03

错误响应 (401)

HTTP 401
响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "Authentication required"
}
04

错误响应 (403)

HTTP 403
响应 Schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

响应示例

JSON
{
  "error": "Standard API key required"
}
05

cURL 示例

CURL
curl -X GET https://runapi.ai/api/v1/me/balance \
  -H 'Authorization: Bearer YOUR_API_KEY'