generate
Start a generation with the user's credits. It is refused, with nothing charged, when it would cost more than max_credits. Returns at once with a generation_id: call get_generation until it has succeeded or failed.
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": {
"model": "<model>",
"max_credits": "<max_credits>"
},
"name": "generate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | the model id from list_models | |
| prompt | No | what to make; for speech models the text to read | |
| parameters | No | the model's settings by key (get_model); any left out take the model's default | |
| references | No | uploaded files the model works from | |
| max_credits | Yes | the most credits the user agreed to spend on this generation; it is refused when the quote is higher | |
| idempotency_key | No | optional, 16-128 characters [A-Za-z0-9._:-]: repeating a call with the same key returns the same generation instead of making another |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tip | No | ||
| text | No | ||
| error | No | ||
| model | Yes | ||
| prompt | No | ||
| status | Yes | queued, processing, succeeded, failed or unknown | |
| credits | Yes | ||
| outputs | No | ||
| modality | Yes | ||
| progress | Yes | ||
| created_at | Yes | ||
| generation_id | Yes |