Authentication
Learn how to authenticate your requests to the TalonAI API.
Getting Your API Key
- Sign up or log in at portal.talonai.io
- Navigate to Settings → API Keys
- Click Create New Key
- Give your key a descriptive name
- Copy the key - it won't be shown again
Using Your API Key
Environment Variable (Recommended)
# .env
TALONAI_API_KEY=your-api-key-hereJavaScript/TypeScript
import { TalonAI } from '@talonai/sdk';
// Automatically uses TALONAI_API_KEY env variable
const talon = new TalonAI();
// Or explicitly pass the key
const talon = new TalonAI({
apiKey: process.env.TALONAI_API_KEY,
});Python
from talonai import TalonAI
# Automatically uses TALONAI_API_KEY env variable
talon = TalonAI()
# Or explicitly pass the key
talon = TalonAI(api_key="your-api-key-here")REST API
curl https://api.talonai.io/v1/analyze \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content": "Hello world"}'Security Best Practices
- Never commit API keys to version control
- Use environment variables for all environments
- Rotate keys regularly
- Use separate keys for development and production
- Set appropriate rate limits for each key
Keep Your Key Secret
Your API key grants access to your TalonAI account. Never share it publicly or include it in client-side code.