-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
Gap
The OpenAI Images API (client.images.generate(), client.images.edit(), client.images.create_variation()) is not instrumented. Calling any client.images.* method on a wrapped client falls through via NamedWrapper.__getattr__ (line 24 of oai.py) to the original unwrapped resource — the request succeeds but produces no Braintrust span.
The SDK explicitly wraps five resource namespaces — chat, beta, responses, embeddings, and moderations — but not images, despite it being one of the most widely used OpenAI API surfaces.
What is missing
client.images.generate()— text-to-image generation (DALL·E 3, gpt-image-1). Should create a span logging the prompt, model, size, quality, style, response URLs/b64, and revised prompt.client.images.edit()— image editing with a text prompt. Same span data plus the source image reference.client.images.create_variation()— image variations.
Token metrics do not apply to image generation, but cost, latency, model, and request/response metadata are all valuable for observability.
Braintrust docs status
not_found — the OpenAI integration page does not mention the Images API.
Upstream sources
- OpenAI Images API reference: https://platform.openai.com/docs/api-reference/images
- OpenAI image generation guide: https://platform.openai.com/docs/guides/image-generation
openai.resources.images.Imagesclass in the OpenAI Python SDK (stable since v1.0)
Local files inspected
py/src/braintrust/oai.py:OpenAIV1Wrapper.__init__(lines 924–948) — wrapschat,beta,responses,embeddings,moderationsonly;imagesis absentNamedWrapper.__getattr__(line 24) — delegates unwrapped resources to the underlying client
py/src/braintrust/wrappers/test_openai.py— no tests referenceimages.generateor any images API method- Grep for
imagesacrossoai.py: zero results related to the Images resource
Reactions are currently unavailable