Authentication
The INFER API uses API keys for authentication. Each key is tied to your account and has its own rate limits and usage tracking.
Creating an API Key
- Sign in to your INFER Dashboard
- Navigate to API Keys
- Click Create New Key
- Name your key and copy it immediately
API keys are prefixed with sk-infer- and are shown only once at creation time.
Using Your API Key
Include the key in the Authorization header of every request:
curl -X POST https://inferexchange.com/api/v1/chat/completions \
-H "Authorization: Bearer sk-infer-YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{"model": "llama-3.1-8b", "messages": [{"role": "user", "content": "Hello"}]}'Key Management
- Rotation: Generate a new key and delete the old one from the Dashboard
- Multiple keys: Create separate keys for different environments (dev, staging, prod)
- Revocation: Delete any key instantly from the API Keys page
Security Best Practices
- Never expose API keys in client-side code or version control
- Use environment variables to store keys
- Rotate keys periodically
- Use separate keys per environment
- Monitor usage for unexpected patterns in the Dashboard