All Muxx APIs require authentication using your API key.
API Keys
API keys look like:
muxx_sk_live_xxxxxxxxxxxxxxxxxxxx # Production
muxx_sk_test_xxxxxxxxxxxxxxxxxxxx # Testing
Get your API key from the dashboard under Project Settings → API Keys.
Gateway Authentication
For gateway requests, use the X-Muxx-Api-Key header:
curl https://gateway.muxx.dev/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-Muxx-Api-Key: muxx_sk_live_xxxxxxxxxxxx" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello"}]
}'
Management API Authentication
For management API requests, use Bearer token authentication:
curl https://api.muxx.dev/v1/logs \
-H "Authorization: Bearer muxx_sk_live_xxxxxxxxxxxx"
SDK Authentication
Environment Variable
export MUXX_API_KEY="muxx_sk_live_xxxxxxxxxxxx"
from muxx import Muxx
muxx = Muxx() # Reads MUXX_API_KEY automatically
Direct Initialization
from muxx import Muxx
muxx = Muxx(api_key="muxx_sk_live_xxxxxxxxxxxx")
Security Best Practices
Never commit API keys to version control or expose them in client-side code.
- Store keys in environment variables
- Use secret management tools in production
- Rotate keys periodically
- Use test keys for development