Rivya API overview
API keys، account credits، اور optional SSE streaming کے ساتھ اپنے product سے Rivya generation اور chat models call کرنے کے لیے Rivya API v1 استعمال کریں۔
2026/05/11 کو آخری review
Rivya API v1 آپ کے اپنے product سے Rivya model capabilities call کرنے کے لیے developer entry point ہے۔
Public API asynchronous image، video، اور audio generation کے ساتھ Chat API turns support کرتی ہے، جن میں non-streaming یا SSE streaming responses ہو سکتے ہیں۔ یہ Rivya model IDs، Rivya account credits، generation کے لیے public task IDs، اور Chat API کے لیے server-side chat sessions استعمال کرتی ہے۔
API کس کام کے لیے ہے
API اس وقت استعمال کریں جب آپ:
اپنی app سے image، video، یا audio generation jobs submit کرنا چاہتے ہوں
non-streaming یا streaming chat turns send کرنا اور API-created chat sessions continue کرنا چاہتے ہوں
billing کو اسی Rivya account credit wallet کے اندر رکھنا چاہتے ہوں
public task ID کے ذریعے task status poll کرنا چاہتے ہوں
safer production requests کے لیے idempotent retries استعمال کرنا چاہتے ہوں
Studio اور API usage کو same account boundary کے تحت رکھنا چاہتے ہوں
API ایک Rivya product layer ہے۔ Public responses صرف Rivya names اور public fields استعمال کرتے ہیں۔
Current version scope
Current v1 endpoints:
GET /api/v1/modelsPOST /api/v1/generationsPOST /api/v1/filesGET /api/v1/files/{fileId}POST /api/v1/chat/completionsGET /api/v1/chat/sessionsGET /api/v1/chat/sessions/{sessionId}GET /api/v1/generations/{taskId}GET /api/v1/creditsGET /api/v1/webhooksPOST /api/v1/webhooksGET /api/v1/webhook-eventsGET /api/v1/openapi.json
Current version میں asynchronous generation results کے لیے signed webhooks، Chat API، اور server-side streaming support کے ساتھ TypeScript SDK beta شامل ہیں۔
Authentication
Generation، status، اور credit endpoints کو یہ header چاہیے:
Authorization: Bearer rvya_sk_...API Keys settings سے keys create اور rotate کریں۔ Production میں key استعمال کرنے سے پہلے API authentication پڑھیں۔
Billing model
API calls وہی Rivya account credits استعمال کرتی ہیں جو Studio استعمال کرتا ہے۔
Generation jobs task start ہونے پر credits reserve یا consume کرتے ہیں۔ Chat turns model call سے پہلے credits reserve کرتے ہیں اور assistant message save ہونے پر token usage سے final credits settle کرتے ہیں۔ اگر generation یا chat turn existing Rivya failure rules کے تحت fail ہو جائے تو وہی refund handling apply ہوتی ہے۔
User-facing wallet model کے لیے API credits اور Rivya میں credits اور billing پڑھیں۔
First integration path
Settings میں API key create کریں۔
Public model ID choose کرنے کے لیے List API models call کریں۔
Model parameters کے لیے Model API reference پڑھیں۔
اگر model کو reference media چاہیے تو Files API سے upload کریں۔
Generation بنائیں سے job submit کریں۔
Task succeed یا fail ہونے تک Generation status poll کریں، یا signed completion events کے لیے subscribe کریں۔
Chat models کے لیے generation endpoint کے بجائے Chat API استعمال کریں۔ Chat image attachments کو Files API
file_idvalues reference کرنی ہوں گی۔
Related pages
Rivya model availability گائیڈ
Rivya model availability، provider changes، direct generation، workflow support، fallbacks، credit hints، اور production readiness سمجھیں۔
Rivya API quickstart
API key create کریں، model choose کریں، asynchronous generation job submit کریں، اور optional SSE streaming کے ساتھ Chat API turn send کریں۔