Skip to content

feat(ai): add image generation domain #37713

Closed

Description

@opencode-agent

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.

Activity

  1. opencode-agent commented on Jul 22, 2026

    @opencode-agent
    ContributorAuthor

    Addressed by #37714. The AI package now includes the image-generation domain and OpenAI image-generation implementation requested here, with the corresponding schema/protocol and tests. Closing as resolved on the v2 branch.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions