Manage Custom API Tokens
Learn how to create, manage, and organize custom API tokens for your Eden AI account.Note: These are admin/dashboard endpoints typically used by the Eden AI dashboard or custom admin interfaces. For standard API authentication, see the Authentication Guide.
Overview
Custom tokens allow you to create additional API keys beyond your main account token. Use cases include:- Environment Separation - Different tokens for development, staging, and production
- Team Access - Separate tokens for different team members or projects
- Budget Control - Set credit limits per token to control spending
- Security - Rotate or revoke tokens without affecting other integrations
- Tracking - Monitor usage and costs per token for better analytics
Endpoints
| Endpoint | Method | Description |
|---|---|---|
/v2/user/custom_token/ | GET | List all custom tokens |
/v2/user/custom_token/ | POST | Create a new token |
/v2/user/custom_token/{name}/ | GET | Retrieve a specific token |
/v2/user/custom_token/{name}/ | PATCH | Update token settings |
/v2/user/custom_token/{name}/ | DELETE | Delete a token |
Token Types
Eden AI supports two types of custom tokens:| Type | Description | Use Case |
|---|---|---|
api_token | Production token with full access | Live applications, production environments |
sandbox_api_token | Test token without real provider calls | Development, testing, demos |
Creating Tokens
Create a Basic Token
Create a new custom token with just a name: Response:Create a Token with Credit Limit
Create a token with a spending limit: How Balance Works:- When
active_balanceistrue, the token has a spending limit - Each API call deducts from the balance
- When balance reaches $0, the token becomes unusable
- Perfect for controlling costs per project or team
Create a Sandbox Token
Create a token for testing without real API calls: Sandbox Benefits:- No real provider API calls
- No costs incurred
- Returns mock data for testing
- Perfect for development and CI/CD
Create a Token with Expiration
Create a temporary token that expires automatically:Listing Tokens
List All Tokens
Get all your custom tokens: Response:Retrieving a Specific Token
Get details for a single token by name:Updating Tokens
Update Token Balance
Add or adjust credit balance for a token:Update Token Expiration
Extend or set expiration date:Disable Balance Tracking
Remove balance limit from a token:Deleting Tokens
Delete a custom token when no longer needed: Important: Deleting a token immediately revokes access. Any applications using that token will start receiving 401 authentication errors.Best Practices
Token Naming Conventions
Use descriptive, consistent names:Budget Control Strategy
Implement budget controls per token:Token Rotation
Regularly rotate tokens for security:Monitor Token Usage
Track usage and remaining balance:Scope Limitations
Use different tokens for different scopes:Error Handling
400 Bad Request
Invalid token name or parameters:404 Not Found
Token doesn’t exist:403 Forbidden
Insufficient permissions:Next Steps
- Multi-Environment Token Management Tutorial - Complete workflow
- Monitor Usage and Costs - Track spending per token
- Authentication Guide - Use your tokens