Skip to main content
If you run a platform, you can give each of your users their own Mobilerun phone. An AI agent works on that phone, and your user can watch it live in your app and take over at any time. This guide shows the steps in order. Your backend does the work with one API key. Your app only shows the phone.
Your API key is a backend secret. Anyone who holds a phone’s stream token can see and control that phone. Your backend must check which user owns which phone before it hands out the token.

What your users see

Illustration — in your app, DeviceStream shows the user’s phone live, on Android and iPhone.

@mobilerun/react on GitHub

The preview shows the component from this repository. It has the source, a local playground, and the npm package.

Kotlin

Coming soon

Swift

Coming soon

Flutter

Coming soon

Build it step by step

1

Create an API key

Create an API key in API keys. Store it as a secret in your backend, for example as MOBILERUN_API_KEY. Never put it in browser code.
2

Optional: add your own LLM key

By default the agent uses Mobilerun’s models and you pay with credits. If you prefer, you can use your own LLM key (BYOK).
  1. Open Billing → LLM keys. Only owners and admins can add keys.
  2. Add a key from OpenAI, Anthropic or Google.
  3. The Routing card now lists the models that run on your key. Use one of them as llmModel when you run a task.
The token cost goes to your provider. Mobilerun charges a small platform fee in credits instead. See Credits.If your key is rejected or your provider is down, the run continues on Mobilerun’s models and uses normal credits. Keep some credits in your account.
3

Create a phone for each user

Create a phone when a user signs up, or the first time they need one. Save its ID with your user record. See device types for the options.
4

Run a task

Describe what the agent should do in plain language and give it the phone ID. To get the answer back in a fixed shape, add an outputSchema.
If you use your own LLM key, set llmModel to a model from the Routing card. See Agent for all request fields and Run Task in the API reference.
5

Follow the task and get the result

Pick the way that fits your product:
While a task is running, you can also send a follow-up message or stop it:
With an outputSchema, the result is in output, in the shape you defined. See Tasks.
6

Show the phone in your app

Your backend checks that the user owns the phone, then returns its streamUrl and streamToken. Your app shows the phone with @mobilerun/react:
The embed guide has the full backend route and the checks to make. The component is on GitHub and npm.
7

Let the user take over

Some steps should be done by the user, for example a payment. Tell the agent where to stop in the task text:
The task ends at that point. Your app already shows the live phone, so the user finishes the payment there. With hasControl set, the user can tap and type on the phone.For native iOS or Android apps, contact us.
8

Stop the phone between sessions

Stop a phone when the user is away. It keeps its apps and logins and uses no phone minutes. Resume it when the user comes back. Terminate it when the user leaves for good.See Stop and resume a device.

What it costs

  • Phone minutes, while a phone is running.
  • Credits for the agent’s model use. With your own LLM key, you pay your provider and Mobilerun charges a small platform fee in credits.
  • Proxies, Cloud Numbers, mailboxes and cards, if you use them. See the identity stack.
See Credits for details. To talk about a partnership, write to contact@mobilerun.ai.