Skip to main content

Create Your First Key


Using Your API Key

export AUDIOPOD_API_KEY="ap_your_key_here"

SDK Usage

from audiopod import AudioPod

# Auto-reads from AUDIOPOD_API_KEY env var
client = AudioPod()

# Or pass explicitly
client = AudioPod(api_key="ap_your_key_here")

Manage Keys via API

# List all keys
curl -s "https://api.audiopod.ai/api/v1/auth/api-keys" \
  -H "X-API-Key: $AUDIOPOD_API_KEY" | jq .

# Create new key
curl -X POST "https://api.audiopod.ai/api/v1/auth/api-keys" \
  -H "X-API-Key: $AUDIOPOD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "staging-key",
    "scopes": ["*"],
    "expires_in_days": 90
  }'

# Revoke a key
curl -X DELETE "https://api.audiopod.ai/api/v1/auth/api-keys/KEY_ID" \
  -H "X-API-Key: $AUDIOPOD_API_KEY"

Best Practices

# Development
AUDIOPOD_API_KEY_DEV=ap_dev_...

# Production
AUDIOPOD_API_KEY_PROD=ap_prod_...
API keys should only be used server-side. Create a backend proxy if you need client-side access.
Create a new key → Update your apps → Revoke the old key.
curl -X POST "https://api.audiopod.ai/api/v1/auth/api-keys" \
  -H "X-API-Key: $AUDIOPOD_API_KEY" \
  -d '{"name": "temp-key", "expires_in_days": 7}'

Troubleshooting

ErrorCauseFix
401 UnauthorizedInvalid or missing keyCheck X-API-Key header
403 ForbiddenKey revoked or expiredCreate a new key
Test your key:
curl -s "https://api.audiopod.ai/api/v1/api-wallet/balance" \
  -H "X-API-Key: $AUDIOPOD_API_KEY" | jq .balance_usd

Next Steps