Authentication & Security
Base URL, API key usage, and request limits.
Base URL
All API requests are sent to:
https://api.marswave.ai/openapiFor sandbox/test environment access, contact support@marswave.ai.
API Key
Get an API Key
- Go to API Key settings
- Click Create API Key
- Copy and save the key
Usage
Include the API key in the Authorization header of every request:
curl -X GET "https://api.marswave.ai/openapi/v1/speakers/list" \
-H "Authorization: Bearer $LISTENHUB_API_KEY"const response = await fetch('https://api.marswave.ai/openapi/v1/speakers/list', {
headers: {
'Authorization': `Bearer ${process.env.LISTENHUB_API_KEY}`,
},
});import os
import requests
response = requests.get(
'https://api.marswave.ai/openapi/v1/speakers/list',
headers={'Authorization': f'Bearer {os.environ["LISTENHUB_API_KEY"]}'}
)Set Up Environment Variable
Store your API key as LISTENHUB_API_KEY. All code examples in this documentation use this variable name:
# Add to ~/.zshrc or ~/.bashrc
export LISTENHUB_API_KEY="your_api_key_here"Or create a .env file in your project root (requires a library like dotenv to load):
# .env
LISTENHUB_API_KEY=your_api_key_hereSecurity Best Practices
Your API key is equivalent to account credentials. A leaked key can result in unauthorized credit consumption.
- Always use HTTPS
- Keep API key out of client-side code
- Never commit API key or
.envfiles to Git repositories - Store API key in environment variables
Rate Limits
| Limit | Value | Description |
|---|---|---|
| Creation request rate | 3 RPM | Up to 3 creation requests per minute |
| Exceeded limit error | 29998 | Implement a backoff retry strategy |
Read-only requests (such as querying episode status or listing speakers) are not subject to this limit.
Next Steps
- Quick Start — Make your first call in 5 minutes
- Core Concepts — Learn about generation modes and data flow
- Error Handling — Error code reference and troubleshooting