Skip to main content
POST
Run a task on a phone

Authorizations

X-Api-Key
string
header
required

Workspace API key, created in the dashboard under Settings → API Keys.

Headers

Idempotency-Key
string

Caller-provided key for safe retries. The same key in the same workspace yields the same run id, and a duplicate POST within the retention window returns the original run instead of starting a second one.

Maximum string length: 256

Body

application/json
prompt
string
required

The task, in plain words.

Required string length: 1 - 8192
schema
object

JSON Schema the final answer must satisfy. The run holds the answer to it, and the task's data is that answer.

device
string

The id of the phone to run on. Pass it when the workspace has more than one phone.

Maximum string length: 512
workspaceId
string<uuid>

Workspace scope for a credential that can reach several. A workspace-bound API key may omit it.

expiresIn
integer

Shortens the viewer link's life, in seconds (it is capped at six hours). The run's own end always shortens it further, so this only ever makes a link expire sooner. A viewer link is a credential: hand out the shortest one that does the job.

Required range: x >= 30
maxCredits
integer
default:10000

The most credits this run may spend. The run stops once its charge would pass it: the task ends failed with stopReason: "credit_limit_reached" and is charged at most maxCredits. Without it a default cap applies; pass a higher or lower number to replace it. Applies to this run, not to later interact turns.

Required range: 1 <= x <= 999999999999999

Response

Task accepted

id
string
required

The task id, which is also the id of its session.

liveViewUrl
string

A link to watch this run's phone live, with no Lusor login: a bare player page you can embed in an iframe. It is watch-only (its stream carries video only and the server refuses taps, typing and keys for it), and it opens for this run only. Omitted when the run is not recording or the phone cannot serve it.