Amux AI

OpenAI 账单格式

最近更新:2026年10月29日

兼容 OpenAI 旧版账单接口,用于 new-api、one-api、NextChat 等工具查询余额。

兼容 OpenAI 旧版账单接口,适用于以下场景:

  • new-api 以 OpenAI 类型接入本平台时的渠道余额查询;
  • one-api 的渠道余额查询;
  • NextChat、Cherry Studio 等客户端的余额显示。

两个接口均支持带或不带 /v1 前缀的路径。

GEThttps://gateway.amux.ai/v1/dashboard/billing/subscription

鉴权

header
Authorizationstring必填

Bearer <你的 Amux AI 密钥> 控制台创建的 Amux 密钥。忘了可以回控制台的密钥页再看一次。

响应

200response

账单订阅信息。

401response

密钥缺失或无效。

GEThttps://gateway.amux.ai/v1/dashboard/billing/usage

鉴权

header
Authorizationstring必填

Bearer <你的 Amux AI 密钥> 控制台创建的 Amux 密钥。忘了可以回控制台的密钥页再看一次。

请求

start_datestring

为兼容保留,不生效。

end_datestring

为兼容保留,不生效。

响应

200response

当期已用金额。

401response

密钥缺失或无效。

余额计算

上述工具按以下公式计算余额:

余额 = hard_limit_usd − total_usage / 100

本平台的返回值使计算结果等于当前密钥的可用额度:

  • total_usage:工作区当期已用金额,单位为美分;
  • hard_limit_usd:可用额度与 total_usage 对应金额之和,单位为美元。

当前密钥无权查看工作区数据时(组织普通成员的密钥),total_usage 为 0,hard_limit 为 null,且不返回 quota。可用额度不受限时,hard_limit_usd 为 100000000,与 new-api 对不限额令牌的表示一致。

两个接口分别请求。如两次请求之间产生新的扣费,计算结果将略低于实际可用额度。

在 new-api 中配置

渠道类型选择 OpenAI,Base URL 填写 https://gateway.amux.ai,密钥填写本平台的 API 密钥。保存后在渠道列表中更新余额。

cURL
curl https://gateway.amux.ai/v1/dashboard/billing/subscription \
  -H "Authorization: Bearer $AMUX_API_KEY"
{
  "object": "billing_subscription",
  "has_payment_method": false,
  "soft_limit_usd": 60.75,
  "hard_limit_usd": 60.75,
  "system_hard_limit_usd": 60.75,
  "hard_limit": 10000,
  "system_hard_limit": 10000,
  "period": "month",
  "quota": {
    "total": {
      "limit": "100",
      "used": "12.5",
      "remaining": "87.5",
      "resetsAt": "2026-11-01T00:00:00.000Z"
    },
    "day": {
      "limit": "100",
      "used": "12.5",
      "remaining": "87.5",
      "resetsAt": "2026-11-01T00:00:00.000Z"
    },
    "week": {
      "limit": "100",
      "used": "12.5",
      "remaining": "87.5",
      "resetsAt": "2026-11-01T00:00:00.000Z"
    },
    "month": {
      "limit": "100",
      "used": "12.5",
      "remaining": "87.5",
      "resetsAt": "2026-11-01T00:00:00.000Z"
    }
  }
}