Authentication
How to create and use reAPI keys.
Bearer token
Send your API key as a Bearer token on every request:
Authorization: Bearer YOUR_API_KEYThis matches the OpenAI scheme — most OpenAI clients work by changing
base_url and api_key.
Create a key
- Sign in at reapi.ai.
- Go to Dashboard → API Keys.
- Click Create new key, give it a name (e.g.
production-server). - Copy the key. It is shown only once — store it in a secret manager.
You can create as many keys as you like (e.g. one per environment, one per service).
Revoke a key
Revoke compromised keys immediately on the dashboard. Pending tasks created with the key continue to completion (and bill credits), but no new requests can be made.
Key format
Keys have no fixed prefix. Send the full key exactly as it was shown when you created it.
Storing keys
Don't commit keys to git or paste them in chat. Use a secret manager:
- Local dev:
.env.local(in.gitignore) - Vercel: Environment Variables
- AWS / GCP: Secrets Manager / Secret Manager
- Docker: Docker secrets or
--env-file
Errors
| HTTP | code | Cause | Fix |
|---|---|---|---|
| 401 | 10001 | No Authorization header | Add the header |
| 401 | 10002 | Header isn't Bearer <key> | Use Bearer <key> |
| 401 | 10003 | Key invalid / typo | Check the dashboard |
| 401 | 10004 | Key has been revoked | Mint a new key |
| 401 | 10005 | Sign-in required (session-cookie path only) | Use API-key auth, or sign in |
| 403 | 10006 | Origin not in allow-list (browser-only) | Only relevant for session-cookie auth from the browser; API-key requests aren't affected |
| 402 | 30001 | Balance below request cost | Buy credits or wait for monthly refresh |
Full list: Errors.