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 api_key in the X-API-Key header, which is the header PromptGuard reads its own key from. So give the SDK your PromptGuard key as api_key, and your Anthropic key as auth_token, which the SDK sends as Authorization: Bearer. PromptGuard forwards that to Anthropic in the x-api-key header Anthropic expects.
To keep the Anthropic key out of your application, store it as a provider key under anthropic and drop auth_token. 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.