Skip to content

unexpected status 403 Forbidden: Image generation - Codex

Quick fix

Disable 'Keep Official Login' in CC Switch and restart to stop Codex from sending image gen requests causing 403 errors.

Error output
unexpected status 403 Forbidden: Image generation is not enabled for this group

After updating, the Codex client automatically attaches the image_generation tool to requests, even if no image generation is involved. When proxied through CC Switch to a third-party provider without image generation enabled, the provider returns a 403 error.

This issue is often related to the 'Keep Official Login' feature in CC Switch. Enabling this keeps the official account logged in, defaulting to carrying image generation tool requests; disabling it and using only API login avoids this restriction.

  1. Open CC Switch settings, find, and disable the 'Keep Official Login' option.

  2. Fully exit and restart both CC Switch and the Codex client.

  3. Ensure you log in and chat using only an API Key, not by keeping the official account logged in.

  4. (Alternative) If you must keep official login, deploy a local proxy (e.g., codex-proxy) to filter the image_generation tool and modify the Codex configuration file.

    .codex/config.toml
    url = "http://127.0.0.1:8787"
ToolCodex
VersionUnknown
PlatformsWindowsmacOS
Why does configuring [features] image_generation = false in general config have no effect?
This configuration only affects the CLI terminal and cannot influence the behavior of the Codex client automatically attaching the image generation tool.
What should I do if the error persists after clearing historical conversations?
As long as 'Keep Official Login' is enabled, Codex will continue to carry image generation tool requests. You must disable this feature and restart to resolve it completely.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.