
Rivya API वह developer path है जिससे आप अपने product, script या workflow से Rivya model capabilities इस्तेमाल कर सकते हैं।
यह Rivya Studio से अलग product नहीं है। यह वही account boundary, वही credit wallet और वही public model layer इस्तेमाल करता है जो users को Rivya में दिखती है। फर्क यह है कि काम कैसे शुरू होता है: Studio में click करने के बजाय आपका application API key के साथ requests भेजता है।
अगर आपको endpoint details चाहिए, तो Rivya API Overview और Rivya API Quickstart से शुरू करें। यह article product-level explanation है: API किसलिए है, कहां फिट होती है, और कब इसे पहला रास्ता नहीं बनाना चाहिए।
Short version
Rivya API v1 signed-in account को API keys create करने और web interface के बाहर से Rivya model capabilities call करने देती है।
Current API surface में शामिल है:
- API model list से model discovery
- asynchronous image, video और audio generation jobs
- reference media चाहने वाले models के लिए Files API uploads
- public task IDs के साथ generation status polling
- account credit checks
- Chat API turns, optional SSE streaming सहित
- generation completion के लिए signed webhooks
- client wrapper चाहने वाली teams के लिए TypeScript SDK beta
Public developer hub Developers है। अगर आपको guided overview, API key settings के links और safe debugger flow चाहिए, तो यह सबसे अच्छा entry point है।
Rivya के पास API क्यों है
जब कोई व्यक्ति अभी models चुन रहा हो, prompts shape कर रहा हो, outputs review कर रहा हो और next step तय कर रहा हो, Studio उपयोगी है।
API तब उपयोगी है जब वह decision repeatable product या operational workflow बन चुका हो।
Common examples:
- user brief submit करने के बाद product image variations generate करना चाहता है
- marketing workflow structured campaign inputs से visual drafts बनाना चाहता है
- internal tool browser खुलवाए बिना video या audio jobs submit करना चाहता है
- support या content system अपने interface में chat model turn चाहता है
- backend service generation jobs finish होने पर signed callbacks चाहता है
इन cases में Rivya API काम को same Rivya account से जुड़ा रखती है, billing, model selection और task status के लिए separate stack बनवाने के बजाय।
API क्या replace नहीं करती
API Rivya को सीधे इस्तेमाल करने की हर वजह replace नहीं करती।
Studio या public work surfaces इस्तेमाल करें जब:
- prompt को अभी human exploration चाहिए
- model choice stable नहीं है
- creator को outputs visually compare करने हैं
- project saved history और manual review पर निर्भर है
- team ने तय नहीं किया कि कौन सा input और output format repeatable बनना चाहिए
जब workflow automate करने लायक साफ़ हो जाए, तब API इस्तेमाल करें।
यह boundary मायने रखती है। Vague creative question आम तौर पर पहले Studio में रहना चाहिए। Predictable inputs वाला known product flow API में move हो सकता है।
Main building blocks
API को छह connected pieces की तरह सोचें।
| Building block | यह क्या handle करता है | आगे कहां पढ़ें |
|---|---|---|
| API keys | आपके account से server-to-server access | API Authentication |
| Models | Public model IDs और readiness information | API Models |
| Generations | Async image, video और audio jobs | Create Generation |
| Files | Reference image, video या audio uploads | Files API |
| Chat | Non-streaming या streaming chat turns | Chat API |
| Webhooks | Generation jobs के signed completion events | API Webhooks |
Request और response shape के लिए API docs source हैं। यह article आपको यह तय करने में मदद करता है कि पहले कौन सा piece चाहिए।
Credits कैसे काम करते हैं
API usage Studio की तरह same Rivya account credit wallet से draw करता है।
इसका मतलब है कि API anonymous model proxy नहीं है। Request किसी Rivya account से belong करती है, उस account से created API key इस्तेमाल करती है, और API Credits में बताई product-level credit boundary follow करती है।
Teams के लिए यह उपयोगी है क्योंकि Studio experiments और API usage एक operational model में रहते हैं। आप model manually test कर सकते हैं, फिर repeatable part को second billing layer बनाए बिना integration में move कर सकते हैं।
Files कैसे fit होती हैं
कुछ models सिर्फ text से run कर सकते हैं। दूसरे models को reference image, video या audio file चाहिए।
API integrations में ये references Files API से जाने चाहिए। Upload managed file record create करता है जिसे supported model parameters में pass किया जा सकता है।
Practical rule सरल है:
- अगर model text-only input accept करता है, तो generation endpoint से शुरू करें
- अगर model को reference media चाहिए, तो पहले file upload करें
- अगर model chat model है और image attachments चाहिए, तो Chat API और file IDs इस्तेमाल करें
अपनी integration को browser-only upload flows या saved Studio sessions के आसपास design न करें। API की अपनी public file boundary इसी वजह से है।
Webhooks कहां मदद करते हैं
Polling सबसे आसान first integration path है। Generation job submit करें, public task ID save करें, और success या failure तक poll करें।
जब integration ज्यादा production-like हो, तब Webhooks उपयोगी होते हैं:
- आप हर job के लिए worker polling नहीं चाहते
- app को generation finish होने पर record update करना है
- आपको safely retry हो सकने वाला signed event चाहिए
- failed jobs को clear recovery path में जाना है
Signed event contract के लिए API Webhooks इस्तेमाल करें। Webhook receiver narrow रखें: signatures verify करें, duplicate events handle करें, और secret values को logs में डालने से बचें।
अच्छा पहला API project
सबसे अच्छा पहला API project आम तौर पर छोटा और concrete होता है।
उदाहरण के लिए:
- settings में API key create करें
- model list call करें
- एक available model चुनें
- idempotency key के साथ एक generation job submit करें
- status endpoint poll करें
- before और after credits check करें
- उसके बाद ही Files API, Chat API या Webhooks add करें
यह path पहली test में हर API feature मिलाए बिना working integration देता है।
कब API wrong starting point है
API शायद सही पहला step नहीं है जब:
- team ने अभी model family नहीं चुनी है
- desired output हर run में बदल रहा है
- prompt manual taste और review पर निर्भर है
- integration credit usage उन लोगों से छिपा देगा जिन्हें उसे समझना चाहिए
- product को automation से पहले public demo चाहिए
इन cases में Image, Video, Audio, Chat, या AI Models से शुरू करें। Path repeatable होने के बाद stable part को API में move करें।
आगे कहां जाएं
- Public API hub और debugger के लिए Developers खोलें।
- First safe request बनाने के लिए Rivya API Quickstart पढ़ें।
- Server पर key रखने से पहले API Authentication पढ़ें।
- Model IDs चुनने से पहले API Models पढ़ें।
- Product boundary अभी unclear है तो Studio के बजाय Rivya API कब इस्तेमाल करें पढ़ें।
- जब आप full image, video, audio या chat integration plan कर रहे हों, तो Rivya API से multimodal AI workflow कैसे बनाएं पढ़ें।


