Skip to main content
Agent runs a task on a phone from one prompt. You say what you want in plain words, an AI agent works the phone’s apps to get it, and the task returns the answer as data: text, or the object your JSON Schema describes. Every run is recorded. Use agent when the work needs judgment: signing in, searching, filling a form, or moving through an app to reach the data. When you already know the screen, Scrape reads it with fixed rules and no agent. To find the screens Lusor knows in an app, use Map. To keep working on the screen a task ended on, send it a turn with Interact. There is no app field. Name the app in the prompt.

Run a task

Agent is a task. Start it with POST /v1/agent, then read it with GET /v1/agent/{id}.
The request returns 202 with the task’s id at once:
Read the task until its status is neither processing nor awaiting_human. $TASK_ID is the id the start call returned:

Response

Get the answer in your shape

Send schema, a JSON Schema, and data is the object it describes. Without it, data is the agent’s answer as text. Describe the task in prompt and the result’s shape in schema. Mark the fields you always need as required, and use description to say what a field means. Structured output has more on writing a schema.

Start and status

Every agent call is a task: it holds a phone while the agent works, so the request returns at once and you read the result when it is ready. status is one of: The first read that says completed carries data, and the first that says failed carries error, so you can stop at the first status that is neither processing nor awaiting_human. The task id is also the id of its session, so the session endpoints work on it:

Watch it run

While the task runs, liveViewUrl is a watch-only link to the phone: a player page you can open or embed with no Lusor login. Taps and typing through it are refused, and it stops working when the task ends. Send expiresIn (seconds) in the body, or as a query parameter on the status read, to make the link expire sooner. The response leaves liveViewUrl out once the run has ended, or when the phone cannot serve one.

A busy phone queues the task

A phone runs one task at a time. A task sent to a phone that is running another task waits, reading processing, and starts when the phone frees. Its response then carries metadata with concurrencyLimited: true and concurrencyQueueDurationMs, the time from your request to the phone taking it. A task that found the phone free has no metadata. A task still waiting after 15 minutes fails with queue_expired, without starting, and is not charged.

Retry safely

Send an Idempotency-Key header with a value you choose. A retry with the same key returns the first request’s task id instead of starting a second run.

Spending cap

maxCredits is the most credits a run may spend. The run stops once its charge would pass it: the task ends failed, with error set to Agent reached max credits and stopReason set to credit_limit_reached, and it is charged at most maxCredits. Without maxCredits a default cap applies. Send a number to replace it.
creditsUsed is what the task has been charged so far. Charges are written when a run ends, so a running task reads less than it will cost. Phone minutes on a Lusor Phone are billed apart and are not in it. See Credits and minutes.

Options

Fields agent does not know are ignored.

Errors

Errors are JSON with an error code and a message. See Errors.

Known limits

  • data is filled only on a completed task. A task that fails or is stopped returns no partial answer.
  • One task per phone at a time. Tasks on the same phone run one after another. To run tasks side by side, send them to different phones with device.
  • The answer leaves with your history. After expiresAt, the task’s answer is no longer kept.

Scrape

Read a screen you already know, with no agent.

Map

List the screens Lusor knows in an app.

Interact

Keep working on the screen this task ended on.