reseller
POST /v1/reseller/ai/credits/clients/{org_id}
Give one of your clients AI credit, or take unspent credit back.
Autentifikacija
Pošaljite API ključ kao nosivi token. Ključ mora imati dozvolu reseller.manage; ključ bez nje se odbija s kodom 403, a ne 404.
Gdje dolazi ID vaše organizacije
Ova krajnja točka prihvaća ID vaše organizacije u samom URL-u, kao org_id. Zamijenite ga u stazi — ne postoji zaglavlje ili parametar upita koji će umjesto toga poslužiti.
ID vaše organizacije nalazi se na zaslonu API ključeva u vašoj nadzornoj ploči, pored samog ključa. To je isti ID u svakom pozivu koji uputite.
Isprobajte
Zamijenite sve unutar šiljastih zagrada svojim vlastitim vrijednostima, a rezervirano mjesto za ključ s ključem iz vaše nadzorne ploče.
curl -X POST https://api.zinndigital.com/v1/reseller/ai/credits/clients/{org_id} \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "delta_micros": <integer>, "reason": <string> }'Prijavljeni ste? API konzola na vašoj nadzornoj ploči automatski unosi stvarni ID vaše organizacije i vaš vlastiti ključ te šalje zahtjev prema aktivnom API-ju kako biste mogli vidjeti stvarni odgovor. Otvori ovu krajnju točku u API konzoli
Pojedinosti
Moves credit between your pool and one client's balance in one transaction: a positive `delta_micros` gives, a negative one takes back. A client who has already **spent** the credit cannot be taken below zero — the request is refused and names what is left. A client that is not yours is refused with the same code and message as one that does not exist, so this cannot be used to discover whether an organization id is real. This is the manual route, for a trial, a goodwill gesture, or a bundle sold offline. The self-serve route is your client buying a pack from you, which draws on the same pool. Requires `reseller.manage`.
Parametri
| Naziv | Vrsta | Obavezno | Što je to |
|---|---|---|---|
org_id (path) | Uuid | Da | The client organization whose balance moves. Must be one of yours. |
org_id (query) | Uuid | Ne | Which of YOUR organizations is acting. Not the client. |
Tijelo zahtjeva
| Naziv | Vrsta | Obavezno | Što je to |
|---|---|---|---|
delta_micros | integer | Da | Signed USD micros. Positive gives credit to the client, negative takes unspent credit back. Zero is refused — a ledger row that means nothing. |
reason | string | Da | Why. Required, for the same reason a staff adjustment requires one: a movement of somebody's money with no stated cause is unanswerable three months later. |
Odgovor
| Naziv | Vrsta | Obavezno | Što je to |
|---|---|---|---|
pool_balance_micros | integer | Da | — |
client_balance_micros | integer | Da | — |
typical_calls | integer | Da | Roughly how many AI questions the client's new balance buys. An **illustration** — a long article costs many times a short question. |
Pogreške koje ova krajnja točka može vratiti
401 · 403 · 404 · 422 · 429