Skip to content

“Image generation is not enabled for this group” error - CC Switch

Quick fix

Manually filter image generation requests or configure a local bridge process to read response headers to work around the 403 block.

Error output
status_code=403, Image generation is not enabled for this group

This issue is mainly caused by two types of relay restrictions. First, newer tools such as Codex include image generation parameters in chat requests by default, but most relays do not support direct calls to image generation APIs. The upstream service then returns 403 and reports that image generation is not enabled.

Second, some relays, such as LiteLLM Proxy, issue restricted virtual keys that allow inference routes only. Management and billing endpoints such as /key/info are blocked with 403. For these keys, quota information is available only in the HTTP response headers of regular inference requests. However, CC Switch checks the status code before calling the usage query extractor. For any non-2xx response, it stops and discards the response headers, so a script alone cannot retrieve quota data. The community has not agreed on a single fix. Issue #4938 proposes an image generation filter toggle, while #5227 proposes allowing the extractor to read response headers; neither change has been merged.

  1. If your relay supports image generation filtering, enable the image parameter filtering option in the cc-switch configuration to avoid sending image generation instructions to unsupported models.

  2. For quota query 403 errors caused by restricted keys, you can run a local bridge process. Have it send a probe request, read quota fields from the HTTP response headers, convert them to a JSON body, and provide that to CC Switch for querying. This works around the native extractor limitation.

ToolCodex / Claude Code
VersionUnknown
PlatformsUnknown
Why do I still get 403 errors after enabling a local proxy?
Some relay 403 errors occur at the inference endpoint itself, for example because image generation parameters are unsupported, or because key permissions restrict management endpoints. A local proxy only forwards traffic; it cannot change the upstream gateway’s authentication logic or parameter validation rules.
How can I check the remaining quota for a restricted key without running a background process?
The current version of CC Switch stops on non-2xx responses and discards the response headers, so it cannot read the quota directly. Wait for the response header passthrough feature to be merged (see #5227), or temporarily use a local bridge script to persist the header data as JSON for the extractor to read.

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.