Skip to main content

API Keys

All API requests require authentication using a Bearer token.

Getting your API key

  1. Sign in at classer.ai
  2. Go to API Keys
  3. Click “Create API Key”
  4. Copy and store the key securely
API keys are only shown once. If you lose your key, you’ll need to create a new one.

Using your API key

export CLASSER_API_KEY=your-api-key
The SDKs automatically read from this environment variable.

Direct configuration

from classer import ClasserClient

client = ClasserClient(api_key="your-api-key")
result = client.classify(
    source="Hello",
    labels=["greeting", "question"]
)

HTTP header

For direct API calls, include the key in the Authorization header:
curl -X POST https://api.classer.ai/v1/classify \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"source": "Hello", "labels": ["greeting", "question"]}'

Security best practices

Use environment variables or a secrets manager. Add .env to your .gitignore.
Create separate API keys for each environment.
Delete old keys and create new ones regularly.
When creating a key, set an expiration date for added security.

Error responses

StatusDescription
401 UnauthorizedMissing or invalid API key
403 ForbiddenAPI key doesn’t have permission
429 Too Many RequestsRate limit exceeded