Black Friday deposit bonus·Top up $50+ and get $10 · Top up $100+ and get $25·Ends November 30Top up →
Use case

A cloud AI agent with a browser and an Android phone

Give a hosted AI agent a real browser for websites and a cloud Android phone for apps, and let it work across both from one API key and one balance.

Last updated 2026-11-05

Prepaid, no subscriptionREST or MCPOne key for models, data and agents
portal.example.com/applyFull nameAda LovelaceEmailada@example.comPassword••••••••••2FA code492 817Submitagentopen pagetype nametype emailfill passwordenter 2FAclick Submit✓ done
Black Friday

Black Friday deposit bonus

Every qualifying top-up earns free credit, on top of any other offer.

Ends November 30

Deposit $50
+$10
20% bonus
Deposit $100
+$25
25% bonus
Sign up and claim

Plenty of jobs cross the line between the web and an app. Compare what a service offers on its website with what its Android app shows. Set something up in a web dashboard and check that it arrived on the phone. Read an order on one side and act on it on the other. An agent that only has a browser, or only a phone, gets half of these done. Lovely Router has both: cloud agents that run in their own sandbox and drive a real browser through the browser agent, and cloud phones, real Android 14 phones with their own phone agent. This page shows how to put them together today, and is exact about which parts are built in and which parts you wire up.

Hand it to your AI agent

Copy this prompt into Claude Code, Cursor, Codex or any coding agent. It tells the agent where the docs are and how to use your API key.

Create a Lovely Router cloud agent that does the web part of a task with its browser tools, run the app part on a cloud phone, and combine the answers.

- Docs (read first): https://lovelyrouter.com/docs/agents.md and https://lovelyrouter.com/docs/api/agents.md and https://lovelyrouter.com/docs/api/phones.md
- Cloud agent: POST https://lovelyrouter.com/v1/agents, then POST .../<id>/runs with the task (it has the browser agent among its tools). Phone: create one with POST https://lovelyrouter.com/v1/phones and start an agent run there from this project; pass the phone's answer into the next agent run.
- Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt.

My task: <the website, the app and what to compare or do on each>
01

What is built in, and what you connect

search_toolsrun_toolget_run
PieceHow the agent reaches it
BrowserBuilt in. Every cloud agent gets the browser agent as MCP tools (browser_run, browser_status, browser_reply, browser_takeover), next to web search, page reading and the data tools.
Web search, page reading, data tools, imagesBuilt in, as MCP tools on the same server.
Android phoneNot one of the agent's built-in tools. Your app runs the phone through /v1/phones, or you give the agent phone tools through an MCP server of your own.

Both ways use the same API key and prepaid balance, so the agent's sandbox time, its model tokens, browser steps and phone minutes all come out of one account.

02

Pattern 1: your app runs the agent and the phone

The simplest setup keeps your backend in charge. It sends the web part to the cloud agent as a run, sends the app part to a phone as a goal, and hands each result to the other. The cloud agent's runs API keeps a session, so a follow-up run continues the same conversation.

  1. Ask the agent to do the web part

    POST /v1/agents/{id}/runs with the task. The agent decides to use browser_run for pages it has to click through, or web_fetch for pages it only needs to read.

  2. Give the phone its goal

    POST /v1/phones/runs with a goal built from the agent's answer, and the app's APK in apps. Poll the run until it ends.

  3. Bring the phone's answer back

    Send the phone's answer to the agent in a second run with the first run's session_id, so it compares, reports or carries on with everything it already knows.

Python
import os, requests

BASE = "https://lovelyrouter.com/v1"
H = {"Authorization": f"Bearer {os.environ['LOVELY_API_KEY']}"}

agent = requests.post(f"{BASE}/agents", headers=H, json={"name": "web-and-app check"}).json()

# 1. The web part: the agent uses its browser tools.
web = requests.post(f"{BASE}/agents/{agent['id']}/runs", headers=H, timeout=320, json={
    "input": "Open https://example.com/plans in the browser. List every plan's name and what it includes, "
             "as a JSON array of {plan, features}. Reply with the JSON only.",
    "wait": 300,
}).json()

# 2. The app part: a phone with the app installed works a goal built from that answer.
phone_run = requests.post(f"{BASE}/phones/runs", headers=H, json={
    "goal": "Open the Example app, go to the plans or upgrade screen, and list every plan's name and "
            "what it includes, exactly as the app shows them.",
    "apps": ["example-app.apk"],
}).json()
while phone_run["status"] in ("queued", "running"):
    phone_run = requests.get(f"{BASE}/phones/runs/{phone_run['id']}", headers=H, params={"wait": 50}).json()

# 3. Back to the agent, in the same session.
report = requests.post(f"{BASE}/agents/{agent['id']}/runs", headers=H, timeout=320, json={
    "input": "Here is what the Android app shows:\n" + (phone_run["answer"] or phone_run["error"] or "")
             + "\nCompare it with the website's plans you found. Write compare.md and present it.",
    "session_id": web["session_id"],
    "wait": 300,
}).json()
print(report["output"])
for f in report["files"]:
    print(f["path"], f["url"])

