Create generation task
create_taskSubmit an image or video generation task with an approved USD spending cap and idempotency key, reserving balance and returning a taskId to poll until success or failure.
Instructions
Submit one generation task. RESERVES USD BALANCE and calls an upstream provider. Returns a taskId; poll get_task until status is success or fail. Call prepare_generation first and pass its expectedRevision, the approved maxCostUsd and a stable idempotencyKey. Pass maxCostUsd to reject a reservation above the approved budget.
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": {
"modelId": "<modelId>",
"inputs": "<inputs>",
"maxCostUsd": "<maxCostUsd>",
"idempotencyKey": "<idempotencyKey>"
},
"name": "create_task"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inputs | Yes | Model inputs; see get_model_params. | |
| replay | No | Replay an uncertain submission with its original key, inputs and budget. | |
| autoFix | No | Provider-specific prompt auto-fix opt-out. | |
| modelId | Yes | Public modelId from list_models. | |
| maxCostUsd | Yes | Reject the task if the charged USD would exceed this decimal string. | |
| callBackUrl | No | Optional webhook URL for completion. | |
| recoveryScope | No | For a new OAuth submission, enable recovery only within this client connection. Preserve this value on replay. | |
| idempotencyKey | Yes | Stable key for retries of the same logical request. | |
| expectedRevision | No | Model revision returned by prepare_generation. Reject a different published revision. |