
























@@ -393,6 +393,134 @@ Legacy `plugins.entries.openai.config.personality` is still read as a compatibil
393393</Accordion>
394394</AccordionGroup>
395395396+## Azure OpenAI endpoints
397+398+The bundled `openai` provider can target an Azure OpenAI resource for image
399+generation by overriding the base URL. On the image-generation path, OpenClaw
400+detects Azure hostnames on `models.providers.openai.baseUrl` and switches to
401+Azure's request shape automatically.
402+403+<Note>
404+Realtime voice uses a separate configuration path
405+(`plugins.entries.voice-call.config.realtime.providers.openai.azureEndpoint`)
406+and is not affected by `models.providers.openai.baseUrl`. See the **Realtime
407+voice** accordion under [Voice and speech](#voice-and-speech) for its Azure
408+settings.
409+</Note>
410+411+Use Azure OpenAI when:
412+413+- You already have an Azure OpenAI subscription, quota, or enterprise agreement
414+- You need regional data residency or compliance controls Azure provides
415+- You want to keep traffic inside an existing Azure tenancy
416+417+### Configuration
418+419+For Azure image generation through the bundled `openai` provider, point
420+`models.providers.openai.baseUrl` at your Azure resource and set `apiKey` to
421+the Azure OpenAI key (not an OpenAI Platform key):
422+423+```json5
424+{
425+ models: {
426+ providers: {
427+ openai: {
428+ baseUrl: "https://<your-resource>.openai.azure.com",
429+ apiKey: "<azure-openai-api-key>",
430+ },
431+ },
432+ },
433+}
434+```
435+436+OpenClaw recognizes these Azure host suffixes for the Azure image-generation
437+route:
438+439+- `*.openai.azure.com`
440+- `*.services.ai.azure.com`
441+- `*.cognitiveservices.azure.com`
442+443+For image-generation requests on a recognized Azure host, OpenClaw:
444+445+- Sends the `api-key` header instead of `Authorization: Bearer`
446+- Uses deployment-scoped paths (`/openai/deployments/{deployment}/...`)
447+- Appends `?api-version=...` to each request
448+449+Other base URLs (public OpenAI, OpenAI-compatible proxies) keep the standard
450+OpenAI image request shape.
451+452+<Note>
453+Azure routing for the `openai` provider's image-generation path requires
454+OpenClaw 2026.4.22 or later. Earlier versions treat any custom
455+`openai.baseUrl` like the public OpenAI endpoint and will fail against Azure
456+image deployments.
457+</Note>
458+459+### API version
460+461+Set `AZURE_OPENAI_API_VERSION` to pin a specific Azure preview or GA version
462+for the Azure image-generation path:
463+464+```bash
465+export AZURE_OPENAI_API_VERSION="2024-12-01-preview"
466+```
467+468+The default is `2024-12-01-preview` when the variable is unset.
469+470+### Model names are deployment names
471+472+Azure OpenAI binds models to deployments. For Azure image-generation requests
473+routed through the bundled `openai` provider, the `model` field in OpenClaw
474+must be the **Azure deployment name** you configured in the Azure portal, not
475+the public OpenAI model id.
476+477+If you create a deployment called `gpt-image-2-prod` that serves `gpt-image-2`:
478+479+```
480+/tool image_generate model=openai/gpt-image-2-prod prompt="A clean poster" size=1024x1024 count=1
481+```
482+483+The same deployment-name rule applies to image-generation calls routed through
484+the bundled `openai` provider.
485+486+### Regional availability
487+488+Azure image generation is currently available only in a subset of regions
489+(for example `eastus2`, `swedencentral`, `polandcentral`, `westus3`,
490+`uaenorth`). Check Microsoft's current region list before creating a
491+deployment, and confirm the specific model is offered in your region.
492+493+### Parameter differences
494+495+Azure OpenAI and public OpenAI do not always accept the same image parameters.
496+Azure may reject options that public OpenAI allows (for example certain
497+`background` values on `gpt-image-2`) or expose them only on specific model
498+versions. These differences come from Azure and the underlying model, not
499+OpenClaw. If an Azure request fails with a validation error, check the
500+parameter set supported by your specific deployment and API version in the
501+Azure portal.
502+503+<Note>
504+Azure OpenAI uses native transport and compat behavior but does not receive
505+OpenClaw's hidden attribution headers. See the **Native vs OpenAI-compatible
506+routes** accordion under [Advanced configuration](#advanced-configuration)
507+for details.
508+</Note>
509+510+<Tip>
511+For a separate Azure OpenAI Responses provider (distinct from the `openai`
512+provider), see the `azure-openai-responses/*` model refs in the
513+[Server-side compaction](#server-side-compaction-responses-api) accordion.
514+</Tip>
515+516+<Note>
517+Azure chat and Responses traffic need Azure-specific provider/API config in
518+addition to a base URL override. If you want Azure model calls beyond image
519+generation, use the onboarding flow or a provider config that sets the
520+appropriate Azure API/auth shape rather than assuming `openai.baseUrl` alone
521+is enough.
522+</Note>
523+396524## Advanced configuration
397525398526<AccordionGroup>
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。