Skip to content

Authentication

Pixapi uses API keys with standard Bearer authentication.

http
Authorization: Bearer $PIXAPI_KEY

Create a key

  1. Sign in to the Pixapi dashboard.
  2. Open Settings -> API Keys.
  3. Create a key and copy it immediately.
  4. Store it in your server environment.
bash
export PIXAPI_KEY="sk_..."

Send the header

bash
curl https://api.pixapi.ai/v1/models \
  -H "Authorization: Bearer $PIXAPI_KEY"

Key safety

  • Never put a Pixapi key in client-side JavaScript.
  • Rotate keys from API Keys when a teammate leaves or a deployment secret is exposed.
  • Use separate API keys for development, staging, and production.
  • Add your own per-user limits before forwarding requests from your app to Pixapi.

Invalid credentials

Invalid or missing credentials return 401 Unauthorized.

json
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid API key."
  }
}