Amux AI

OpenAI 账单格式

最近更新:2026年11月19日

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

兼容 OpenAI 旧版账单查询接口,适用于以下客户端与中转服务的余额同步:

  • new-api 以「OpenAI」渠道类型接入 Amux AI 时的余额查询
  • one-api 渠道余额查询
  • NextChat、Cherry Studio 等客户端的余额展示

以下两个端点均同时支持带 /v1 前缀与不带 /v1 前缀的请求路径。

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

鉴权

header
Authorizationstring必填

Bearer <你的 Amux AI 密钥> 在控制台创建的 Amux AI API 密钥。

响应

200response

成功返回账单订阅信息。

401response

API 密钥缺失或无效。

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

鉴权

header
Authorizationstring必填

Bearer <你的 Amux AI 密钥> 在控制台创建的 Amux AI API 密钥。

请求

start_datestring

起始日期(为兼容保留,不生效)。

end_datestring

结束日期(为兼容保留,不生效)。

响应

200response

成功返回当期已用金额。

401response

API 密钥缺失或无效。

余额计算方式

兼容客户端按以下公式计算剩余额度:

余额(美元)= hard_limit_usd − total_usage / 100

Amux AI 返回的字段保证上述计算结果等于当前密钥的可用额度:

  • total_usage:所属工作区当期已消耗金额(单位:美分)
  • hard_limit_usd:当前密钥可用额度与 total_usage 折算美元金额之和(单位:美元)

当密钥无权查看账户级账单数据(即不属于个人工作区,且归属人非组织所有者、组织管理员或组织财务成员)时,total_usage 返回 0、hard_limit 返回 null,且省略 quota 字段;若密钥自身或工作区配置了可见限额,hard_limit_usd 仍准确反映该密钥的可用额度。当可用额度不受限时,hard_limit_usd 返回 100000000,与 new-api 对无限额令牌的约定保持一致。

由于客户端会分别请求上述两个端点,若两次请求之间产生新的扣费,计算所得余额可能略低于实时可用额度。

在 new-api 中配置

在渠道管理中选择渠道类型为「OpenAI」,将 Base URL 设为 https://gateway.amux.ai,并填入 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"
    }
  }
}