Skip to main content
Two ways in: point the Anthropic client at the proxy, or call init() and keep the client as it is (auto-instrumentation patches the anthropic package in Python and @anthropic-ai/sdk in Node).

Proxy

Proxy Base URL: https://api.promptguard.co/api/v1Point your LLM SDK’s base_url / baseURL to this endpoint. Your existing provider API key goes in the Authorization header as usual; add your PromptGuard key via X-API-Key.
The proxy serves Anthropic’s Messages API at /messages and its token counter at /messages/count_tokens, so the official Anthropic SDK works unchanged. Every model id starting claude- goes to Anthropic. The Anthropic SDK adds /v1 to its base URL itself, so its base URL is https://api.promptguard.co/api, one segment shorter than the proxy URL above.
The Anthropic SDK sends its own credential in X-Api-Key, the header PromptGuard reads its key from, and current SDKs (anthropic 2.x, @anthropic-ai/sdk 1.x) refuse api_key and auth_token together. So set both headers yourself in default_headers: your PromptGuard key as X-API-Key, and your Anthropic key as Authorization: Bearer. PromptGuard forwards the bearer token to Anthropic in the x-api-key header Anthropic expects. Headers set this way win over an ANTHROPIC_API_KEY in the environment.
To keep the Anthropic key out of your application, store it as a provider key under anthropic and drop the Authorization header. PromptGuard then sends the stored key. The anthropic-version and anthropic-beta headers your SDK sends are forwarded as sent. Only when you send no anthropic-version does PromptGuard add 2023-06-01.
Claude model ids are accepted on /chat/completions too, but the reply comes back in Anthropic’s Messages shape (content, stop_reason), not OpenAI’s (choices). An OpenAI client cannot read it, so use the Anthropic SDK or the /messages route.

Auto-instrumentation

Claude on AWS Bedrock

Claude models served by Bedrock are Bedrock traffic: see AWS Bedrock.

Next steps

Amazon Bedrock

Bedrock Runtime calls with boto3 or the AWS SDK

Provider keys

Store your provider credentials once, forwarded server-side

Auto-instrumentation

Which provider calls init() patches, and which it does not
Last modified on October 31, 2026