Skip to main content

Authentication

All API requests require authentication with an API key.

Getting Your API Key

  1. Sign up at scalellm.dev/signup
  2. Go to your dashboard
  3. Create a new API key
  4. Copy the key (starts with sk_)
Store your API key securely. Don’t commit it to version control or share it publicly.

Using Your API Key

Include the key in the Authorization header:
curl https://api.scalellm.dev/v1/chat/completions \
  -H "Authorization: Bearer sk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"model": "claude-sonnet-4.5", "messages": [{"role": "user", "content": "Hi"}]}'

Environment Variables

Store your key in an environment variable:
export SCALELLM_API_KEY="sk_your_key"
Then use it in code:
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.scalellm.dev/v1",
    api_key=os.environ["SCALELLM_API_KEY"]
)

API Key Best Practices

  • Don’t commit keys to version control
  • Use environment variables in production
  • Rotate keys periodically via your dashboard
  • Use separate keys for development and production

Error Responses

StatusMeaning
401Invalid or missing API key
403Key doesn’t have permission
429Rate limit exceeded