ai

PUT /v1/ai/credits/settings

Turn automatic top-up on or off.

Tất cả các điểm cuối ai

Xác thực

Gửi khóa API dưới dạng mã thông báo bearer. Khóa này phải có quyền billing.payment.manage; khóa không có quyền này sẽ bị từ chối với mã lỗi 403, không phải 404.

Endpoint này không nhận ID tổ chức. Khóa của bạn đã xác định tổ chức mà nó thuộc về và phản hồi được giới hạn trong phạm vi đó.

Dùng thử

Thay thế bất kỳ nội dung nào trong ngoعل (angle brackets) bằng giá trị của riêng bạn và trình giữ chỗ key bằng một key từ trang tổng quan của bạn.

curl -X PUT https://api.zinndigital.com/v1/ai/credits/settings \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "auto_topup_enabled": <boolean> }'

Đã đăng nhập? Bảng điều khiển API trong trang quản lý của bạn sẽ tự điền ID tổ chức thực tế và khóa của riêng bạn, sau đó chạy yêu cầu đối với API trực tiếp để bạn có thể xem phản hồi thực tế. Mở điểm cuối này trong bảng điều khiển API

Chi tiết

Automatic top-up is **off by default** and only the customer can turn it on. When it is on, running below the threshold buys the chosen pack once, with an hour between attempts so a declining card cannot be retried in a loop. Requires `billing.payment.manage` — turning this on is a decision to let us charge a saved card, which is the same audience as managing a provider key.

Nội dung yêu cầu

TênLoạiBắt buộcNội dung này là gì
auto_topup_enabledboolean
auto_topup_pack_codestringKhông
auto_topup_threshold_microsintegerKhông`0` keeps the shared low-balance threshold. Any other value below `min_threshold_micros` is a `422` — but **only when `auto_topup_enabled` is true**: refusing to let somebody sw…
auto_topup_monthly_cap_microsintegerKhông`0` uses the computed default. A ceiling smaller than one top-up is a `422`: it is not a strict setting, it is an off switch wearing one — every attempt would exceed it and noth…

Phản hồi

TênLoạiBắt buộcNội dung này là gì
stateAiCreditState
packsAiCreditPack[]
settingsAiCreditSettingsThe customer's standing instruction about topping up, and what has become of it. Owner, 2026-08-24, reading `/ai` on production: *"The auto top section doesnt allow you to selec…
historyAiCreditHistoryLine[]The 25 most recent movements, newest first.
funding_routesAiProviderFunding[]Who pays for the next call, per provider. Read on the SAME request as the balance, so a screen cannot render a funding claim from one moment beside a balance from another.
spendsAiCreditSpend[]Everything this credit buys — the metered surfaces derived from the engine's own meter, the credit-only spends that write no usage row, and the fixed-price AI products.

Các lỗi điểm cuối này có thể trả về

401 · 403 · 422 · 429