Rivya AI दस्तावेज़

Rivya API Overview

API keys, account credits और optional SSE streaming के साथ अपने product से Rivya generation और chat models call करने के लिए Rivya API v1 इस्तेमाल करें.

अंतिम समीक्षा 2026/05/11 को

Rivya API v1 आपके अपने product से Rivya model capabilities call करने का developer entry point है।

Public API asynchronous image, video और audio generation के साथ non-streaming या SSE streaming responses वाले Chat API turns support करता है। यह 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 भेजना और API-created chat sessions continue करना चाहते हैं
  • billing को उसी Rivya account credit wallet में रखना चाहते हैं
  • public task ID से task status poll करना चाहते हैं
  • safer production requests के लिए idempotent retries इस्तेमाल करना चाहते हैं
  • Studio और API usage को उसी account boundary के अंदर रखना चाहते हैं

API एक Rivya product layer है। Public responses केवल Rivya names और public fields इस्तेमाल करते हैं।

Current Version Scope

Current v1 endpoints:

  • GET /api/v1/models
  • POST /api/v1/generations
  • POST /api/v1/files
  • GET /api/v1/files/{fileId}
  • POST /api/v1/chat/completions
  • GET /api/v1/chat/sessions
  • GET /api/v1/chat/sessions/{sessionId}
  • GET /api/v1/generations/{taskId}
  • GET /api/v1/credits
  • GET /api/v1/webhooks
  • POST /api/v1/webhooks
  • GET /api/v1/webhook-events
  • GET /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 को यह चाहिए:

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

  1. Settings में API key create करें।
  2. Public model ID चुनने के लिए List API Models call करें।
  3. Model के parameters के लिए Model API Reference पढ़ें।
  4. अगर model को reference media चाहिए, तो Files API से upload करें।
  5. Create Generation से job submit करें।
  6. Task succeed या fail होने तक Generation Status poll करें, या signed completion events के लिए API Webhooks subscribe करें।
  7. Chat models के लिए generation endpoint के बजाय Chat API इस्तेमाल करें। Chat image attachments को Files API file_id values reference करनी चाहिए।

संबंधित पेज

विषय-सूची