# Image Generation

The image generation tool allows your AI assistant to create images from text descriptions on demand, directly within a conversation.

## Enabling Image Generation


```json
{
 "organization_id": "org_your_org_id",
 "assistant_id": "asst_abc123",
 "tools": [{"type": "image_generation"}],
 "inputs": [{"role": "user", "content": "Create an illustration of a mountain at sunset."}]
}
```

## Tool Modes

| Mode | Behavior |
|  --- | --- |
| `auto` | Model generates images when appropriate (recommended) |
| `on` | Always attempt image generation |
| `off` | Disable image generation |


## Supported Providers

Image generation is powered by integrated providers:

| Provider | Notes |
|  --- | --- |
| OpenAI (DALL-E) | High quality, strong prompt understanding |
| ClipDrop | Fast generation, creative styles |


Provider selection is configured at the organization level. Contact your admin to change providers.

## Response Structure

When the model generates an image, the response includes an `image_generation_call` output item:


```json
{
 "output": [
 {
 "type": "image_generation_call",
 "id": "ig_abc123",
 "status": "completed",
 "result": {
 "url": "https://...",
 "revised_prompt": "A dramatic mountain range at sunset with orange and purple clouds..."
 }
 },
 {
 "type": "message",
 "role": "assistant",
 "content": [
 {"type": "output_text", "text": "Here's the mountain sunset illustration:"},
 {"type": "image_url", "image_url": {"url": "https://..."}}
 ]
 }
 ]
}
```

The `revised_prompt` field shows the prompt as actually sent to the image provider (the model may enhance your description for better results).

## Prompting Tips

- Be specific about style: *"oil painting"*, *"photorealistic"*, *"minimalist vector illustration"*
- Describe composition: *"wide angle"*, *"close-up portrait"*, *"bird's eye view"*
- Specify mood and lighting: *"golden hour lighting"*, *"dramatic shadows"*, *"soft pastel colors"*
- Mention what to exclude: *"no text"*, *"no people"*


## Image Dimensions

Default output is typically 1024×1024 pixels. Some providers support other aspect ratios. Configuration options are available at the assistant level.

## Standalone Image Generation

For generating images outside of a conversational context, use the dedicated [Images API](/assets/generate.ffcfe7515f44fea6689d306cea27693941003ec6bfec06eb9e3b937505c142a2.d31fde94.md) directly.

## Related Resources

- [System Tools Overview](/docs/documentation/system-tools) — All available built-in tools
- [Images API](/assets/generate.ffcfe7515f44fea6689d306cea27693941003ec6bfec06eb9e3b937505c142a2.d31fde94.md) — Direct image generation endpoint
- [Images and Vision](/docs/documentation/core-concepts/images-and-vision) — Image capabilities overview
- [Assistants](/docs/documentation/core-concepts/assistants) — Configuring tools on an assistant