API Authentication
All Bleu.js API requests require authentication using an API key. This ensures secure access to your account and resources.
Getting Your API Key
- Sign in to your Bleu.js Dashboard
- Navigate to the API Keys section
- Click "Create New API Key"
- Copy your API key and keep it secure
Using Your API Key
Include your API key in the Authorization header of all requests:
Authorization: Bearer YOUR_API_KEY_HERE
Example Request
curl -X POST https://api.bleujs.org/v1/generate \ -H "Authorization: Bearer YOUR_API_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "prompt": "Hello, world!", "max_tokens": 100 }'
Security Best Practices
- Never share your API key publicly
- Use environment variables to store API keys
- Rotate your API keys regularly
- Monitor your API usage in the dashboard
- Use different API keys for different applications
Rate Limits
API requests are subject to rate limits based on your plan. Check your current limits in the dashboard.
Learn more about rate limits →Error Handling
If authentication fails, you'll receive a 401 Unauthorized response. Check that your API key is correct and valid.
View all error codes →