
Rivya API اپنے product، script، یا workflow سے Rivya model capabilities استعمال کرنے کا developer path ہے۔
یہ Rivya Studio سے الگ product نہیں۔ یہ وہی account boundary، وہی credit wallet، اور وہی public model layer استعمال کرتی ہے جو users کو Rivya بھر میں نظر آتی ہے۔ فرق یہ ہے کہ work کیسے start ہوتا ہے: Studio میں click کرنے کے بجائے آپ کی application API key کے ساتھ requests بھیجتی ہے۔
اگر آپ کو endpoint details چاہیے، تو Rivya API Overview اور Rivya API Quickstart سے شروع کریں۔ یہ article product-level explanation ہے: API کس لیے ہے، کہاں fit ہوتی ہے، اور کب first path نہیں ہونی چاہیے۔
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
- جن models کو reference media چاہیے ان کے لیے 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 چاہتے ہیں تو یہی best entry ہے۔
Rivya کے پاس API کیوں ہے
Studio تب useful ہے جب person ابھی models choose کر رہا ہو، prompts shape کر رہا ہو، outputs review کر رہا ہو، اور next step decide کر رہا ہو۔
API تب useful ہے جب وہ decision repeatable product یا operational workflow بن چکا ہو۔
Common examples:
- product user کے brief submit کرنے کے بعد image variations generate کرنا چاہتا ہے
- marketing workflow structured campaign inputs سے visual drafts create کرنا چاہتا ہے
- internal tool browser کھلوائے بغیر video یا audio jobs submit کرنا چاہتا ہے
- support یا content system اپنی interface کے اندر chat model turn چاہتا ہے
- backend service generation jobs finish ہونے پر signed callbacks چاہتا ہے
ایسے cases میں Rivya API work کو اسی Rivya account سے connected رکھتی ہے، billing، model selection، اور task status کے لیے separate stack force نہیں کرتی۔
API کیا replace نہیں کرتی
API Rivya directly use کرنے کی ہر reason replace نہیں کرتی۔
Studio یا public work surfaces استعمال کریں جب:
- prompt کو ابھی human exploration چاہیے
- model choice stable نہیں
- creator کو outputs visually compare کرنے ہیں
- project saved history اور manual review پر depend کرتا ہے
- team نے ابھی decide نہیں کیا کہ کون سا input اور output format repeatable بننا چاہیے
جب workflow automate کرنے کے لیے کافی clear ہو، API use کریں۔
یہ boundary matter کرتی ہے۔ vague creative question عموماً پہلے Studio میں belong کرتا ہے۔ predictable inputs والا known product flow API میں move ہو سکتا ہے۔
main building blocks
API کو چھ connected pieces کے طور پر سوچیں۔
| Building block | What it handles | Where to read next |
|---|---|---|
| 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 آپ کو decide کرنے میں help کرے کہ پہلے کون سا piece چاہیے۔
credits کیسے کام کرتے ہیں
API usage Studio جیسے same Rivya account credit wallet سے draw کرتی ہے۔
اس کا مطلب ہے API anonymous model proxy نہیں ہے۔ request Rivya account سے belong کرتی ہے، اسی account کی created API key use کرتی ہے، اور API Credits میں described same product-level credit boundary follow کرتی ہے۔
یہ teams کے لیے useful ہے کیونکہ Studio experiments اور API usage ایک operational model میں رہتے ہیں۔ آپ model manually test کر سکتے ہیں، پھر repeatable part کو second billing layer بنائے بغیر integration میں move کر سکتے ہیں۔
files کیسے fit ہوتی ہیں
کچھ models text alone سے run کر سکتے ہیں۔ دوسروں کو reference image، video، یا audio file چاہیے۔
API integrations کے لیے یہ references Files API سے گزرنے چاہئیں۔ upload ایک managed file record create کرتا ہے جسے supported model parameters میں pass کیا جا سکتا ہے۔
practical rule simple ہے:
- اگر model text-only input accept کرتا ہے، generation endpoint سے start کریں
- اگر model کو reference media چاہیے، پہلے file upload کریں
- اگر model chat model ہے جس میں image attachments ہیں، Chat API اور file IDs use کریں
اپنی integration کو browser-only upload flows یا saved Studio sessions کے around design نہ کریں۔ API کی اپنی public file boundary ایک reason سے ہے۔
webhooks کہاں help کرتے ہیں
Polling easiest first integration path ہے۔ generation job submit کریں، public task ID save کریں، اور succeed یا fail ہونے تک poll کریں۔
Webhooks تب useful ہو جاتے ہیں جب integration زیادہ production-like ہو:
- آپ ہر job کو poll کرنے والا worker نہیں چاہتے
- آپ کی app generation finish ہونے پر record update کرنا چاہتی ہے
- آپ signed event چاہتے ہیں جو safely retry ہو سکے
- failed jobs کو clear recovery path میں move ہونا ہے
signed event contract کے لیے API Webhooks استعمال کریں۔ webhook receiver narrow رکھیں: signatures verify کریں، duplicate events handle کریں، اور logs میں secret values ڈالنے سے بچیں۔
اچھا first API project
best first API project عموماً small اور concrete ہوتا ہے۔
For example:
- settings میں API key create کریں
- model list call کریں
- ایک available model choose کریں
- idempotency key کے ساتھ ایک generation job submit کریں
- status endpoint poll کریں
- credits before and after check کریں
- اس کے بعد ہی Files API، Chat API، یا Webhooks add کریں
یہ path ہر API feature کو first test میں mix کیے بغیر working integration دیتا ہے۔
API کب wrong starting point ہے
API شاید right first step نہیں ہے جب:
- team نے model family ابھی choose نہیں کی
- desired output ہر run میں بدل رہا ہے
- prompt manual taste اور review پر depend کرتا ہے
- integration credit usage ان لوگوں سے چھپا دے گی جنہیں اسے سمجھنا چاہیے
- product کو automation سے پہلے public demo چاہیے
ان cases میں Image، Video، Audio، Chat، یا AI Models سے start کریں۔ path repeatable ہو جائے تو stable part API میں move کریں۔
آگے کہاں جائیں
- public API hub اور debugger کے لیے Developers کھولیں۔
- first safe request بنانے کے لیے Rivya API Quickstart پڑھیں۔
- server پر key رکھنے سے پہلے API Authentication پڑھیں۔
- model IDs choose کرنے سے پہلے API Models پڑھیں۔
- اگر product boundary ابھی unclear ہے، تو When to Use Rivya API Instead of Studio پڑھیں۔
- جب آپ full image، video، audio، یا chat integration plan کر رہے ہوں، تو How to Build a Multimodal AI Workflow with Rivya API پڑھیں۔


