Skip to content

feat(openai): record input and output images for image APIs - #3737

Open
satyadevai wants to merge 1 commit into
Arize-ai:mainfrom
satyadevai:3422-openai-span-level-images
Open

satyadevai wants to merge 1 commit into
Arize-ai:mainfrom
satyadevai:3422-openai-span-level-images

Conversation

@satyadevai

@satyadevai satyadevai commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Records span-level images for OpenAI image generation:

  • output.images.N.image.url for Images API results and Responses API image generation calls
  • input.images.N.image.url for the files sent to image edits and variations

Before this, generated images were only in the raw output.value JSON, and Responses API image generation calls were ignored.

Changes

Images API images.generate, sync and async)

  • Each item in data becomes output.images.N.image.url. A hosted url is used as is. b64_json is converted to a data URL.
  • Image type for b64_json comes from the response output_format, then the request output_format, and defaults toimage/png.
  • Edit and variation files in the image, image[] and mask fields become input.images.N.image.url. Supported inputs are bytes, file objects, paths and (ftype) tuples.
  • Input image type comes from the tuple content type, then the file's magic bytes, then the filename, and defaults to image/png.
  • File objects are read and seeked back to where they were. Non-seekable streams are skipped so the request body isn't consumed.
  • For streaming generation and edits, the new _ImagesAccumulator records the image from the
    image_generation.completed or `image_edit.c

Responses API

  • Each image_generation_call with a result becomes output.images.N.image.url, numbered in output order.
  • Image type comes from the item's output_format of the image_generation tool in therequest.

Dependencies

  • Raised the floor to openinference-instrumeease applies trace config masking(hide_inputs, hide_outputs, hide_input_images, base64_image_max_length) to span-level input.imagesandoutput.images`.

@satyadevai satyadevai changed the title Added Image urls for the image output feat: Added Image urls for the image output Sep 14, 2026
@satyadevai
satyadevai force-pushed the 3422-openai-span-level-images branch 4 times, most recently from 7ceac46 to 12758ca Compare September 15, 2026 15:34
@satyadevai
satyadevai marked this pull request as ready for review September 15, 2026 15:53
@satyadevai
satyadevai requested a review from a team as a code owner September 15, 2026 15:53
@satyadevai satyadevai changed the title feat: Added Image urls for the image output feat(openai): record input and output images for image APIs Sep 15, 2026
@satyadevai
satyadevai force-pushed the 3422-openai-span-level-images branch 5 times, most recently from 781e6df to 972a73e Compare September 16, 2026 16:53

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant