Skip to content

Add GPT Image 2 model support for image generation#302

Merged
adambalogh merged 1 commit into
mainfrom
claude/gpt2-image-model-sdk-m7dpb5
Jun 30, 2026
Merged

Add GPT Image 2 model support for image generation#302
adambalogh merged 1 commit into
mainfrom
claude/gpt2-image-model-sdk-m7dpb5

Conversation

@adambalogh

Copy link
Copy Markdown
Collaborator

Summary

Add support for OpenAI's GPT Image 2 model via the TEE endpoint for native image generation capabilities.

Changes

  • src/opengradient/types.py: Added GPT_IMAGE_2 = "openai/gpt-image-2" enum value to TEE_LLM with documentation noting:

    • Dedicated /images/generations endpoint
    • Flat per-image billing rate
    • Images returned as data: URIs in TextGenerationOutput.images and StreamChunk.images
    • Images not included in signed output hash
  • examples/llm_image_generation.py: Updated example documentation to list GPT Image 2 as an available image generation model with pricing ($0.05/image)

  • README.md: Added "GPT Image 2 (native image generation)" to the OpenAI models list in the supported models section

Implementation Details

The model follows the existing TEE LLM pattern and integrates with the image generation infrastructure already in place. Images are handled separately from the signed output, consistent with other image generation models like Gemini variants.

https://claude.ai/code/session_01BUq85aJiPfVTWsMCPmWJ1L

Adds GPT_IMAGE_2 ("openai/gpt-image-2") to the TEE_LLM enum so the SDK
can route to OpenAI's image-generation model already supported by the
tee-gateway. Billed at a flat per-image rate; images returned as data:
URIs on the response. Updates the image-generation example and README
model list.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUq85aJiPfVTWsMCPmWJ1L
@adambalogh adambalogh marked this pull request as ready for review June 30, 2026 16:03
@adambalogh adambalogh merged commit 2788b4c into main Jun 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants