ai

PUT /v1/ai/credits/settings

Turn automatic top-up on or off.

Lahat ng ai endpoint

Pagpapatotoo

Magpadala ng API key bilang isang bearer token. Kailangang taglayin ng key ang pahintulot na billing.payment.manage; ang key na wala nito ay tatanggihan gamit ang 403, hindi 404.

Ang endpoint na ito ay hindi nangangailangan ng id ng organisasyon. Natutukoy na ng iyong key ang organisasyong kinabibilangan nito, at nakatuon ang tugon dito.

Subukan ito

Palitan ang anuman sa loob ng mga panaklong na may anggulo ng iyong sariling mga halaga, at ang placeholder ng key na may key mula sa iyong dashboard.

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

Nakalagda? Ang API console sa iyong dashboard ay awtomatikong naglalagay ng iyong tunay na ID ng organisasyon at sariling susi, at pinapatakbo ang kahilingan laban sa live na API upang makita mo ang aktwal na tugon. Buksan ang endpoint na ito sa console ng API

Mga Detalye

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.

Katawan ng kahilingan

PangalanUriKailanganAno ito
auto_topup_enabledbooleanOo
auto_topup_pack_codestringHindi
auto_topup_threshold_microsintegerHindi`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_microsintegerHindi`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…

Tugon

PangalanUriKailanganAno ito
stateAiCreditStateOo
packsAiCreditPack[]Oo
settingsAiCreditSettingsOoThe 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[]OoThe 25 most recent movements, newest first.
funding_routesAiProviderFunding[]OoWho 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[]OoEverything 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.

Mga error na maibabalik ng endpoint na ito

401 · 403 · 422 · 429