Image Processing
Models that supports image processing or vision can understand images as input. You can attach images in either as a URL or as a base64 encoded string like this:Image Generation
To enable image generation, include theImageGenerationTool in your request’s Tools array:
Image Generation Responses
When the model generates an image, it returns anImageGenerationCallMessage in the response output. This message contains the generated image as base64-encoded data.
Streaming Image Generation
When streaming, image generation progress is reported through different chunk types:image_generation_call.in_progress: Generation has startedimage_generation_call.generating: Image is being generatedimage_generation_call.partial_image: Partial image data
Image Generation Message Structure
TheImageGenerationCallMessage contains the following fields:
| Field | Type | Description |
|---|---|---|
| Type | string | Always "image_generation_call" |
| ID | string | Unique identifier for the image (prefixed with "ig_") |
| Status | string | Status of generation (e.g., "generating", "completed") |
| Background | string | Background type (e.g., "opaque") |
| OutputFormat | string | Image format (e.g., "png", "jpeg") |
| Quality | string | Image quality (e.g., "medium", "high") |
| Size | string | Image dimensions (e.g., "1024x1024") |
| Result | string | Base64-encoded image data |