Generate image → return bytes
generate_image_bytesGenerate an image with OpenAI and return it inline as base64 so it appears directly in the conversation without saving a file; best for small previews/icons.
Instructions
Generate an image with OpenAI and RETURN it inline as a base64 image block (no file is written). The image is viewable directly in the conversation. Note: large/full-res images are heavy to pass this way — best for small previews/icons. To persist a returned image, the assistant should re-save it.
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_bytes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Image size. Square / landscape / portrait / auto. Default: auto. | |
| prompt | Yes | What to draw. Be specific about style, colors, composition. | |
| quality | No | Render quality (higher costs more). Default: auto. | |
| background | No | Use "transparent" for logos/icons (PNG/WebP only). Default: auto. | |
| output_format | No | File format. Default: png. |