Skip to main content
Azure OpenAI speaks the OpenAI API shape with two GoModel-handled differences: an api-key header instead of Authorization: Bearer, and an api-version query parameter on deployment-scoped URLs.

Configure

Or in config.yaml:

Azure AI Foundry (v1 API)

Azure AI Foundry endpoints such as https://proj1-resource.services.ai.azure.com/openai/v1/responses use the unversioned v1 API. Set the base URL to everything up to /openai/v1:
On a /openai/v1 base URL GoModel sends no api-version by default, and the model in the request body selects the deployment, so one provider covers every deployment in the resource. Leave AZURE_API_VERSION (and api_version in the YAML above) unset; set it to preview only to opt into preview features. Classic https://your-resource.openai.azure.com/openai/v1 URLs work the same way. Realtime sessions use the GA /openai/v1/realtime?model=<deployment> websocket. /openai/v1/models lists the resource’s models, so a deployment named after its model (the Foundry default) routes as-is. For custom deployment names, list them in AZURE_MODELS and set AZURE_MODELS_MODE=merge so the listed models stay alongside the discovered ones (see Models modes).

Run GoModel

Verify

GET /v1/models returns the deployments the Azure resource exposes with owned_by: "azure". Streaming, Responses, embeddings, and batches all work the same way; batches route through the /openai/batches resource path (/openai/v1/batches on v1 base URLs).

Decision models

Foundry serves two kinds of decision model, and GoModel answers POST /v1/decisions for both, whichever AZURE_BASE_URL form you use: GoModel picks the API by deployment: one its model catalog describes as a chat model, such as gpt-6-luna, goes to the Decisions API, and any other goes to System One. Name the gpt-6-luna deployment gpt-6-luna. Azure rejects deployment names containing Microsoft, so name the Microsoft-Decision-1 deployment, for example, ms-decision-1, and list it so GoModel can route it:
Microsoft-Decision-1 reads text and JSON only: /v1/decisions refuses images for it, while /v1/systemone forwards them and returns Foundry’s response, including any error. gpt-6-luna’s Decisions API is not available in East US 2. New subscriptions start with no quota for either model, so request quota before deploying.

Multiple deployments

Each Azure deployment is its own endpoint. Register them as separate providers with suffixed env vars:
This registers azure-gpt5 and azure-embed. To expose every deployment under one resource through a single provider, use a v1 base URL instead.

Notes

  • GoModel accepts the deployment-scoped URL the portal hands you. For account-wide operations (model listing, batches) GoModel strips the /openai/deployments/<deployment> suffix automatically, so one AZURE_BASE_URL covers both chat and resource-level calls.
  • AZURE_API_VERSION defaults to 2024-10-21 on deployment-scoped URLs and to none on v1 URLs. Set it only when you need a different stable or preview version — for example a newer Responses API surface.

Troubleshooting

  • 401 Unauthorized / 403 — AZURE_API_KEY does not match the resource hosting the deployment, or the deployment name in the URL is wrong.
  • Resource not found / DeploymentNotFound — the model in the request body must be the deployment name, not the underlying base model.
  • unsupported api version — bump AZURE_API_VERSION to a version the feature you’re calling supports. Newer Responses API features require recent preview versions. On v1 base URLs, leave it unset or use preview.
  • 404 on Azure AI Foundry — the base URL must end at /openai/v1, not at the full endpoint (/openai/v1/responses) or the project URL (/api/projects/...).

References

Last modified on November 8, 2026