You need an API key (also called a token) to call any model through RuAPI. Keys start withDocumentation Index
Fetch the complete documentation index at: https://docs.ruapi.ai/llms.txt
Use this file to discover all available pages before exploring further.
sk-....
Creating a key
Create a new token
Click Create token. Fill in:
- Name: for your reference, e.g.
local-dev,production-bot. - Expiry: leave “Never” or set a specific date.
- Spend limit (optional): cap on how much this key can draw from your overall balance.
- Model access (optional): restrict the key to specific models.
Using the key
Pass the key in theAuthorization: Bearer sk-... header on every request:
api_key or apiKey — see API Reference.
Security best practices
❌ Don't commit to Git
Never put
sk-... in commits. Repos — especially public — get scraped by bots in minutes.✅ Use environment variables
Store the key in
.env or system env. Read it with os.getenv("OPENAI_API_KEY").❌ Don't expose to frontend
The API key belongs only on the backend. If the browser calls RuAPI directly, anyone opening DevTools sees the key.
✅ One key per project
Don’t share a single key across projects. If one leaks, the others stay safe — only revoke the bad one.
Revoking and rotating
If a key leaks (committed to Git, posted in chat, in a screenshot):Revoke immediately
In Tokens, find the bad key → Disable or Delete. All subsequent requests with it return
401 Unauthorized.Create a replacement
Generate a new key with the same limits and update your application’s environment.
Spend limits
When creating a key you can set “max X USD from overall balance”. Useful for:- Prod/staging split: production key with no limit, staging with $10 limit.
- Delegation: give a contractor a key with a $50 cap for one feature.
- Bug protection: a runaway script can’t drain everything — it hits the cap.
Multiple keys
You can have any number of active keys at once. A typical layout:| Key | Purpose | Expiry | Limit |
|---|---|---|---|
prod-app | Production | never | none |
staging | Staging | never | $10 |
local-dev | Local development | 30 days | $5 |
experiment-X | Experimental project X | 7 days | $1 |
Account compromise
If your RuAPI account is compromised (someone got your password):- Change your password immediately (if you still have access).
- If you’ve lost access — email support@ruapi.ai from the email on file with your description of the situation.
- After regaining access: revoke all API keys and create new ones.