reseller
POST /v1/reseller/ai/credits/clients/{org_id}
Give one of your clients AI credit, or take unspent credit back.
प्रमाणन
बेरर टोकन के रूप में एक API कुंजी भेजें। कुंजी के पास reseller.manage अनुमति होनी चाहिए; इसके बिना एक कुंजी को 404 के बजाय 403 के साथ अस्वीकार कर दिया जाता है।
जहां आपकी संगठन आईडी आती है
यह एंडपॉइंट URL में ही आपके संगठन की आईडी को org_id के रूप में लेता है। इसे पाथ में बदलें — इसके विकल्प के रूप में काम करने वाला कोई हेडर या क्वेरी पैरामीटर नहीं है।
आपकी ऑर्गनाइजेशन आईडी आपके डैशबोर्ड पर एपीआई कीज़ स्क्रीन पर, की के ठीक बगल में मौजूद है। यह आपके द्वारा की जाने वाली हर कॉल में समान आईडी होती है।
इसे आज़माएँ
कोणार्कित ब्रैकेट्स में दी गई किसी भी चीज़ को अपने मानों से बदलें, और की प्लेसहोलर को अपने डैशबोर्ड की एक की से बदलें।
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> }'साइन इन हैं? आपके डैशबोर्ड में मौजूद API कंसोल आपकी वास्तविक संगठन आईडी और आपकी अपनी कुंजी स्वतः भर देता है, और लाइव API के विरुद्ध अनुरोध चलाता है ताकि आप वास्तविक प्रतिक्रिया देख सकें। इस एंडपॉइंट को API कंसोल में खोलें
विवरण
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`.
पैरामीटर
| नाम | प्रकार | आवश्यक | यह क्या है |
|---|---|---|---|
org_id (path) | Uuid | हाँ | The client organization whose balance moves. Must be one of yours. |
org_id (query) | Uuid | नहीं | Which of YOUR organizations is acting. Not the client. |
अनुरोध बॉडी
| नाम | प्रकार | आवश्यक | यह क्या है |
|---|---|---|---|
delta_micros | integer | हाँ | 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 | हाँ | 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. |
प्रतिक्रिया
| नाम | प्रकार | आवश्यक | यह क्या है |
|---|---|---|---|
pool_balance_micros | integer | हाँ | — |
client_balance_micros | integer | हाँ | — |
typical_calls | integer | हाँ | Roughly how many AI questions the client's new balance buys. An **illustration** — a long article costs many times a short question. |
त्रुटियाँ जो यह एंडपॉइंट लौटा सकता है
401 · 403 · 404 · 422 · 429