Authentication
Learn how to authenticate your requests to the BrilliantAI API.
API Keys
All requests to BrilliantAI API must be authenticated using API keys. You can obtain your API key from the BrilliantAI Dashboard.
API Key Best Practices
- Keep it Secret: Never share your API key or commit it to version control
- Use Environment Variables: Store your API key in environment variables
- Rotate Regularly: Rotate your API keys periodically for security
- Separate Keys: Use different API keys for development and production
Using Your API Key
HTTP Header
Include your API key in the Authorization
header:
Authorization: Bearer your-api-key
Client Libraries
Node.js
import OpenAI from "openai";
const openai = new OpenAI({
baseURL: "https://api.brilliantai.co",
apiKey: process.env.BRILLIANTAI_API_KEY
});
Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.brilliantai.co",
api_key=os.getenv("BRILLIANTAI_API_KEY")
)
Rate Limits
- 1000 requests per minute
Error Handling
Common authentication errors:
401 Unauthorized
: Invalid API key403 Forbidden
: Valid API key but insufficient permissions429 Too Many Requests
: Rate limit exceeded
Next Steps
- Start with our quickstart guide
- Learn about available models
- Explore API reference