Refund a job
refund_jobRefund one job's payment to its sender, or issue an account credit.
Destructive and irreversible: funds go back on Base and the job is marked refunded. No undo.
Behavior: refunds on-chain when a private key is configured, else credits the sender. Returns a refund hash, 'credit_only', or 'job_not_found'. Refunding twice is safe.
Parameters: an unknown key returns job_not_found and moves nothing.
When to use: when a paid job failed. Check get_job_status first; use
get_credit_balance to see if a refund became credit.
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": {
"job_key": "<job_key>"
},
"name": "refund_job"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| job_key | Yes | Job key to refund, from execute_task or list_jobs. Required. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| result | Yes | refund tx hash, 'credit_only', or 'job_not_found' | |
| job_key | No |