Skip to content

feat(ai): add OpenAI image generation#37714

Merged
rekram1-node merged 5 commits into
v2from
openai-images
Jul 19, 2026
Merged

feat(ai): add OpenAI image generation#37714
rekram1-node merged 5 commits into
v2from
openai-images

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a provider-neutral Image domain with ImageModel, ImageRequest, ImageResponse, and ImageClient
  • implement direct OpenAI image generation through /v1/images/generations
  • add OpenAI.imageGeneration(...) for conversational image generation through the Responses hosted tool
  • normalize hosted image results into replayable file content while preserving provider metadata, output media type, and usage
  • support stateless conversational continuation by replaying the generated image as image input
  • add live-recorded cassettes for direct Images and multi-step Responses generation/editing

Protocol direction

There is no broad image-generation wire standard comparable to Chat Completions. OpenAI, xAI, Together, and DeepInfra form a useful /images/generations compatibility island, while Google, Stability, BFL, Replicate, fal, and Fireworks use distinct multimodal, multipart, or asynchronous job protocols.

This keeps the public image API semantic and treats OpenAI Images as the first provider adapter rather than the universal wire model. Follow-up providers can reuse an OpenAI-compatible adapter where their actual wire contracts overlap.

Validation

  • live direct Images cassette recorded against gpt-image-1-mini and replayed successfully
  • live Responses cassette records generation followed by stateless image editing against gpt-5-mini
  • decoded and visually inspected the direct image, initial Responses image, and edited Responses image
  • cassette credential scans passed
  • bun typecheck in packages/ai
  • bun run build in packages/ai
  • bun test --timeout 30000 --only-failures in packages/ai (352 passed, 29 skipped)

Closes #37713

Requested by: @rekram1-node (Aiden Cline via Slack)

@rekram1-node
rekram1-node merged commit 04f0a77 into v2 Jul 19, 2026
8 checks passed
@rekram1-node
rekram1-node deleted the openai-images branch July 19, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant