openclaw - 💡(How to fix) Fix [Bug]: azure-openai-responses provider fails with 400 'API version not supported' for gpt-5.5

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

This causes ALL azure-openai-responses/gpt-5.5 calls to fail immediately, including fallback chains where Azure is listed as a fallback. The error is: [responses] error provider=azure-openai-responses api=azure-openai-responses model=gpt-5.5 name=Error status=400 code=BadRequest

  • #53506 (API Protocol Error 400 with Azure Reasoning Models)

Root Cause

The resolveAzureOpenAIApiVersion() function in src/agents/openai-transport-stream.ts defaults to "2024-12-01-preview" when AZURE_OPENAI_API_VERSION env var is unset. This predates the Responses API.

Per Microsoft docs: the Azure Responses API v1 GA supports api-version=2025-04-01-preview and newer, or no api-version at all.

Fix Action

Fix

Change the default API version to at least 2025-04-01-preview (the first version that fully supports the Responses API including remote MCP, background tasks, etc.):

- const DEFAULT_AZURE_OPENAI_API_VERSION = "2024-12-01-preview";
+ const DEFAULT_AZURE_OPENAI_API_VERSION = "2025-04-01-preview";

Affected files:

  • src/agents/openai-transport-stream.ts (line ~1174)
  • extensions/openai/image-generation-provider.ts (line ~82)
  • docs/providers/openai.md (documentation reference)

Workaround

Set AZURE_OPENAI_API_VERSION=2025-04-01-preview as an environment variable for the OpenClaw process.

Code Example

src/agents/openai-transport-stream.ts:
  const DEFAULT_AZURE_OPENAI_API_VERSION = "2024-12-01-preview";

---

400 Bad RequestAPI version not supported

---

[responses] error provider=azure-openai-responses api=azure-openai-responses model=gpt-5.5
name=Error status=400 code=BadRequest
message=400 API version not supported
fallbackConfigured: false → chain_exhausted

---

- const DEFAULT_AZURE_OPENAI_API_VERSION = "2024-12-01-preview";
+ const DEFAULT_AZURE_OPENAI_API_VERSION = "2025-04-01-preview";
RAW_BUFFERClick to expand / collapse

Issue: azure-openai-responses provider fails with "400 API version not supported"

Environment

  • OpenClaw: 2026.5.12 (also affects all 2026.4.x+)
  • Model: azure-openai-responses/gpt-5.5
  • Azure OpenAI Responses API v1 GA endpoint

Problem

The azure-openai-responses provider uses a hardcoded default API version of 2024-12-01-preview:

src/agents/openai-transport-stream.ts:
  const DEFAULT_AZURE_OPENAI_API_VERSION = "2024-12-01-preview";

However, the Azure OpenAI Responses API was introduced in 2025-03-01-preview. Sending api-version=2024-12-01-preview to the Responses endpoint results in:

400 Bad Request — API version not supported

This causes ALL azure-openai-responses/gpt-5.5 calls to fail immediately, including fallback chains where Azure is listed as a fallback. The error is:

[responses] error provider=azure-openai-responses api=azure-openai-responses model=gpt-5.5
name=Error status=400 code=BadRequest
message=400 API version not supported
fallbackConfigured: false → chain_exhausted

Root Cause

The resolveAzureOpenAIApiVersion() function in src/agents/openai-transport-stream.ts defaults to "2024-12-01-preview" when AZURE_OPENAI_API_VERSION env var is unset. This predates the Responses API.

Per Microsoft docs: the Azure Responses API v1 GA supports api-version=2025-04-01-preview and newer, or no api-version at all.

Workaround

Set AZURE_OPENAI_API_VERSION=2025-04-01-preview as an environment variable for the OpenClaw process.

Fix

Change the default API version to at least 2025-04-01-preview (the first version that fully supports the Responses API including remote MCP, background tasks, etc.):

- const DEFAULT_AZURE_OPENAI_API_VERSION = "2024-12-01-preview";
+ const DEFAULT_AZURE_OPENAI_API_VERSION = "2025-04-01-preview";

Affected files:

  • src/agents/openai-transport-stream.ts (line ~1174)
  • extensions/openai/image-generation-provider.ts (line ~82)
  • docs/providers/openai.md (documentation reference)

Related Issues

  • #53506 (API Protocol Error 400 with Azure Reasoning Models)
  • #46971 (Azure OpenAI missing api-version query parameter)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING