查询计费设置¶
读取账户的余额提醒、消费上限和自动充值设置。
GET https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/settings
调用前准备¶
请求示例¶
将示例中的 $MOI_PERSONAL_ACCESS_TOKEN 和 $ACCOUNT_ID 分别替换为个人访问令牌和所选账户的 ID。
curl -X GET \
"https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/settings" \
-H "X-API-Key: $MOI_PERSONAL_ACCESS_TOKEN"
路径参数¶
参数 |
类型 |
是否必填 |
说明 |
|---|---|---|---|
|
string |
是 |
目标账户的 ID,取自“查询当前账户”响应中的 |
成功响应¶
请求成功时返回 HTTP 200 和账户当前的计费设置。
{
"billing_account_id": "billing_account_example",
"balance_alert_enabled": false,
"warning_threshold_credit": "10",
"critical_threshold_credit": "5",
"monthly_spend_limit_credit": "100",
"pause_when_balance_zero": false,
"new_account_rate_limit_enabled": false,
"auto_recharge_enabled": false,
"auto_recharge_mode": "notify_only",
"auto_recharge_threshold_credit": "10",
"auto_recharge_amount": "100.00",
"auto_recharge_channel": "alipay",
"auto_recharge_cooldown_hours": 24,
"auto_recharge_monthly_limit_amount": "500.00",
"notification_channels": [
"email"
],
"settings_version": 1,
"updated_at": 1788739200
}
字段 |
类型 |
说明 |
|---|---|---|
|
string |
Billing 账户 ID。 |
|
boolean |
是否启用余额提醒。 |
|
string |
余额预警阈值,单位为 Credit。 |
|
string |
余额严重告警阈值,单位为 Credit。 |
|
string |
月度消费上限,单位为 Credit。未设置时返回空字符串。 |
|
boolean |
余额归零时暂停使用的设置。 |
|
boolean |
是否启用新账户速率限制。 |
|
boolean |
是否启用自动充值。 |
|
string |
自动充值模式。 |
|
string |
触发自动充值的余额阈值,单位为 Credit。 |
|
string |
每次自动充值的支付金额,使用账户默认支付币种。 |
|
string |
自动充值渠道。 |
|
string |
自动充值所使用的支付授权 ID,存在时返回。 |
|
integer |
两次自动充值之间的冷却时长,单位为小时。 |
|
string |
自动充值月度支付上限,使用账户默认支付币种。 |
|
array of string |
通知渠道。 |
|
integer |
设置版本号。 |
|
integer |
更新时间,Unix 秒。 |
|
string |
最后修改设置的用户 ID,存在时返回。 |
错误响应¶
缺少认证信息时返回 HTTP 401,请提供有效的个人访问令牌。
{
"code": "unauthenticated",
"message": "missing bearer token",
"error": "missing bearer token"
}
字段 |
类型 |
说明 |
|---|---|---|
|
string |
错误代码。 |
|
string |
错误说明。 |
|
string |
兼容错误说明,与 message 内容相同。 |