Skip to main content
सभी RAIL API requests API keys से authenticate होती हैं। Keys आपके account से linked होती हैं, आपका credit balance carry करती हैं, और आपके usage logs में दिखती हैं।

API key लेना

2

Dashboard खोलें

अपने Dashboard पर जाएँ और API Keys section में जाएँ।
3

Key generate करें

Generate Key पर click करें। Keys rail_ से शुरू होती हैं और सिर्फ़ एक बार दिखती हैं। तुरंत copy करें।
Dialog बंद करने के बाद key दोबारा नहीं दिखेगी। Page छोड़ने से पहले इसे securely store करें।

API key use करना

हर request पर Authorization header में अपनी key Bearer token के रूप में pass करें:
Full cURL example:

SDK authentication

दोनों SDKs client बनाते समय API key accept करते हैं और automatically header attach कर देते हैं:

Environment variables

Source files में कभी API keys hardcode मत करें। Environment variables use करें और keys को version control से बाहर रखें।

Key management

आप अलग-अलग environments (production, staging, CI) के लिए multiple keys बना सकते हैं। अपने Dashboard से सभी keys manage करें।
Zero-downtime rotation: नई key generate करें, अपनी service में deploy करें और verify करें कि काम कर रही है, फिर पुरानी key revoke करें। Swap में seconds लगते हैं।

Rate limits

Rate limits per API key apply होती हैं। Limit exceed करने पर HTTP 429 return होता है।

Security best practices

  • Client-side code में कभी keys expose मत करें। Browsers public हैं। हमेशा API को अपने backend या serverless function से call करें।
  • Keys को environment variables में store करें, source files या Docker images में कभी hardcode मत करें।
  • पहले commit से पहले .gitignore में .env add करें ताकि keys कभी accidentally push ना हों।
  • हर environment के लिए अलग keys use करें। Staging compromise हो तो भी production safe रहे।
  • Expose होने पर तुरंत revoke करें। पहले replacement generate करें, फिर revoke करें।
  • Schedule पर rotate करें। समय-समय पर keys regenerate करना किसी भी undetected leak का blast radius limit करता है।

Auth error responses

आगे क्या करें

Quickstart

5 मिनट से कम में अपनी पहली evaluation request करें।

Credits & Pricing

समझें कि per call credits कैसे charge होते हैं।

API Reference

सभी endpoints का full parameter reference।

Dashboard

Keys manage करें, usage देखें, और credit balance monitor करें।