Generate image with SmartAPI
generate_imageGenerate an image from a detailed prompt using the SmartAPI image generation endpoint, saving the result as a local file in PNG, JPEG, or WebP format.
Instructions
Generate one image through the paid SmartAPI gpt-image-2 endpoint and save it as a local file. Use only when the user asks to create an image. The call spends SmartAPI balance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Requested WIDTHxHEIGHT or auto. SmartAPI returns the normalized effective size. | auto |
| prompt | Yes | Detailed prompt describing the image to generate. | |
| quality | No | Image generation quality. | high |
| filename | No | Optional filename without extension. Existing files are never overwritten. | |
| output_format | No | File format for the generated image. | png |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| request_id | Yes | ||
| output_format | Yes | ||
| charged_tokens | Yes | ||
| effective_size | Yes |