Azure OpenAI Integration

Use Noirdoc with Azure OpenAI deployments.

Overview

Noirdoc supports Azure OpenAI deployments alongside standard OpenAI. Requests are pseudonymized before they reach your Azure endpoint, and original values are restored in the response. You can use the OpenAI Python SDK with the Azure-specific configuration or make raw HTTP requests.

Authentication

Azure OpenAI uses the api-key header instead of Authorization: Bearer. Noirdoc detects this header format automatically and routes the request through the Azure provider pipeline.

When you configure an Azure OpenAI provider in the Noirdoc portal, you provide your Azure endpoint URL, deployment name, API version, and Azure API key. These are stored encrypted and used by the proxy when forwarding requests.

Python — Using the OpenAI SDK

The OpenAI Python SDK supports Azure through the AzureOpenAI class. Point it at the Noirdoc proxy instead of your Azure endpoint:

from openai import AzureOpenAI

client = AzureOpenAI(
    azure_endpoint="https://api.noirdoc.de",
    api_key="px-your-noirdoc-key",
    api_version="2025-04-01-preview",
)

response = client.chat.completions.create(
    model="gpt-5.4-mini",  # Your Azure deployment name
    messages=[
        {
            "role": "user",
            "content": "Summarize the contract for Max Mustermann, IBAN DE89370400440532013000.",
        }
    ],
)

print(response.choices[0].message.content)

The api_version parameter is passed through to Azure. Use the same version your deployment supports.

Node.js — Using the OpenAI SDK

import { AzureOpenAI } from "openai";

const client = new AzureOpenAI({
  endpoint: "https://api.noirdoc.de",
  apiKey: "px-your-noirdoc-key",
  apiVersion: "2025-04-01-preview",
});

const response = await client.chat.completions.create({
  model: "gpt-5.4-mini",
  messages: [
    {
      role: "user",
      content: "Draft an email to julia.weber@example.com about the quarterly report.",
    },
  ],
});

console.log(response.choices[0].message.content);

cURL — Azure header format

When making raw HTTP requests to Azure through Noirdoc, use the api-key header:

curl https://api.noirdoc.de/v1/chat/completions?api-version=2025-04-01-preview \
  -H "api-key: px-your-noirdoc-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.4-mini",
    "messages": [
      {"role": "user", "content": "Summarize the contract for Anna Schmidt."}
    ]
  }'

Noirdoc detects the api-key header and routes the request through the Azure provider pipeline.

Streaming

Streaming works the same as with standard OpenAI. See the Streaming page for SDK examples and SSE details.

API version compatibility

Noirdoc passes the api_version parameter through to Azure unchanged. Use the API version that matches your Azure deployment. Common values include 2025-01-01-preview, 2025-03-01-preview, and 2025-04-01-preview. Check the Azure OpenAI documentation for supported versions.

Deployment considerations

Your Azure resource URL, deployment name, API key, and API version are all configured in the Noirdoc portal. The proxy maps the incoming request to the correct Azure endpoint based on your provider configuration. This means you can switch between Azure regions or deployments without changing your application code — just update the settings in the portal.