Rivya AI दस्तावेज़

जनरेशन स्थिति

सार्वजनिक task ID से Rivya API जनरेशन जॉब poll करें, queued, processing, succeeded और failed स्थितियां पढ़ें, और result URL इस्तेमाल करें.

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

किसी असिंक्रोनस generation job को जांचने के लिए GET /api/v1/generations/{taskId} इस्तेमाल करें।

Endpoint

GET https://rivya.ai/api/v1/generations/{taskId}

जरूरी header:

Authorization: Bearer rvya_sk_...

curl उदाहरण

curl https://rivya.ai/api/v1/generations/task_public_id \
  -H "Authorization: Bearer rvya_sk_..."

स्थिति मान

सार्वजनिक status values:

  • queued: task स्वीकार हो गया है, अभी पूरा नहीं हुआ
  • processing: generation चल रही है
  • succeeded: result उपलब्ध है
  • failed: task विफल हुआ और इसमें सार्वजनिक error object शामिल हो सकता है

सफल Response

{
  "id": "task_public_id",
  "status": "succeeded",
  "model": "z-image",
  "reserved_credits": 1,
  "final_credits": 1,
  "created_at": "2026-05-10T00:00:00.000Z",
  "updated_at": "2026-05-10T00:01:00.000Z",
  "result": {
    "primary_url": "https://media.example/result.png",
    "urls": ["https://media.example/result.png"]
  },
  "error": null
}

सुविधा के लिए primary_url पहला result URL है। उपलब्ध होने पर urls में सार्वजनिक result URL सूची होती है।

विफल Response

{
  "id": "task_public_id",
  "status": "failed",
  "model": "z-image",
  "reserved_credits": 1,
  "final_credits": 0,
  "created_at": "2026-05-10T00:00:00.000Z",
  "updated_at": "2026-05-10T00:01:00.000Z",
  "result": null,
  "error": {
    "code": "generation_failed",
    "message": "The generation failed."
  }
}

Polling मार्गदर्शन

एक छोटे delay से शुरू करें, फिर polling intervals बढ़ाएं। बहुत tight loops से बचें।

अनुशंसित pattern:

  • सबमिशन के 2-3 सेकंड बाद प्रतीक्षा करें
  • सामान्य jobs के लिए हर 5-10 सेकंड में poll करें
  • लंबे video और audio jobs के लिए गति धीमी करें
  • status succeeded या failed होने पर polling बंद करें

स्वामित्व सीमा

task उसी Rivya account का होना चाहिए जिसके पीछे API key है। अगर task नहीं मिलता या account के स्वामित्व में नहीं है, तो endpoint not_found लौटाता है।

संबंधित पेज

विषय-सूची