image generation fails with gpt-image-2: Unknown parameter 'response_format'

Description

Image generation fails when using the openai/gpt-image-2 model with the following error:

Image generation failed: Unknown parameter: 'response_format'

The error occurs because the image generation code passes a response_format parameter to the OpenAI API that is not supported by the gpt-image-2 model.

Steps to Reproduce

  1. Set image generation model to openai/gpt-image-2

  2. Send a message that triggers image generation (e.g. "generate an image of ...")

  3. Image generation fails with the error above

Expected Behavior

Image generation should work with gpt-image-2 without passing unsupported parameters.

Root Cause

The gpt-image-2 model (newer OpenAI image API) does not accept the response_format parameter. This parameter was used by older models like dall-e-3 (values: url or b64_json), but the newer model API schema differs.

The image generation implementation likely hardcodes or defaults response_format in the API request body, causing the request to be rejected.

Suggested Fix

  • Omit response_format when the selected model is gpt-image-2 (or any model that doesn't support it)

  • Alternatively, detect the model family and only include supported parameters

Environment

  • Alma version: v0.0.810

  • Model: openai/gpt-image-2

  • Platform: macOS (ARM64)

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board
πŸ’‘

Feature Request

Date

About 13 hours ago

Author

hh0592821

Subscribe to post

Get notified by email when there are changes.