Summary
Add image generation as a separate semantic domain in @opencode-ai/ai, while keeping conversational image generation in the existing LLM interaction model.
Initial scope
- Add provider-neutral
ImageRequest, ImageModel, ImageResponse, and Image.generate(...) APIs.
- Implement direct OpenAI Images generation through
POST /v1/images/generations.
- Expose OpenAI's hosted
image_generation tool through the Responses route for conversational generation and editing.
- Normalize generated image output while preserving provider metadata and usage.
Protocol direction
There is no ecosystem-wide image wire protocol comparable to Chat Completions. OpenAI, xAI, Together, and DeepInfra share a useful /images/generations compatibility subset, but Google, Stability, BFL, Replicate, fal, and Fireworks use materially different multimodal, multipart, or asynchronous job protocols.
Treat OpenAI Images as a reusable provider-family adapter, not as the package's universal image model. Keep the public request semantic and add provider adapters underneath it.
Summary
Add image generation as a separate semantic domain in
@opencode-ai/ai, while keeping conversational image generation in the existing LLM interaction model.Initial scope
ImageRequest,ImageModel,ImageResponse, andImage.generate(...)APIs.POST /v1/images/generations.image_generationtool through the Responses route for conversational generation and editing.Protocol direction
There is no ecosystem-wide image wire protocol comparable to Chat Completions. OpenAI, xAI, Together, and DeepInfra share a useful
/images/generationscompatibility subset, but Google, Stability, BFL, Replicate, fal, and Fireworks use materially different multimodal, multipart, or asynchronous job protocols.Treat OpenAI Images as a reusable provider-family adapter, not as the package's universal image model. Keep the public request semantic and add provider adapters underneath it.