> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobilerun.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Devices

> View and manage all your devices and monitor active device streams.

The Devices tab provides a centralized overview of all devices associated with your account. Use it to monitor device status, manage your device inventory, and access active streams.

## Overview

The Devices tab displays:

* All devices allocated to your account
* Currently running devices and their streams
* Device status and availability

## Device Inventory

Your device inventory shows every device you have access to, organized by type:

| Device Type | Description |
| - | - |
| **Personal Phone** | Your own physical smartphone connected via the [Mobilerun Portal App](https://docs.mobilerun.ai/guides/connect-android.md) |
| **Android Phone** | Dedicated, persistent virtual devices with profile support |

> [!TIP]
>
> For detailed information about each device type, including pricing and capabilities, see the [Device Types](https://docs.mobilerun.ai/device-types.md) documentation.

## Device Status

Each device in your inventory displays its current status:

| Status | Description |
| - | - |
| **Available** | Device is ready to accept new tasks |
| **Running** | Device is actively executing a task |
| **Offline** | Device is not currently connected (physical devices only) |

> [!NOTE]
>
> These are the human readable labels shown in the dashboard. The API and SDK use lowercase state
> values instead. The most important one is **`ready`**, which you filter for with `?state=ready` in
> REST or with `client.devices.list({ state: ['ready'] })` in the SDK. Other API states include
> `creating`, `assigned`, `rebooting`, `resetting`, `stopped`, `terminated`, and `maintenance`.
> A `stopped` device is parked between sessions: it is switched off and not billed, but its data, installed apps, and identity are preserved so the next session resumes on the same device.

## Live Streams

When a device is running, you can view its live stream directly from the Devices tab. The stream shows:

* Real-time device screen output
* Current task execution progress
* Agent actions as they occur

Click on any running device to open its stream view.

### Camera and microphone

On devices that support it, the stream view has a **Call media** control. It sends your browser's microphone and, optionally, its camera into the device, so apps on the device see them as their own microphone and camera. Check support with `GET /devices/{deviceId}/capabilities`: `microphoneInjection`, `cameraInjection` and `mediaInjectionTransport: "direct"`.

Call media runs only from the Cloud stream view. There is no API endpoint to publish a media stream into a device.

To send another video source, such as OBS, start that tool's virtual camera (in OBS: **Start Virtual Camera**) and pick it as the camera in your browser when you start call media.

## Managing Devices

From the Devices tab, you can:

### View Device Details

Click on any device to see:

* Device specifications (model, OS version, screen resolution)
* Current task information (if running)
* Session history

### Connect Your Own Device

With a Personal Phone subscription, connect your own physical Android or iOS device using the [Mobilerun Portal App](https://docs.mobilerun.ai/guides/connect-android.md). Connected devices appear in your inventory alongside cloud-hosted devices.

### Reset a Device

Resetting returns a device to a clean state, clearing installed apps and user data accumulated during sessions. Trigger a reset through the API or SDK:

```typescript TypeScript theme={null}
import Mobilerun from '@mobilerun/sdk';

const client = new Mobilerun({ apiKey: process.env.MOBILERUN_CLOUD_API_KEY });

await client.devices.reset('deviceId');
```

```python Python theme={null}
import os
from mobilerun_sdk import Mobilerun

client = Mobilerun(api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"))
client.devices.reset("deviceId")
```

The device reports the `resetting` state for the entire reset, including the reconnection and setup steps that follow the wipe. It returns to `ready` once the reset completes.

Resetting a Personal Phone factory-resets the handset. The phone goes offline for several minutes while it wipes and reboots. Mobilerun keeps the device in `resetting` for up to 5 minutes while it waits for the phone to reconnect. When the phone comes back online, the device returns to `ready` within seconds. If the phone does not reconnect within that window, Mobilerun terminates the device.

### Stop and Resume a Device

Stopping parks a device instead of terminating it. A stopped device keeps its apps, data, and identity, but nothing runs and usage is not billed until you resume it. Use this to pause a device you are not actively using without losing its state.

```typescript TypeScript theme={null}
import Mobilerun from '@mobilerun/sdk';

const client = new Mobilerun({ apiKey: process.env.MOBILERUN_CLOUD_API_KEY });

await client.devices.stop('deviceId');

// Later, wake the same device back up
await client.devices.resume('deviceId');
```

```python Python theme={null}
import os
from mobilerun_sdk import Mobilerun

client = Mobilerun(api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"))
client.devices.stop("deviceId")

# Later, wake the same device back up
client.devices.resume("deviceId")
```

A stopped device reports the `stopped` state. Filter for parked devices with `?state=stopped` in REST or `client.devices.list({ state: ['stopped'] })` in the SDK.

Resuming wakes the same device: Mobilerun checks that capacity is available, starts the device again, and returns it to `ready`. Resuming a device that is not stopped is a no-op.

Minute-billed devices that run out of credit are parked automatically. Resume them after topping up.

> [!NOTE]
>
> Not every device supports stopping. Check the device's capabilities with `client.devices.retrieveCapabilities('deviceId')`: stopping is available when the response reports `stop: true`. Calling stop on a device without this capability returns `404`.

### Monitor Usage

Track your device utilization:

* Active session time
* Task execution history

## Billing modes

When you create a device, the `billing` query parameter on `POST /v1/devices` selects how the session is admitted and paid for. Availability of each mode depends on the device type's billing configuration.

| Mode | Behavior |
| - | - |
| `auto` (default) | Tries subscription billing first. If your account has no subscription entitlement for the type, or every subscription slot is in use, falls back to minute billing when it is enabled for the type. When subscription billing is disabled, uses minute billing directly. |
| `subscription` | Requires an active subscription entitlement and a free subscription slot. Never falls back to minutes. |
| `minute` | Uses minute billing only. Requires a sufficient credit balance and an available minute concurrency allowance. |

Billing-service errors and indeterminate responses never trigger fallback: the request fails closed so a paid session is never opened on an unverified entitlement.

Request minute billing explicitly by appending the query parameter:

```http theme={null}
POST /v1/devices?deviceType=android_cloud_phone&billing=minute
Content-Type: application/json

{}
```

> [!NOTE]
>
> The `deviceType` parameter accepts `android_cloud_phone`, `ios_phone`, or `device_slot`. Any other value, including the retired `dedicated_*` aliases, is rejected with HTTP 422. The same values apply to the `type` filter on `GET /v1/devices`. Older iOS devices are reported as `ios_phone`.

## Device creation errors

When you create a device or connect your own phone, Mobilerun validates the device type, then checks that your account has a matching subscription with a free device slot. If a check fails, the API returns one of these errors:

| Status | Code | Meaning | What to do |
| - | - | - | - |
| `422` | `DEVICE_TYPE_UNAVAILABLE` | The device type is recognized but not available for creation in this deployment. | Use a different device type. This is not fleet exhaustion, so retrying will not help. |
| `402` | `SUBSCRIPTION_REQUIRED` | Your account has no active subscription for this device type. | Subscribe or upgrade your plan, then try again. If minute billing is enabled for the type, retry with `billing=minute`. |
| `429` | `RESOURCE_EXHAUSTED` | All device slots in your plan are in use. | Terminate a device or upgrade your plan to add another. |
| `402` | `PAYMENT_REQUIRED` | The billing check could not be completed and access was denied. | Try again shortly, or contact support if the error persists. |

Example error body from a device creation request:

```json theme={null}
{
  "code": "SUBSCRIPTION_REQUIRED",
  "message": "You need an active subscription to create this device. Subscribe or upgrade your plan, then try again."
}
```

> [!NOTE]
>
> Both `SUBSCRIPTION_REQUIRED` and `PAYMENT_REQUIRED` return HTTP 402. Match on the `code` field to tell them apart. If your own phone cannot connect through the Portal app, verify that your [Personal Phone](https://docs.mobilerun.ai/device-types.md#personal-phone) subscription is active.

`SUBSCRIPTION_REQUIRED` and `RESOURCE_EXHAUSTED` only surface for explicit `billing=subscription` requests, or for `auto` requests when minute billing is not enabled for the device type. With `auto`, either denial silently falls back to minute billing when it is enabled.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.