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.azure/ namespace, and your Azure OpenAI resource in the X-Azure-Resource header. PromptGuard builds the Azure URL from the two, https://<resource>.openai.azure.com/openai/deployments/<deployment>/chat/completions, and sends your key as the api-key header Azure expects. A request in the azure/ namespace without X-Azure-Resource is refused with a 400 whose error code is missing_header, and nothing is sent to Azure.
Use the plain OpenAI client, not AzureOpenAI: the Azure client builds the deployment URL itself, and PromptGuard needs the request on its own route to do that for you.
azure/ namespace is matched without regard to case. PromptGuard calls Azure with api-version=2024-02-15-preview.
To keep the Azure key out of your application, store it as a provider key under azure_openai. You still send X-Azure-Resource on each request.
Auto-instrumentation
The Python and Nodeopenai patches cover AzureOpenAI as well, because it shares the OpenAI client’s chat completions resource. See auto-instrumentation.