Skip to content

Conversation

@sixlive
Copy link
Contributor

@sixlive sixlive commented Jan 27, 2026

Description

Closes #583

Surfaces OpenAI-specific image response metadata via additionalContent on the image response. This includes input_tokens_details (text_tokens, image_tokens) and resolved parameters (quality, size, output_format, background) returned by gpt-image-1.

Uses Arr::whereNotNull() so older models (DALL-E 2/3) that don't return these fields simply have an empty additionalContent array — no breaking changes.

Changes

  • src/Providers/OpenAI/Handlers/Images.php — Populate additionalContent on the ResponseBuilder with input_tokens_details, quality, size, output_format, and background from the API response
  • tests/Providers/OpenAI/ImagesTest.php — Assert additionalContent values for gpt-image-1 generation and image edit responses; assert empty additionalContent for DALL-E 3 (no regression)

@sixlive sixlive merged commit ec81339 into main Jan 27, 2026
14 checks passed
@sixlive sixlive deleted the feat-openai-image-meta branch January 27, 2026 18:43
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.

Add input token detail in response of openAi image feature

2 participants