Skip to content
Batchwork
Esc
navigateopen⌘Jpreview
On this page

Azure OpenAI

Azure OpenAI Batch support in Batchwork for chat, responses, and completion deployments with api-key authentication and OpenAI wire format.

Azure OpenAI speaks the OpenAI wire format through a dedicated adapter. String models use azure/<deployment>; Chat Completions, Responses, and legacy Completions deployments are supported for text batches only.

At a glance

Property Batchwork behavior
Output modalities Text
Text inputs Same as OpenAI text requests
Endpoints Chat Completions, Responses, legacy Completions
Submission JSONL file upload, then /batches
Results Output and error JSONL files
Batch metadata Forwarded
Webhooks Managed polling only
Credential AZURE_API_KEY or AZURE_OPENAI_API_KEY
Resource AZURE_RESOURCE_NAME or AZURE_BASE_URL/base_url

Example

from batchwork import BatchRequest, Batchwork

async with Batchwork() as client:
    job = await client.batch(
        model="azure/gpt-5.6-sol",
        requests=[BatchRequest(custom_id="summary", prompt="Summarize this report.")],
    )

The model segment after azure/ is the deployment name, not a foundation model ID.

Endpoint and credentials

The base URL resolves from an explicit base_url, AZURE_BASE_URL, or AZURE_RESOURCE_NAME (which becomes https://NAME.openai.azure.com/openai/v1). Azure hostnames are normalized: a bare https://r.openai.azure.com, one ending /openai, and one ending /openai/v1 all resolve to https://r.openai.azure.com/openai/v1. Non-Azure gateway hosts are passed through untouched.

Authentication uses an api-key header rather than a bearer token. AZURE_API_KEY is checked before AZURE_OPENAI_API_KEY; a caller-supplied Authorization or api-key header suppresses the environment lookup. Missing resource or key configuration fails with a concrete error before upload.

Request translation

Azure reuses the OpenAI serializer, so request translation, media handling, and provider options behave exactly like OpenAI: provider_options are read under the openai key with the same exact option spellings.

Azure batch creation only accepts /v1/chat/completions for text batches and does not validate line URLs, so Responses and Completions lines keep their per-line /v1/responses or /v1/completions URL while the batch is created against /v1/chat/completions.

Results

Results normalize through the OpenAI-compatible output/error file parser; text, usage, and item errors behave like OpenAI.

Azure does not support embeddings, image generation or editing, moderation, audio transcription or translation, or video generation through Batchwork.

Official references

See Jobs, Results, and Provider overview.

Was this page helpful?