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 inx-api-key. The Messages endpoints accept
this header:
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.
401.