Start an agent run in the background
Give the computer a job and walk away: the same loop as POST /computers/{id}/agent, with the same body except stream (refused) and store: false (refused: a background run is kept so it can be read back), started and then read back by id instead of streamed. The run goes on when this request ends, and is not cut at the edge after 120 seconds the way a non-streaming agent call is.
This answers 202 once the run holds the computer, with the run as it stands (status: "running"). What refuses a run before that — an unknown or just-deleted computer (404), one not running (409), one already driven or whose workspace is changing (409 with reason: "contention"), a credential refused, the funded credit hold — is answered here as its own status with {error, reason?, top_up_url?}, and no run is recorded. Everything after it, the model API’s errors included, ends the run as failed with that error.
Poll GET /agent/runs/{run} for its steps, cost and ending, or cancel it with POST /agent/runs/{run}/cancel. A run keeps its thread as the agent route does, and thread_id on the run says which. X-Model-Key is held in memory for the run’s life and never stored. The run uses the API key that started it: deleting that key stops it at its next step, as on the agent route. A run the control plane was executing when it restarted is marked interrupted, with the steps it had taken; it is not resumed. Inspect the desktop before starting another.
The screenshot each step returns, the one the model is shown next, is kept with the run for seven days (within per-run and per-account size limits) so the run can be replayed step by step on the computer’s Activities tab in the dashboard. Those screenshots show whatever was on the screen, so treat them as being as sensitive as the desktop. They are deleted with the run, and with its computer.
Requires the member role or higher.
Request
- Base URL: https://app.mandala.computer/api/v1
- URL: https://app.mandala.computer/api/v1/computers/{id}/agent/runs
- Auth: HTTP bearer
Path parameters
The computer id.
Headers
As on POST /computers/{id}/agent. Held in memory while the run goes, and never stored.
Request body
Response
The run, running.
Changes
No recorded changes to this operation across all 1 revision of this API.