Only Linux and Windows computers, on your plan or billed by the hour, can have an end. Mac, iPhone, Android and device computers can’t.
Pick an end in the dashboard
In the New computer sheet, the Ends row says Never. Press Change next to it and pick one:
The price line under it says what the end costs, as described in What an end costs.
When time is up
- It stops. Its disk is kept, the same as when you stop it yourself.
- It is deleted 7 days later, unless you start it. Its page and its tile say Its time ran out. Deleted on the date unless you start it.
- Starting it brings it back as an ordinary computer: its end is cleared. To give it a new end instead, start it from the API with one, as described in Start or resume with an end.
Keep it, or change the end
While a computer has an end ahead, its page and its tile say how long it has left, for example Ends in 3h 12m. Press Keep it beside it to take the end off. The computer then runs until you stop or delete it. Anyone who can change the workspace’s computers can keep one. To move the end to another time, use the API, as described in Move or clear the end.From the API
Every call below uses an API key: replace$WORKSPACE_ID with your workspace and $COMPUTER_ID with the computer’s UUID.
Create a computer with an end
Sendends_in_hours, 1 to 720. Leave it out, or send null, and the computer never ends.
201 carries ends_at, when it stops. An hourly computer also carries prepaid_until and prepaid_cents, as described in By the hour, the run is prepaid. If the computer was made but can’t have an end, ends_at is null and ends_warning says why: This computer can’t have an end, so it keeps running until you stop it. See Create computer.
Move or clear the end
PATCH /computers/{id} takes one of:
ends_in_hours: 1 to 720, counted from now.ends_at: an ISO 8601 time in the future, at most 720 hours away."ends_at": null: no end. The computer runs until you stop or delete it.
id, name, ends_at, ended_at and deletes_at. An hourly computer’s answer also carries prepaid_until and prepaid_cents, and prepay_returned_cents when some of its prepay came back. Any change clears a stopped computer’s ended mark, so "ends_at": null also keeps a computer whose time ran out, without starting it. Sending back the ends_at the computer already has changes nothing, so you can PATCH the object Get computer gave you. See Update computer.
Start or resume with an end
Start computer and Resume computer (for a sleeping computer) takeends_in_hours or ends_at in the body, checked the same way as on PATCH. The hours count from when the computer is running, not from the request, because a start can take minutes.
end_not_set with an error and a code. With async, the 202 says end_pending. A resume that is still under way answers 202 with end_not_set and code STILL_RESUMING: set the end with PATCH once it is running.
Read the end
Get computer returns:What an end costs
How a computer is paid for decides what its end costs. See How a computer is paid for.On your plan, nothing extra
A computer on your plan costs nothing more with an end. The sheet says Included in your plan. The end only decides when it stops. A plan computer given an end later stays on the plan.By the hour, the run is prepaid
An hourly computer with an end pays for its whole run up front, from your credit: its running rate times the hours. For a Medium Linux computer with a 4 hour end, the sheet says Prepay $0.22 from your credit: $0.055/hr for 4 hours. Unused time comes back. Then $0.0034/hr while kept 7 days.** On the computer, the line beside its end says **Prepaid $0.22 until and the time.- It never runs out of credit before its end. The prepay covers the whole run.
- Unused time comes back to your credit, once: when it stops before its end, is deleted, is kept, moves onto your plan, or its end moves earlier. Keep it says how much came back.
- A later end prepays the extra. Without enough credit, the change answers
402and nothing changes. - It leaves an hour for your other hourly computers. A prepay never takes the credit your other hourly computers need for their next hour. When that applies, the sheet adds Needs an amount more for an hour of your other computers.
- After its end it is stopped and billed at the stopped rate while it is kept, then deleted 7 days later.
- A start without an end bills by the minute, as any hourly computer does. A start with an end prepays once the computer is running.
"billing_mode": "hourly" with ends_in_hours. Only the workspace owner can launch by the hour, and on a paid account only signed in or with a key that has Billing write (an MCP sign-in, or a key without Billing write, gets 403 with code HOURLY_NEEDS_BILLING). Send an Idempotency-Key with a UUID, so a retry launches it once.
201 says what was prepaid:
409 with code FITS_PLAN: This computer fits your plan. Launch it on the plan. Leave out billing_mode and it launches on the plan.
Who can prepay
Only the workspace owner can prepay. On a paid account, or one set to pay for every computer from credit, that means signed in or with a key that has Billing write, not through an MCP sign-in. Anyone else who can change the workspace’s computers can still set or move an end: nothing more is held, the time past what is prepaid is billed by the minute, and the answer carriesprepay_warning.
A first end on a running hourly computer is never refused for credit. When your credit can’t prepay it, the end is still set, the time to it is billed by the minute, and the answer carries prepay_warning: The new end is set, and the time to it is billed by the minute: your credit does not cover prepaying all of it.