Rivya AI दस्तावेज़

API Credits

समझें कि Rivya API calls account credits, balance checks, reserved credits, failed task refunds और credit troubleshooting कैसे इस्तेमाल करती हैं।

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

Rivya API वही account credit wallet इस्तेमाल करता है जो Studio इस्तेमाल करता है।

API key के account का मौजूदा balance पढ़ने के लिए GET /api/v1/credits इस्तेमाल करें।

Endpoint

GET https://rivya.ai/api/v1/credits

जरूरी header:

Authorization: Bearer rvya_sk_...

Response

{
  "current_credits": 123
}

Generation Billing

जब आप generation submit करते हैं, Rivya check करता है कि account में पर्याप्त credits हैं या नहीं।

Image, video और audio jobs के लिए credits आम तौर पर task start पर reserve या consume किए जाते हैं। Generation response में शामिल होता है:

  • reserved_credits
  • final_credits

जब job अभी queue में हो या processing हो रही हो, तब final_credits 0 रह सकता है।

Failed Jobs

अगर कोई task Rivya के existing failure rules के तहत fail होता है, तो refund handling Studio जैसी ही product policy follow करती है।

Final status confirm करने के लिए Generation Status और product-level failure model के लिए Failed Tasks and Credit Refunds इस्तेमाल करें।

Common Credit Errors

  • insufficient_credits: account के पास पर्याप्त credits नहीं हैं
  • api_key_invalid: API key किसी account को identify नहीं कर सकती
  • public_api_disabled: public API temporarily disabled है

विषय-सूची