Rivya AI Docs

Rivya API Overview

Use Rivya API v1 to call Rivya generation and chat models from your own product with API keys, account credits, and optional SSE streaming.

Last reviewed on 2026/08/29

Rivya API v1 is the developer contract for calling supported Rivya model capabilities from your own product when Public API access is enabled for the deployment and available to your account.

The implemented contract covers asynchronous image, video, and audio generation plus Chat API turns with non-streaming or SSE streaming responses. It uses Rivya model IDs, Rivya account credits, public task IDs for generation, and server-side chat sessions for Chat API. A documented route is not a promise that every environment, account, or catalog model can call it; confirm live access and model readiness before integration.

What The API Is For

Use the API when you want to:

  • submit image, video, or audio generation jobs from your own app

  • send non-streaming or streaming chat turns and continue API-created chat sessions

  • keep billing inside the same Rivya account credit wallet

  • poll task status by public task ID

  • use idempotent retries for safer production requests

  • keep Studio and API usage under the same account boundary

The API is a Rivya product layer. Public responses use Rivya names and public fields only.

Current Version Scope

Implemented v1 endpoints include:

  • 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

The current contract includes signed webhooks for asynchronous generation results, Chat API, and a TypeScript SDK beta with server-side streaming support. Webhook calls require the webhook feature and Public API access to be enabled for the deployment.

Authentication

Generation, status, and credit endpoints require:

Authorization: Bearer rvya_sk_...

Create and rotate keys from API Keys settings. Read API Authentication before using a key in production.

Billing Model

API calls use the same Rivya account credits as Studio.

Generation jobs reserve or consume credits when the task starts. Chat turns reserve credits before the model call and settle final credits from token usage when the assistant message is saved. If a generation or chat turn fails under the existing Rivya failure rules, the same refund handling applies.

Read API Credits and Credits & Billing in Rivya for the user-facing wallet model.

First Integration Path

  1. Create an API key in Settings.

  2. Call List API Models to choose a public model ID.

  3. Read Model API Reference for the model's parameters.

  4. If the model needs reference media, upload it with Files API.

  5. Submit a job with Create Generation.

  6. Poll Generation Status until the task succeeds or fails. If webhooks are enabled for the deployment and account, you can instead subscribe through API Webhooks for signed completion events.

  7. For chat models, use Chat API instead of the generation endpoint. Chat image attachments must reference Files API file_id values.