generate_image_xai
Generate or EDIT an image using xAI Imagine (Quality Mode default — highest live API fidelity; closest to consumer Image 2.0 until API ships a 2.0 model id). Photorealistic, illustrations, flat graphics, icons, banners. 1K/2K. Single or multi-image edit (≤3 refs via artifact_ids / reference_image_urls). Use model_tier=standard only for cheap drafts.
Routing: ALL image generation and editing → use this (2 credits). Quality default; multi-ref composite via artifact_ids.
[sensitive-tier — first use may require a manager's approval; a from-now-on approval makes future calls seamless, a just-once approval re-asks next time.]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | Optional Media gallery folder to file this image into (freeform name, e.g. "q3-campaign" or "brand-assets"). Shown as a folder chip on the /media page so the operator can find it later. Reuse an existing folder name when the work belongs to it. | |
| prompt | Yes | Detailed description of the image. Include lighting, camera angle, environment, style, and subject details. | |
| companyId | Yes | FreedomOS company id to act within (you must be a member). Required for company-scoped tools. | |
| model_tier | No | quality (default, best fidelity) or standard (cheaper draft). Prefer quality for customer-facing work. | |
| resolution | No | Output resolution. 1k (default) or 2k (print/pro). | |
| artifact_id | No | ID of an existing artifact to edit. Prefer over raw URLs (company-scoped resolve). | |
| folder_name | No | Subfolder name for Drive save (e.g. "Product Shots", "Headshots"). Only used when save_to_drive is true. | |
| artifact_ids | No | Multiple artifact IDs for multi-ref edit/composite (max 3). | |
| aspect_ratio | No | Aspect ratio. Defaults to 1:1. Use "auto" to let the model choose. | |
| save_to_drive | No | If true, also save the image to Google Drive for permanent storage. Defaults to false. | |
| reference_image_url | No | URL of an existing image to EDIT. Prefer artifact_id when possible. | |
| reference_image_urls | No | Multiple source image URLs for multi-ref edit/composite (max 3). Prefer artifact_ids. |