Authentication
All Assisters API requests require authentication using an API key. This guide covers how to create, use, and manage your API keys securely.API Keys
API keys are the primary method for authenticating with Assisters API. Each key:- Starts with the prefix
ask_ - Is tied to your account for billing
- Can be restricted to specific domains (optional)
- Can be revoked at any time
Creating an API Key
Open the Dashboard
Navigate to assisters.dev/dashboard/api-keys
Set Domain Restrictions (Optional)
Add allowed domains if you want to restrict where the key can be used
Using Your API Key
Include your API key in theAuthorization header with the Bearer prefix:
API Key Limits
Each account can have up to 10 active API keys. The first key created is automatically marked as the primary key.| Feature | Limit |
|---|---|
| Keys per account | 10 |
| Key prefix | ask_ |
| Domain restrictions | Unlimited |
| Revocation | Instant |
Domain Restrictions
You can restrict API keys to specific domains for additional security. This is useful for client-side applications where the key might be exposed.Domain restrictions are optional. If no domains are specified, the key works from any origin.
Security Best Practices
Use Environment Variables
Never hardcode API keys in your source code. Use environment variables instead.
Rotate Keys Regularly
Create new keys and revoke old ones periodically to limit exposure.
Use Separate Keys
Use different keys for development, staging, and production environments.
Monitor Usage
Check your dashboard regularly for unexpected usage patterns.
Environment Variables
Store your API key in environment variables:Git Ignore
Always add your.env file to .gitignore:
Managing API Keys
View All Keys
In your dashboard, you can see all your API keys with:- Name and creation date
- Key prefix (first 12 characters)
- Primary key status
- Domain restrictions
- Last used timestamp
Revoke a Key
To revoke a key:- Go to your API Keys dashboard
- Find the key you want to revoke
- Click the Revoke button
- Confirm the revocation
Set Primary Key
The primary key is used for embed widgets. To change your primary key:- Go to your API Keys dashboard
- Find the key you want to make primary
- Click Set as Primary
Rate Limits by Tier
Your API key inherits rate limits from your subscription tier:| Tier | Requests/Minute | Tokens/Minute |
|---|---|---|
| Free | 10 RPM | 100K TPM |
| Developer | 100 RPM | 1M TPM |
| Startup | 500 RPM | 5M TPM |
| Enterprise | Custom | Custom |
Error Responses
401 Unauthorized
- API key is missing or malformed
- API key has been revoked
- API key doesn’t start with
ask_
403 Forbidden
- Request came from a domain not in the allowed list
- Domain restrictions are blocking the request