> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Extend Job Budget V1

> Raise max_cost_usd on a live job at runtime. Tenants reach for this when a job is mid-flight and approaching its original cap — they'd rather pay another…

Raise `max_cost_usd` on a live job at runtime.

Tenants reach for this when a job is mid-flight and approaching its
original cap — they'd rather pay another dollar than have it
cancel + lose progress. The new cap is written to `params.max_cost_usd`
and observed by the worker on its next iteration's cost-cap check.

Only **live** jobs (queued / running / awaiting\_approval) can be
extended — terminal jobs return 409. Strictly raise-only: the
requested cap must be greater than the current one.

### Path parameters

<ParamField path="job_id" type="string (uuid)" required />

### Request body

`ExtendBudgetRequest`

<ParamField body="max_cost_usd" type="number" required>
  New cap, USD. Must be strictly higher than the current cap (or set when the job had none). Lowering is rejected with 409 because dropping the cap below the running cost would trip an immediate self-cancellation, which is what tenants are usually trying to avoid by calling this.
</ParamField>

### Response

`ExtendBudgetResponse`

<ResponseField name="job_id" type="string" required />

<ResponseField name="previous_max_cost_usd" type="number,null" required />

<ResponseField name="new_max_cost_usd" type="number" required />

<ResponseField name="current_cost_usd" type="number" required />

### Status codes

| Code  | Meaning             |
| ----- | ------------------- |
| `200` | Successful Response |
| `422` | Validation Error    |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.computer.stateset.app/api/v1/jobs/{job_id}/extend-budget' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "max_cost_usd": 1.5
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "previous_max_cost_usd": 1.5,
    "new_max_cost_usd": 1.5,
    "current_cost_usd": 1.5
  }
  ```
</ResponseExample>
