Skip to main content
All CAMB.AI API requests require authentication using an API key. This guide explains how to obtain and use your API key.

Getting Your API Key

  1. Go to CAMB.AI Studio
  2. Sign in or create an account
  3. Navigate to your account settings
  4. Generate or copy your API key
Keep your API key secure. Never expose it in client-side code or public repositories.

Using Your API Key

Include your API key in the x-api-key header of every request.

Header Format

x-api-key: your_camb_api_key

Example Request

curl -X POST "https://client.camb.ai/apis/tts-stream" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello world!",
    "voice_id": 147320
  }'

SDK Authentication

When using the official SDKs, pass your API key during client initialization.
from camb.client import CambAI

client = CambAI(api_key="your_api_key")
# Or use environment variable
client = CambAI(api_key=os.getenv("CAMB_API_KEY"))

Error Responses

Status CodeMeaning
401Invalid or missing API key
403API key doesn’t have permission for this resource
429Rate limit exceeded

Example Error Response

{
  "error": "Invalid API key",
  "status": 401
}

Best Practices

Use environment variables or secure secret management systems.
Generate new API keys regularly and revoke old ones.
Create different API keys for development, staging, and production.
Check your API usage in CAMB.AI Studio to detect unauthorized access.

Next Steps