ai

PUT /v1/ai/credits/settings

Turn automatic top-up on or off.

Wszystkie punkty końcowe ai

Wszystkie dokumentacje dla programistów

Uwierzytelnianie

Wyślij klucz API jako token bearer. Klucz musi posiadać uprawnienie billing.payment.manage; klucz bez niego jest odrzucany z kodem 403, a nie 404.

Ten punkt końcowy nie wymaga identyfikatora organizacji. Twój klucz już identyfikuje organizację, do której należy, a odpowiedź jest do niej ograniczona.

Wypróbuj

Zastąp wszystko w nawiasach ostrych własnymi wartościami, a zastępczy znacznik klucza kluczem ze swojego pulpitu nawigacyjnego.

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> }'

Zalogowany? Konsola API w Twoim panelu uzupełnia rzeczywiste identyfikator organizacji oraz Twój własny klucz i wykonuje żądanie względem aktywnego API, dzięki czemu możesz zobaczyć rzeczywistą odpowiedź. Otwórz ten punkt końcowy w konsoli API

Szczegóły

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.

Treść żądania

NazwaTypWymaganeCo to jest
auto_topup_enabledbooleanTak
auto_topup_pack_codestringNie
auto_topup_threshold_microsintegerNie0 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…
auto_topup_monthly_cap_microsintegerNie0 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…

Odpowiedź

NazwaTypWymaganeCo to jest
stateAiCreditStateTak
packsAiCreditPack[]Tak
settingsAiCreditSettingsTakThe customer's standing instruction about topping up, and what has become of it. Owner, 2026-08-24, reading /ai on production:…
historyAiCreditHistoryLine[]TakThe 25 most recent movements, newest first.
funding_routesAiProviderFunding[]TakWho 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[]TakEverything 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.

Błędy, które ten punkt końcowy może zwrócić

401 · 403 · 422 · 429