Generate images
generate_imageCreate 1-4 images or an animated GIF from a detailed text prompt using your Sparkles Editor account, choosing model, size, format, and quality. Returns image bytes or job IDs for later retrieval.
Instructions
Generate 1-4 images from a text prompt with the user's Sparkles Editor account. This spends credits and submits the prompt to the site's moderation pipeline. Returns the generated image bytes when they are ready within the wait window; otherwise returns job ids for get_image. Use list_image_models first if the user has no model preference. GIF output requires a GPT Image 2.6 model and count=1.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Pixel size such as 1024x1024, or auto. Each side must be 3-4 digits, a multiple of 16, at most 3840; aspect ratio at most 3:1; total pixels 655360-8294400. | |
| count | No | Number of images. Defaults to 1; GIF requires 1. | |
| model | No | Image model id from list_image_models. Defaults to the site default. | |
| format | No | Output format. Defaults to png. GIF is supported only by GPT Image 2.6 models. | |
| prompt | Yes | Detailed image description. Write the full visual prompt, not a short keyword list. | |
| quality | No | Output quality. Defaults to auto when the model supports it. | |
| background | No | Background preference. Transparent requires png or webp. | |
| request_id | No | Optional idempotency UUID. Reuse the same value only when retrying the same request after a network error. | |
| frame_count | No | GIF only: number of animation frames. | |
| wait_seconds | No | How long to wait for completion. Defaults to 25 seconds; maximum 30. | |
| frame_duration_ms | No | GIF only: frame delay in milliseconds, a multiple of 10. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jobs | Yes | ||
| note | No | ||
| images | Yes | ||
| pending | Yes | ||
| requestId | No |