Generate an image
generate_imageGenerate one or more images from a prompt with the TopxAI image model. Billed at the model's per-request price plus a $0.01 call fee. Returns the images inline and as temporary signed links valid for up to one hour; cache capacity may expire them earlier.
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 |
|---|---|---|---|
| n | No | Number of images. | |
| size | No | WIDTHxHEIGHT, for example 1024x1024, 1536x1024, 1024x1536 or 2048x2048. | 1024x1024 |
| model | No | Image model. | |
| prompt | Yes | What to draw. | |
| quality | No | Optional rendering quality. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | ||
| size | No | ||
| urls | No | Temporary signed links, valid for up to one hour; capacity eviction may expire them earlier. | |
| error | No | Present on a failed call: category (client, wallet, topxai, upstream, budget), message, charged, charged_usd. | |
| model | No | ||
| images | No | Images returned inline as image content blocks. | |
| charged | No | Whether the wallet was debited for this call. | |
| request_id | No | The relay request id; the same id appears in the usage log. | |
| charged_usd | No | The recorded wallet debit in USD, model price and call fee included. | |
| inline_urls | No | Links already represented by inline image content; avoid duplicate previews. | |
| call_fee_usd | No | ||
| generated_images | No | Images returned by the generation, including files linked instead of embedded. |