API Tokens
How to generate and manage your CaosLabs API tokens
API Tokens
API tokens allow you to securely access all CaosLabs APIs from your code. All API requests require authentication using a Bearer token in the Authorization header.
How to Generate a Token
- Sign up for CaosLabs at caoslabs.com
- Navigate to your profile section at the top right of the dashboard
- In the token section, click "Generate Token"
- Copy the token and save it somewhere safe - this is the only time you'll be able to view it
Using Your Token
Include your token in the Authorization header of all API requests:
bash
curl -X POST "https://api.caoslabs.com/arcfont/embedding" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "file=@your_image.png"
Token Management
Security Best Practices
- Never share your tokens or commit them to version control
- Store tokens securely using environment variables or secure vaults
- Rotate tokens regularly for enhanced security
- Use different tokens for different environments (dev, staging, prod)
Revoking Tokens
You can revoke and create new tokens as needed:
- Go to your profile section
- Find the token you want to revoke
- Click "Revoke Token"
- Generate a new token if needed