Skip to main content
Every inference request requires a Prism API key. Use the PRISM_API_KEY environment variable in local examples and a secret manager in deployed applications.

Bearer authentication

Bearer authentication works with every endpoint:

Anthropic authentication

Anthropic clients send the key in x-api-key. The Messages endpoints accept this header:
Bearer authentication is also accepted on the Messages endpoints.

Base URLs

The Anthropic SDK appends /v1/messages, so its base URL must not end in /v1.

Protect keys

  • Keep keys in server-side environment variables or a managed secret store.
  • Do not put keys in browser code, mobile binaries, logs, or prompts.
  • Use a separate key for each environment or service.
  • Replace a key immediately if it is exposed.
  • Return your own short-lived session credential to untrusted clients instead of proxying a Prism key to them.
Requests with a missing, invalid, or revoked key return 401.
Last modified on September 9, 2026