Attributes
- Provider: xai
- Category: Text to Image
Parameters
| Name | Description | Type | Required | Enums |
|---|---|---|---|---|
| prompt | Text description of the image to generate. | string | Yes | - |
| aspect_ratio | Aspect ratio of the generated image. auto lets the model choose a ratio that fits the prompt. |
string | No | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, 19.5:9, 9:19.5, 20:9, 9:20, 21:9, 5:2, auto |
| n | Number of images to generate. | integer | No | - |
| quality | Generation quality. | string | No | low, medium |
| resolution | Output resolution. | string | No | 1k, 2k |
| response_format | How images are returned: a temporary URL, or base64 in the task result. | string | No | url, b64_json |
Pricing
Unit: $/img
| Dimension | Pricing |
|---|---|
| quality: low / resolution: 1k | 0.0480 |
| quality: low / resolution: 2k | 0.0720 |
| quality: medium / resolution: 1k | 0.0720 |
| quality: medium / resolution: 2k | 0.0960 |
