Generate image with AI
generate_imageGenerate an image from a text prompt (1-1000 chars) and save it to the media library. aspect: 1:1 (default), 4:5, 9:16, 16:9 or 1.91:1. Returns id, url and mediaType; pass the url in mediaUrls of create_post / create_draft_post. Requires the MEDIA_WRITE scope. Limited by a monthly quota: HTTP 429 means it is spent, do not retry right away. 502 is a provider failure and can be retried; 503 with code FEATURE_DISABLED means AI images are not enabled on this deployment, never retry and use another media option; 422 means the prompt was rejected or storage quota is full.
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 |
|---|---|---|---|
| aspect | No | 1:1 | |
| prompt | Yes |