openclaw - 💡(How to fix) Fix [Bug]: Azure gpt-image-2 deployment works in SDK/UI but OpenClaw image_generate returns model does not exist [2 comments, 2 participants]

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…
GitHub stats
openclaw/openclaw#71526Fetched 2026-04-26 05:11:54
View on GitHub
Comments
2
Participants
2
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
commented ×2closed ×1cross-referenced ×1

Error Message

"error": {

Code Example

{
  "models": {
    "providers": {
      "openai": {
        "baseUrl": "https://UDTAzureOpenAI.openai.azure.com/openai/v1",
        "apiKey": "${AZURE_OPENAI_API_KEY}",
        "models": [
          { "id": "gpt-image-2-1", "name": "gpt-image-2-1" }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "imageGenerationModel": {
        "primary": "openai/gpt-image-2-1",
        "fallbacks": []
      }
    }
  }
}

---

AZURE_OPENAI_API_KEY=<set>
AZURE_OPENAI_API_VERSION=2024-12-01-preview

---

model=openai/gpt-image-2-1
prompt="A cute baby polar bear"
size=1024x1024
count=1

---

{
  "error": {
    "message": "The model 'gpt-image-2-1' does not exist.",
    "type": "image_generation_user_error",
    "param": "model",
    "code": "invalid_value"
  }
}

---

client = OpenAI(
    base_url="https://UDTAzureOpenAI.openai.azure.com/openai/v1",
    api_key="<api-key>"
)

img = client.images.generate(
    model="gpt-image-2-1",
    prompt="A cute baby polar bear",
    n=1,
    size="1024x1024",
)
RAW_BUFFERClick to expand / collapse

OpenClaw 2026.4.23 appears to include the Azure image-generation fix from #70487, but I'm still hitting a follow-up issue with a real Azure deployment.

Config

{
  "models": {
    "providers": {
      "openai": {
        "baseUrl": "https://UDTAzureOpenAI.openai.azure.com/openai/v1",
        "apiKey": "${AZURE_OPENAI_API_KEY}",
        "models": [
          { "id": "gpt-image-2-1", "name": "gpt-image-2-1" }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "imageGenerationModel": {
        "primary": "openai/gpt-image-2-1",
        "fallbacks": []
      }
    }
  }
}

Env:

AZURE_OPENAI_API_KEY=<set>
AZURE_OPENAI_API_VERSION=2024-12-01-preview

Repro

Run image_generate with:

model=openai/gpt-image-2-1
prompt="A cute baby polar bear"
size=1024x1024
count=1

Observed

Azure returns:

{
  "error": {
    "message": "The model 'gpt-image-2-1' does not exist.",
    "type": "image_generation_user_error",
    "param": "model",
    "code": "invalid_value"
  }
}

Expected

The same deployment works:

  • in Azure AI Foundry UI
  • in Azure Python SDK with:
client = OpenAI(
    base_url="https://UDTAzureOpenAI.openai.azure.com/openai/v1",
    api_key="<api-key>"
)

img = client.images.generate(
    model="gpt-image-2-1",
    prompt="A cute baby polar bear",
    n=1,
    size="1024x1024",
)

Request

Can you verify whether OpenClaw's Azure image-generation request shape still differs from what Azure expects for gpt-image-2 deployments?

This looks like a follow-up/edge-case bug after #70487, not missing Azure endpoint support.

extent analysis

TL;DR

The issue might be due to a mismatch between OpenClaw's Azure image-generation request and Azure's expected request shape for gpt-image-2 deployments.

Guidance

  • Verify the request shape sent by OpenClaw to Azure for image generation and compare it with the expected shape for gpt-image-2 deployments.
  • Check the Azure API documentation to ensure that the model parameter is correctly formatted and matches the expected value for gpt-image-2-1.
  • Test the image generation with a different model to see if the issue is specific to gpt-image-2-1 or a more general problem.
  • Review the changes made in #70487 to ensure that they did not introduce a new issue with the Azure image-generation request shape.

Example

No code example is provided as the issue seems to be related to the request shape and not a specific code snippet.

Notes

The issue might be specific to the gpt-image-2-1 model or the Azure deployment, and further investigation is needed to determine the root cause.

Recommendation

Apply a workaround by modifying the OpenClaw configuration to match the expected Azure request shape for gpt-image-2 deployments, if possible.

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

openclaw - 💡(How to fix) Fix [Bug]: Azure gpt-image-2 deployment works in SDK/UI but OpenClaw image_generate returns model does not exist [2 comments, 2 participants]