computers

Start a computer, optionally for a set number of hours

Changed on

Starts a stopped computer (a running one answers success). Body, all optional: async (true answers 202 at once with an operation to poll), and when it ends: ends_in_hours (1 to 720, counted from when it is running) or ends_at (ISO 8601, in the future, at most 720 hours away), not both; null for either keeps it forever. When the end is up the computer is deleted, with everything on it. on_end is not a choice: "delete" is accepted with an end and changes nothing, alone it is a 400 (a Start never touches the end a computer already has), and any other value ("stop" included) is a 400. The end is checked as PATCH /api/computers/{id} checks it, before anything starts: a bad one is a 400 and nothing starts. It is set only once the computer is running, as PATCH sets it, so a Start that fails holds no credit and leaves no clock running. A computer stopped when its time ran out comes back with the new end (with none, its end is cleared). A running hourly computer prepays its run to the end, under the same rule as PATCH (the workspace owner, and on a paid plan only signed in or with a key that has Billing write); when the credit is short or the caller may not prepay, the end is still set, the time is billed by the hour, and the answer says prepay_warning. An end that could not be set never fails the Start: the 200 carries end_not_set with why (error) and a code. With async, the 202 says end_pending, and the operation’s result carries the end once it is running.

post/api/computers/{id}/start

Request

  • Base URL
    https://www.orgo.ai
  • Auth
    HTTP bearer

Path parameters

idstring required

Request body

asyncboolean
ends_in_hoursinteger nullable
ends_atstring date-time nullable
on_end'delete' | 'null' nullable

Not a choice: a computer with an end is deleted when its time is up, running or not, with everything on it. "delete" is accepted and changes nothing; omitted or null is the same. Any other value, "stop" included, is 400 INVALID_ENDS: "A computer with an end is deleted when its time is up. To keep a computer, leave out the end." On a computer (GET, the listing, and the create, PATCH, Start and Resume answers) on_end is read only: "delete", "stop" for a computer whose end was set before this rule (stopped then, and deleted 7 days later unless it is started), or null with no end.

Response

Started: success, and with an end ends_at, on_end (read only), ended_at and deletes_at, and for an hourly computer prepaid_until, prepaid_cents and prepay_warning when it was not prepaid. end_not_set (error, code) when the end could not be set; the computer is running.

Changes