A run that hasn't finished within wait comes back unfinished: read it again with GET /v1/agents/{id}/runs/{run_id}?wait=30, or send "stream": true to follow its events as they happen. A stopped agent wakes up by itself for a run and stops about 5 seconds after its last run ends, so between steps of a pattern like this it costs nothing. The phone stays yours after its run, with the app and any login, until it has been idle for an hour; send the next goal to it with POST /v1/phones/{phone_id}/runs.

03

Pattern 2: give the agent phone tools of its own

To let the agent decide when it needs the phone, give it phone tools. Each cloud agent takes up to 8 remote MCP servers of your own (streamable HTTP, a public https:// URL, optional headers that are stored encrypted). Host a small MCP server that wraps /v1/phones with your key, then add it to the agent:

cURL
curl -X PATCH https://lovelyrouter.com/v1/agents/agt_... \
  -H "Authorization: Bearer $LOVELY_API_KEY" \
  -H "content-type: application/json" \
  -d '{"mcp_servers": [{"name": "phone", "url": "https://tools.yourcompany.com/mcp",
        "headers": {"Authorization": "Bearer your-own-server-secret"}}]}'

A minimal server with the official MCP Python SDK can expose one tool that runs a goal on a phone and returns its answer:

Python (your MCP server)
import os, time, requests
from mcp.server.fastmcp import FastMCP

API = "https://lovelyrouter.com/v1/phones"
H = {"Authorization": f"Bearer {os.environ['LOVELY_API_KEY']}"}
mcp = FastMCP("phone")

@mcp.tool()
def phone_goal(goal: str, phone_id: str = "") -> str:
    """Work a goal on a cloud Android phone and return the answer. Pass phone_id to reuse a phone."""
    body = {"goal": goal, "wait": 50, **({"phone_id": phone_id} if phone_id else {"apps": ["example-app.apk"]})}
    run = requests.post(f"{API}/runs", headers=H, json=body, timeout=70).json()
    while run["status"] in ("queued", "running"):
        run = requests.get(f"{API}/runs/{run['id']}", headers=H, params={"wait": 50}, timeout=70).json()
    return f"phone {run['phone_id']}: {run['status']}: {run.get('question') or run['answer'] or run['error']}"

mcp.run(transport="streamable-http")

Put it behind HTTPS and check the header on every request: anyone who can reach the server can spend from your balance. Settings apply from the agent's next start. Phone calls made by your server use your key, so they count against that key's limits, not the agent's own budget. Many MCP clients give up on a tool call after about a minute; a long phone goal may need a second tool that reads a run by id instead of waiting for it.

04

The browser side in detail

Inside the agent, browser_run starts a run from a goal and a start URL and returns its state after about 45 seconds; browser_status waits for more. Runs can return structured data (output_schema), log in with secrets from your vault by name, and pause for a person: browser_reply answers a question and browser_takeover hands the browser to a person with a live view. The browser runs in the cloud and can't open localhost or private addresses, so it works on public sites, not on a server the agent starts in its own sandbox. When the agent's session ends, browser runs it started stop too. See the browser agent docs for modes and limits.

05

The phone side in detail

A phone run works a goal in plain words: in the default smart mode a chat model calls one action per step (tap, type, swipe, scroll, open an app and so on), and in fast mode a fast decision model picks the steps with a coach beside it. When it needs something only a person has, such as a code sent by text message, the run turns waiting with a question; your code answers with POST /v1/phones/runs/{id}/reply. POST /v1/phones/{id}/screen returns a live screen link for a person to watch or take over. Apps come from APK files: any .apk, .apks or .xapk, by link or uploaded once. See the phone docs.

06

What you pay

Price
Cloud agent sandbox (small)$0.05 per hour while it runs, per second
Browser agent$0.006 per step in fast mode, $0.012 in accurate mode
Phone$1.20 per awake hour, billed per minute; free while asleep
ModelsThe agent's and the phone agent's tokens at the normal API price

There is no subscription. A cloud agent can carry a budget that stops it once its sandbox time plus its own model and tool spend reach it. Phones are limited to 3 per account at a time and agents to 20 running. One prepaid balance pays for everything above, plus data tools.

07

Frequently asked questions

?
Can the cloud agent use the phone by itself?+

Not out of the box: phones aren't among its built-in tools. Either your app runs the phone and passes results to the agent, or you give the agent phone tools through an MCP server you host that calls /v1/phones with your key.

Does the cloud agent have a browser?+

Yes. Every cloud agent has the browser agent as MCP tools, along with web search, page reading and the data tools, unless you turn tools off in its settings.

Can a person step in on either side?+

Yes. A browser run can pause for a person's answer or hand over the browser with a live view, and a phone run can ask a question or be taken over from its live screen link.

Is everything billed to one account?+

Yes. The agent's sandbox, its model and tool calls, browser steps and phone minutes all come from the same prepaid balance.

Can I do this for each of my own users?+

Yes. Create one agent per user with your own id for them in user, and pass the same id when you create their phones, so you can list each user's agents and phones.

For agents that serve your users under your own brand, see white-label agents; to test your own app on phones, see AI mobile app testing.

One prepaid key for models, data and agents

No subscription. Top up, use what you need, see every charge in your logs.