Skip to content

Add OpenAI gpt-image-1 image generation model#96

Draft
adambalogh wants to merge 1 commit into
mainfrom
claude/practical-babbage-Zs1Dz
Draft

Add OpenAI gpt-image-1 image generation model#96
adambalogh wants to merge 1 commit into
mainfrom
claude/practical-babbage-Zs1Dz

Conversation

@adambalogh
Copy link
Copy Markdown
Contributor

Routes gpt-image-1 through the existing /images/generations endpoint path (like Grok/Seedream). Unlike those flat-priced models, gpt-image-1 is billed on the real token usage the endpoint reports (text input + generated-image output tokens), so its token prices are set and per_image_price_usd is left unset.

  • generate_images now supports the openai provider, omits response_format (gpt-image-1 always returns base64 and rejects it), uses PNG mime, and returns the endpoint's token usage.
  • Chat controller threads that usage into compute_session_cost for both streaming and non-streaming image paths.
  • Tests + docs updated.

https://claude.ai/code/session_01Ux3BMHiKKKAmTLqCwfFo9R

Routes gpt-image-1 through the existing /images/generations endpoint
path (like Grok/Seedream). Unlike those flat-priced models, gpt-image-1
is billed on the real token usage the endpoint reports (text input +
generated-image output tokens), so its token prices are set and
per_image_price_usd is left unset.

- generate_images now supports the openai provider, omits response_format
  (gpt-image-1 always returns base64 and rejects it), uses PNG mime, and
  returns the endpoint's token usage.
- Chat controller threads that usage into compute_session_cost for both
  streaming and non-streaming image paths.
- Tests + docs updated.

https://claude.ai/code/session_01Ux3BMHiKKKAmTLqCwfFo9R
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