Problem
The new plugins/image_gen/openai/__init__.py (from PR #13799) has a hardcoded API_MODEL:
API_MODEL = "gpt-image-2"
payload = {
"model": API_MODEL, # always "gpt-image-2", regardless of config
...
}
This means if a user sets image_gen.model: gpt-image-2-1k or uses a third-party OpenAI-compatible backend (e.g., Krill, OpenRouter image endpoints, local proxies) where the model name is different, the request still sends "model": "gpt-image-2".
Why this matters
- Third-party providers that follow the OpenAI
/v1/images/generations spec but have different model names cannot be used because the model name is not configurable.
- The three-tier
low/medium/high system only affects the quality parameter, not the model name sent to the API.
- Users routing through
OPENAI_BASE_URL to a compatible backend get the wrong model name.
Expected behavior
The plugin should respect the model ID from config — either by using it directly as the API model, or by providing a mechanism to override API_MODEL.
Proposed solution
Option A: Allow image_gen.openai.model to serve as the actual model field in the API request when it is not one of the three recognized tier IDs.
Option B: Add an image_gen.openai.api_model config key that overrides API_MODEL.
Option C: Read OPENAI_IMAGE_MODEL_NAME env var as escape hatch for the API model name.
Discovered while trying to use Krill AI as an image backend, which supports gpt-image-2 via OpenAI-compatible API but uses different model identifiers.
Problem
The new
plugins/image_gen/openai/__init__.py(from PR #13799) has a hardcodedAPI_MODEL:This means if a user sets
image_gen.model: gpt-image-2-1kor uses a third-party OpenAI-compatible backend (e.g., Krill, OpenRouter image endpoints, local proxies) where the model name is different, the request still sends"model": "gpt-image-2".Why this matters
/v1/images/generationsspec but have different model names cannot be used because the model name is not configurable.low/medium/highsystem only affects thequalityparameter, not the model name sent to the API.OPENAI_BASE_URLto a compatible backend get the wrong model name.Expected behavior
The plugin should respect the model ID from config — either by using it directly as the API model, or by providing a mechanism to override
API_MODEL.Proposed solution
Option A: Allow
image_gen.openai.modelto serve as the actualmodelfield in the API request when it is not one of the three recognized tier IDs.Option B: Add an
image_gen.openai.api_modelconfig key that overridesAPI_MODEL.Option C: Read
OPENAI_IMAGE_MODEL_NAMEenv var as escape hatch for the API model name.Discovered while trying to use Krill AI as an image backend, which supports gpt-image-2 via OpenAI-compatible API but uses different model identifiers.