Continue a stopped agent run
continue_agentCarry on an agent run that stopped at its credit limit (status credit_limit) with a new budget. It starts a new run on the same thread that resumes where the stopped one was, keeps the pages it read and answers in full. Use it when run_agent or get_job answered status 'credit_limit' and data.partial is not enough. A run that finished, failed or was cancelled cannot be carried on: ask run_agent again. Inputs: id is the stopped run's id, from its answer. max_credits and max_steps are the new run's own, e.g. max_credits=4000; omitted, they are the stopped run's. Cost: the pages the stopped run read are not paid for again. New pages are charged as they are read, a refused page free, and the model's tokens at the model provider's price plus 20%, within max_credits. Timing: it returns at once with the new run's job, as run_agent does. Call get_job(kind='agent', id=...) with the new id every 30 to 60 seconds; cancel_job stops it. Calling continue_agent again for a run already carried on returns the run that carried it on, not a new one. Refusals: code conflict for a run that did not stop at its credit limit (or was carried on meanwhile, by another call), not_found for an unknown id, expired past its 7-day keep date. Needs write access; a read-only connection is refused with code 'read_only'.
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": {
"id": "<id>"
},
"name": "continue_agent"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The id of the run that stopped at its credit limit, from run_agent's or get_job's answer. | |
| max_steps | No | The most steps the new run may take, 1 to 100; omit for the stopped run's. | |
| max_credits | No | The most the new run may spend, 1 to 100,000 credits; omit for the stopped run's. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | The run's id: for get_job and cancel_job with kind 'agent'. | |
| job | No | While it works: {kind: 'agent', id} for get_job and cancel_job. | |
| code | No | Only on a failure: a machine-readable reason, e.g. read_only, validation, plan_limit or not_found. | |
| data | No | The answer: JSON matching the schema, or {text} without one; {partial} at credit_limit. When the answer is too long for 60,000 characters, a string of its JSON text, cut, and the note says where the whole answer is. | |
| note | No | What to do next, and what was cut and where to get it whole. | |
| error | No | When the call failed, or the run ended in error: what went wrong, in words an assistant can act on. | |
| steps | No | The steps the agent has taken. | |
| budget | No | The most the run may spend: max_credits, or less when the workspace had less left (budgetLimited). | |
| detail | No | Only on a failure: the API's own wording, when the error was rephrased. | |
| prompt | No | The question as it was asked. | |
| status | No | queued/running with a `job` while it works; done, credit_limit (stopped at its budget, data.partial holds what it found, continue_agent carries it on), cancelled or error once finished; 'expired' past its keep date. On an error, the HTTP status code. | |
| sources | No | The pages the answer rests on, each {url, title, pageId}; the first 50 when the answer had to be cut. | |
| stopReason | No | Why it stopped early, e.g. credit_limit, step_limit or cancelled; empty when it finished on its own. | |
| creditsUsed | No | Credits spent so far: pages read plus the model's tokens. | |
| fieldSources | No | Where each value of data came from: its path (e.g. 'plans[0].price', or '[2].name' for a list answer) to {url, pageId}, a page the run read. The first thing left out when the answer is too long for 60,000 characters, and the note says so. | |
| budgetLimited | No | true when the budget was lowered to what the workspace had left when the run started. |