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
- Android
- iPhone
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).
- Open Billing → LLM keys. Only owners and admins can add keys.
- Add a key from OpenAI, Anthropic or Google.
- The Routing card now lists the models that run on your key. Use one of them as
llmModelwhen you run a task.
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
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 The embed guide has the full backend route and the checks to make. The component is on GitHub and npm.
streamUrl and streamToken. Your app shows the phone with @mobilerun/react: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.