查询自动充值配置
使用系统访问令牌读取当前账户的数据
国内用户请注意: 中国大陆用户请使用 https://toapis.cn 作为接口地址 (Base URL). 文档示例中的 https://toapis.com 请替换为 https://toapis.cn.
鉴权, 分页与错误处理见接入说明.
使用说明
仅主账号可查询自身账单. 子账号访问返回 HTTP 403, 主账号也不能借此查询成员账单.
enabled 为配置开关, status 同时反映暂停, 缺卡, 需验证和重试状态, 两者含义不同. threshold_credits 是触发阈值, configured_amount_usd 是配置的 USD 数量, 不承诺实际扣款或入账值. 时间未知时为 null. reason 可为 card_unbound, charge_failed, verification_required, failure_limit, missing_payment_method, billing_not_linked, configuration_review_required 或 null. action_required 表示需要交互处理; GET 不尝试扣款.
鉴权
Authorizationstring请求头必填使用系统访问令牌, 格式为 Bearer YOUR_SYSTEM_ACCESS_TOKEN. 模型 API Key 不能用于此接口, 无需 X-User-Id.
请求参数
此接口不接受路径或查询参数, 无需请求体.
请求示例
curl --request GET \
--url 'https://toapis.com/api/v1/account/billing/auto-topup' \
--header 'Authorization: Bearer YOUR_SYSTEM_ACCESS_TOKEN'import requests
response = requests.get(
"https://toapis.com/api/v1/account/billing/auto-topup",
headers={"Authorization": "Bearer YOUR_SYSTEM_ACCESS_TOKEN"},
timeout=30,
)
response.raise_for_status()
print(response.json())const url = new URL("https://toapis.com/api/v1/account/billing/auto-topup");
const response = await fetch(url, {
headers: { Authorization: "Bearer YOUR_SYSTEM_ACCESS_TOKEN" },
signal: AbortSignal.timeout(30_000),
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
console.log(await response.json());响应字段
示例使用虚构数据. 金额样例假设 credits_per_usd="100", 实际换算以响应为准.
codeinteger业务状态码, 成功时为 0.
messagestring响应消息, 成功时为空字符串. 错误消息会按请求语言返回.
dataobject本次查询的结果对象.
data.enabledboolean自动充值的配置开关, 与运行状态 status 分开表达.
data.statusstring自动充值运行状态, 反映启用, 暂停, 验证, 缺卡或等待重试. 可选值: active, paused, requires_action, missing_payment_method, retry_wait.
data.threshold_creditsstring触发自动充值的余额阈值, 单位为 credits. 以十进制字符串返回以保持精度.
data.configured_amount_usdstring配置的自动充值 USD 金额, 不承诺最终扣款或入账值. 以十进制字符串返回以保持精度.
data.last_attempt_atstring | null最近一次自动充值尝试时间. 时间格式为带时区的 RFC 3339. 无法确认或不适用时为 null.
data.last_success_atstring | null最近一次自动充值成功时间. 时间格式为带时区的 RFC 3339. 无法确认或不适用时为 null.
data.next_retry_atstring | null下一次自动充值重试时间. 时间格式为带时区的 RFC 3339. 无法确认或不适用时为 null.
data.action_requiredboolean是否需要用户交互处理. 本次 GET 不会发起支付.
data.reasonstring | null自动充值状态的原因代码, 无额外原因时为 null.
data.sourcestring数据来源. 本地配置或账本快照不表示 Stripe 实时状态. 固定值: "local_configuration".
响应示例
{
"code": 0,
"message": "",
"data": {
"enabled": true,
"status": "active",
"threshold_credits": "100",
"configured_amount_usd": "10",
"last_attempt_at": "2026-11-01T08:00:00Z",
"last_success_at": "2026-11-01T08:01:00Z",
"next_retry_at": null,
"action_required": false,
"reason": null,
"source": "local_configuration"
}
}