Generate images
generate_imageCreate images from a text prompt by selecting a model and tier; costs credits per image and returns results immediately.
Instructions
Generate images from a prompt. COSTS CREDITS — between roughly 1 and 24 credits per image depending on model and tier, charged whether or not the result is used. Get valid model, tier and aspect values from list_studio_models first, and check the balance with whoami. Returns straight away with the generated images; there is no separate job to poll.
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>",
"model": "<model>",
"tier": "<tier>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tier | Yes | Tier id from that model's `tiers`. Decides cost and quality. | |
| count | No | How many images. Each one is charged separately, so this multiplies the cost. Capped by the model's maxCount. | |
| model | Yes | Model id from list_studio_models (image.models[].id). | |
| aspect | No | Aspect ratio from the model's `aspects`. Defaults to 1:1. | |
| prompt | Yes | What to generate. Specific beats clever. | |
| references | No | Storage keys of library media to use as reference images, from list_library_uploads. Only accepted by models whose `routes` include 'edit', and only files uploaded to this workspace. | |
| workspaceId | No | Workspace to act in. Defaults to the active one. |