gpt-5.3-codex demands a imagegen for text output

Jan Rzadkosz 20 Reputation points
2026-07-09T17:17:57.57+00:00

I've been using gpt-5.3-codex deployment for a long time and it always worked fine, except today I get an error whenever i try to prompt it form Codex app, codex CLI or vs code extension: imagegen deployment must be provided through header: x-ms-oai-image-generation-deployment. I don't even try to generate any image, but codex demands the imagegen model deployment. I reinstalled codex CLI and it started working, but thevs code extension still does not work, even after reinstalling it.

Azure OpenAI in Foundry Models

3 answers

Sort by: Most helpful
  1. Karnam Venkata Rajeswari 5,005 Reputation points Microsoft External Staff Moderator
    2026-08-04T19:27:49.97+00:00

    Hello @Jan Rzadkosz ,

    Welcome to Microsoft Q&A .Thank you for reaching out to us.

    The x-ms-oai-image-generation-deployment header identifies the image model deployment used when image-generation functionality is configured.

    For a text-only request, this header is not normally expected. The current working hypothesis is that the request generated by the client may unexpectedly contain image-generation-related configuration or capability metadata.

    Regarding if an image-generation deployment required?

    An image-generation deployment is not documented as a requirement for standard GPT-5.3-Codex operations such as:

    • Code generation
    • Debugging
    • Repository analysis
    • Reasoning
    • Text-based responses
    • Software development assistance

    Image input and image generation are separate capabilities. The ability to process an image provided as input should not be interpreted as a requirement to configure image generation for text and code workloads.

    Regarding the CLI work while the VS Code extension fails - The CLI started working after reinstallation, while the VS Code extension continued to fail against the same Azure deployment. This makes a deployment-level issue less likely and points more strongly toward a difference in:

    • Client or extension versions
    • Extension runtime
    • Cached extension state
    • Persisted authentication or configuration
    • Workspace settings
    • MCP or custom tool configuration
    • Request construction

    The CLI reinstall may have refreshed its binaries or local configuration, while the extension may still be using separate or previously stored state.

    Please check if the following steps help-

    1. Comparing client versions

    Run codex --version.

    Record the VS Code version.

    Record the Codex extension version.

    1. Install the latest compatible extension release.
    2. Comparing the working and failing configurations Confirm that the CLI and extension use the same:
      • Azure endpoint
      • Exact deployment name
      • Authentication method
      • Base URL ending in /openai/v1
      • Responses API configuration
      • Environment variables and active profiles
    3. Testing in a clean workspace

    Open a new empty folder in VS Code.

    Submit a minimal prompt such as Reply with hello.

    1. If successful, inspect the original workspace for MCP settings, repository instructions, custom tools, and image-related configuration.
    2. Resetting the extension state
      1. Sign out from the extension.
      2. Close all VS Code windows.
      3. Back up and remove only Codex-related cached storage and saved settings.
      4. Reinstall the extension.
      5. Reauthenticate and configure the Azure connection again.
    3. Performing a direct API control test Send a minimal text-only request to /openai/v1/responses without adding tools.
      • If the direct request succeeds, focus the investigation on the extension or client request.
      • If the same header error occurs, collect the sanitized request, response, UTC timestamp, and request ID for service-side investigation.
    4. Comparing successful and failing requests Where diagnostic logging permits, compare:
      • A successful CLI request
      • A failing extension request
      The key validation point is whether the extension request contains image-generation-related tool configuration that is absent from the CLI request.

    The following references might be helpful , please check them out

    Please let us know if the response was helpful

     

    Thank you

     

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Bernardo Corrales 0 Reputation points
    2026-07-10T16:48:15.8733333+00:00

    Had the same issue, and used the workaround indicated here to fix it. Give it a try https://github.com/openai/codex/issues/31775

    Was this answer helpful?


  3. Alex Burlachenko 25,110 Reputation points MVP Volunteer Moderator
    2026-07-10T07:29:28.5633333+00:00

    hi Jan Rzadkosz & thx for sharing urs issue here at Q&A portal,

    VS Code extension bug or stale extension config, not a real model requirement. The key clue is that reinstalling Codex CLI fixed it, while the VS Code extension still sends the same image-generation header error. gpt-5.3-codex shouldn’t require an ImageGen deployment for normal text/code prompts.

    Try Sign out of the Codex extension, then sign back in. Remove any saved Azure/OpenAI deployment settings from VS Code user and workspace settings. Delete the extension storage/cache, then reinstall it. Check whether the workspace has an old MCP/tool config enabling image generation. Compare the endpoint/deployment config used by CLI vs the extension.

    If CLI works against the same deployment, Azure OpenAI itself is probably fine. The extension is likely sending a malformed request or stale tool capability metadata. If it still fails after clearing extension state, report it to the Codex VS Code extension team with the extension version, request ID, and full error. Reinstalling the extension alone may not clear its stored state, because apparently uninstall doesn’t always mean “please actually forget things.”

    rgds,

    Alex

    &

    If my answer was helpful pls mark it and additional thx if u follow me at Q&A portal

    and at my blog https://ctrlaltdel.blog/

     

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.