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

# Extend computer

> Add time to a computer that has an end.

Adds hours to the end a computer already has. The computer keeps running, and it is deleted at its new end.

[Update computer](https://docs.orgo.ai/api-reference/computers/update.md) sets an end counted from now, so `"ends_in_hours": 24` on a computer with three days left shortens it to one day. Extend adds to what is left, so it only ever lengthens, and it can take the end further out: up to 90 days from now, where Update computer stops at 30.

> [!WARNING]
>
> Extending does not keep a computer for good. When the new end comes, the computer is deleted with everything on it. To keep it, take the end off with [Update computer](https://docs.orgo.ai/api-reference/computers/update.md) and `"ends_at": null`.

Extending needs write access to the workspace. Only a computer that has an end can be extended.

## Headers

**Idempotency-Key** `string`

8 to 255 printable characters, such as a UUID. A key is required, here or as `idempotency_key` in the body, because repeating this call would otherwise add the time twice. Send a new key for each extend, and the same key when you retry one. [Retries](#retries) has the rules.

## Path parameters

**id** `string` *required*

Computer ID. Accepts the computer's UUID or its `instance_id`.

## Body

**hours** `integer` *required*

Hours to add, a whole number from `1` to `2160`. The new end is the current `ends_at` plus `hours`. If `ends_at` has just passed and the computer has not been deleted yet, it is now plus `hours`. The new end can be at most 2160 hours (90 days) from now.

**idempotency\_key** `string`

The key, in place of the `Idempotency-Key` header: 8 to 255 printable characters, such as a UUID. Send one or the other. An MCP tool call has no headers, so `orgo_extend_computer` takes it here and it is required there. When both are sent they must match.

## How extending is billed

A computer on the plan is paid for by the plan. Only its end moves, and nothing is prepaid.

On a computer that runs by the hour and is running, the prepay follows the new end in the same step, as it does on [Update computer](https://docs.orgo.ai/api-reference/computers/update.md#how-a-change-of-the-end-is-billed). What the old prepay has not used comes back and the run to the new end is held, so it needs only the extra. When your credit cannot cover the extra plus an hour of your other hourly computers that are not prepaid, the request returns `402` and nothing changes.

Only the workspace owner can prepay. On a paid plan the owner must also be signed in, or use a key with Billing write. A caller who may not prepay but has write access still moves the end: nothing more is held, the time past the old prepay is billed by the hour, and the answer carries `prepay_warning`.

An hourly computer that is stopped keeps its new end and stays billed by the hour, with no prepay.

## Retries

* **A retry with the same key and body** gets the first answer back with the header `Idempotent-Replayed: true`. Nothing more is added or held.
* **A refused request** changes nothing and frees its key, so you can send the same key again once the reason is fixed, for example after adding credit.
* **The same key with another body** returns `422`.
* **A retry while the first is still running** returns `409` with code `idempotency_in_progress`. Try again in a few seconds.
* **A request that did not finish** returns `409` with code `idempotency_unfinished` on its retry, because the end may have moved. Read the computer with [Get computer](https://docs.orgo.ai/api-reference/computers/get.md) before you try again with a new key.

Keys last a day.

## Response

**id** `string`

Computer identifier (UUID).

**name** `string`

Computer name.

**ends\_at** `string`

The new end, as an ISO 8601 time.

**on\_end** `string`

Read only: `"delete"`. An extended computer is deleted at its new end, also if its old end would have stopped it.

**ended\_at** `string | null`

`null`.

**deletes\_at** `string`

When Orgo deletes the computer, which is `ends_at`.

**prepaid\_until** `string | null`

On a computer that runs by the hour. When its prepaid run ends now, or `null` when its time is not prepaid.

**prepaid\_cents** `integer | null`

Present alongside `prepaid_until`. What is held from your credits for the run now, in cents. `null` when `prepaid_until` is.

**prepay\_returned\_cents** `integer`

Present when some of the earlier prepay came back to your credits, in cents.

**prepay\_warning** `string`

Present when the end moved but its time was not prepaid.

## Example

Add 30 days to an hourly Medium (\$0.055 an hour) that has 10 days left.

```bash cURL theme={null}
curl -X POST https://www.orgo.ai/api/computers/$COMPUTER_ID/extend \
  -H "Authorization: Bearer $ORGO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"hours": 720}'
```

```json theme={null}
{
  "id": "a3bb189e-8bf9-3888-9912-ace4e6543002",
  "name": "agent-1",
  "ends_at": "2026-12-14T09:30:00.000Z",
  "ended_at": null,
  "deletes_at": "2026-12-14T09:30:00.000Z",
  "on_end": "delete",
  "prepaid_until": "2026-12-14T09:30:00.000Z",
  "prepaid_cents": 5280,
  "prepay_returned_cents": 1320
}
```

## Errors

| Status | `code` | When |
| - | - | - |
| `400` | `idempotency_key_required` | No key, in the `Idempotency-Key` header or in `idempotency_key`. |
| `400` | `idempotency_key_conflict` | The header and `idempotency_key` differ. |
| `400` | `invalid_idempotency_key` | The key is not 8 to 255 printable characters. |
| `400` | `INVALID_ENDS` | `hours` is not a whole number from 1 to 2160, or the new end would be more than 2160 hours from now. The message says how many more hours the computer can take. |
| `400` | `ENDS_NOT_SUPPORTED` | `Only Linux and Windows computers can have an end.` |
| `402` | `insufficient_credit` | Your credit can't prepay the run to the new end. The body has `needed_cents`, `available_cents` and, when your other computers are kept an hour, `keep_cents`. Nothing changed. |
| `403` | `workspace_read_only` | Your access to the workspace is view only. |
| `403` | `computer_key`, `computer_scope` | A computer's own key, or a key for one computer, can't change an end. Use a key for your account. |
| `409` | `NO_END` | `This computer has no end, so it already runs until you stop or delete it.` |
| `409` | `END_RAN_OUT` | The computer was stopped when an older end ran out. Give it a new end, or take the end off, with [Update computer](https://docs.orgo.ai/api-reference/computers/update.md). |
| `409` | `COMPUTER_BUSY` | `This computer is busy right now, so its end did not change. Try again in a minute.` A stop, a start or the end itself holds the computer, or its end just moved. Send the same request again. |
| `409` | `idempotency_in_progress`, `idempotency_unfinished` | See [Retries](#retries). |
| `422` | `idempotency_key_reused` | The key was used for a different body. |
| `503` | `ENDS_UNAVAILABLE`, `idempotency_unavailable` | Nothing changed. Try again shortly. |


## OpenAPI

````yaml POST /computers/{id}/extend
openapi: 3.1.0
info:
  title: Orgo API
  description: >-
    Launch cloud computers that AI agents can control and interact with. Create
    workspaces, provision computers, and control them programmatically.
  version: 2.0.0
  contact:
    name: Orgo Support
    email: contact@orgo.ai
    url: https://orgo.ai
servers:
  - url: https://www.orgo.ai/api
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Support
    description: >-
      Orgo’s support agent, for programs: ask how to do something in Orgo and
      get an answer with full URLs and copyable commands.
  - name: Account
    description: >-
      Account capacity: how many computers an account may run, and adding or
      giving back more.
  - name: Agent accounts
    description: >-
      Accounts an AI agent makes for itself, and the claim link a person uses to
      take one over.
  - name: Clients
    description: >-
      Run Orgo for your clients from your own app: a workspace and scoped key
      each, billed to you or to them.
  - name: Workspaces
    description: Organize computers into named workspaces
  - name: Computers
    description: Provision and manage virtual computers
  - name: Computer Lifecycle
    description: Start, stop, and restart computers
  - name: Computer Actions
    description: Control mouse, keyboard, and execute commands
  - name: Screens
    description: >-
      More than one desktop on a single computer. Each screen is its own X
      server with its own cursor and window manager, so an agent working on one
      cannot disturb another.
  - name: Files
    description: Upload and download files
  - name: Templates
    description: Author, build, and launch reproducible computers from templates
  - name: Chat
    description: Run an agent on a computer through OpenAI-compatible chat completions.
paths:
  /computers/{id}/extend:
    post:
      tags:
        - Computers
      summary: Extend computer
      description: >-
        Adds hours to the end a computer already has, so it only ever lengthens:
        the new end is `ends_at` plus `hours`, or now plus `hours` when
        `ends_at` has just passed. It can be at most 2160 hours (90 days) from
        now. The computer is still deleted at its new end. On a running hourly
        computer the prepay follows the new end, and `402` with nothing changed
        when the credit is short. Needs write access to the workspace.
      operationId: extendComputer
      parameters:
        - name: id
          in: path
          required: true
          description: Computer ID. Accepts the computer's UUID or its `instance_id`.
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            The key, in place of idempotency_key in the body. 8 to 255 printable
            characters, such as a UUID. A retry with the same key and body gets
            the first answer back and adds nothing. A refused request frees its
            key. Keys last a day.
          schema:
            type: string
            minLength: 8
            maxLength: 255
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - hours
                - idempotency_key
              properties:
                hours:
                  type: integer
                  minimum: 1
                  maximum: 2160
                  description: Hours to add to the end the computer has.
                  example: 720
                idempotency_key:
                  type: string
                  minLength: 8
                  maxLength: 255
                  description: >-
                    8 to 255 printable characters, such as a UUID. May be left
                    out when the Idempotency-Key header carries it. An MCP tool
                    call has no headers, so it uses this. A retry with the same
                    key gets the first answer back and adds nothing.
      responses:
        '200':
          description: >-
            The end moved. Same fields as changing the end with Update computer:
            `id`, `name`, `ends_at`, `on_end`, `ended_at` and `deletes_at`, and
            on an hourly computer `prepaid_until`, `prepaid_cents`, and when
            they apply `prepay_returned_cents` and `prepay_warning`.
        '400':
          description: >-
            `INVALID_ENDS` (`hours` is not a whole number from 1 to 2160, or the
            new end would be more than 2160 hours from now),
            `ENDS_NOT_SUPPORTED`, `idempotency_key_required` or
            `invalid_idempotency_key`.
        '402':
          description: >-
            `insufficient_credit`: the credit can't prepay the run to the new
            end. Nothing changed.
        '403':
          description: >-
            `workspace_read_only`, or a computer's own key or a key for one
            computer.
        '409':
          description: >-
            `NO_END` (it already runs until you stop or delete it),
            `END_RAN_OUT`, `COMPUTER_BUSY` (send it again),
            `idempotency_in_progress` or `idempotency_unfinished`.
        '422':
          description: '`idempotency_key_reused`: the key was used for a different body.'
        '503':
          description: '`ENDS_UNAVAILABLE` or `idempotency_unavailable`. Nothing changed.'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication. Get your key at orgo.ai/workspaces

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.