[Workers AI] Fix gpt-image-2 input field: image -> images#30526
Merged
superhighfives merged 1 commit intoproductionfrom May 4, 2026
Merged
[Workers AI] Fix gpt-image-2 input field: image -> images#30526superhighfives merged 1 commit intoproductionfrom
superhighfives merged 1 commit intoproductionfrom
Conversation
The runtime API rejects the documented 'image' field with: Valid fields: prompt, images, quality, size, background, output_format. Update the catalog JSON so the schema, Image Edit example, and code snippet use 'images' (array, up to 16). Adds a Multi-Image Edit example to show the array form.
Contributor
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the openai/gpt-image-2 catalog entry so “image edit” requests match the Workers AI runtime contract (which expects images rather than image), preventing immediate 400s when users follow the docs.
Changes:
- Update the Image Edit example and TypeScript snippet to pass
images: [...]instead ofimage: .... - Add a new “Multi-Image Edit” example demonstrating multiple reference images.
- Update the input JSON schema from
image: stringtoimages: string[]withmaxItems: 16(and reformat some arrays inline).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
Preview URL: https://3d5eb183.preview.developers.cloudflare.com |
ethulia
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The docs for
openai/gpt-image-2show the edit input asimage(singular), but the runtime rejects that with:So users following the docs hit a 400 immediately. Reported by Craig Dennis after Clanker copied the example verbatim.
This updates
src/content/catalog-models/openai-gpt-image-2.jsonso the input schema, the Image Edit example, and the TypeScript snippet all useimagesas an array (up to 16 entries, base64 strings ordata:URIs). Also adds a Multi-Image Edit example to show the array form.image: string->images: string[](maxItems: 16)images: [...]Result on the rendered page:
Heads up - this file is regenerated by
bin/fetch-catalog-models.tsfrom the Unified Catalog API, so the upstream catalog also needs the same fix or the next sync will revert this. CCing catalog owners per CODEOWNERS so they can chase that down: @abhishekkankani @palashgo @thebongy @roerohan @kathayl.