Skip to content
Last updated

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

Enabling Image Generation

{
 "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

ModeBehavior
autoModel generates images when appropriate (recommended)
onAlways attempt image generation
offDisable image generation

Supported Providers

Image generation is powered by integrated providers:

ProviderNotes
OpenAI (DALL-E)High quality, strong prompt understanding
ClipDropFast 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:

{
 "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 directly.