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

# Device API

> Changelog and migration steps for the Device API

export const Separator = () => {
  return <div className="border-t border-white opacity-10 my-2" />;
};

export const POST = () => <Badge color="blue">POST</Badge>;

export const GET = () => <Badge color="green">GET</Badge>;

export const DeviceApiReleaseLinks = ({version}) => {
  return <ul>
      <li>
        API reference:{' '}
        <a href={`/references/device-api/${version}`} target="_blank" rel="noopener noreferrer">
          {version}
        </a>
      </li>
      <li>
        OpenAPI spec:{' '}
        <a href={`https://assets.mirurobotics.com/docs/openapi/device/${version}.yaml`} target="_blank" rel="noopener noreferrer">
          Download YAML
        </a>
      </li>
    </ul>;
};

export const Dropdown = ({title, defaultOpen = false, children}) => {
  const [isOpen, setIsOpen] = React.useState(defaultOpen);
  function cn(...inputs) {
    return inputs.filter(Boolean).join(' ');
  }
  return <div>
            <button className="w-full flex justify-between items-center py-3 bg-transparent 
                border-none cursor-pointer text-left" onClick={() => setIsOpen(!isOpen)} aria-expanded={isOpen}>
                <span className="font-bold text-gray-100 text-md">
                    {title}
                </span>
                <svg className={cn("transition-transform duration-200 opacity-50 flex-shrink-0", isOpen && 'rotate-90')} width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
                    <polyline points="6 4 10 8 6 12"></polyline>
                </svg>
            </button>

            {isOpen && <div className="pb-3 space-y-4">
                    {React.Children.map(children, (child, i) => <div key={i}>{child}</div>)}
                </div>}
        </div>;
};

# v0.2.1

*April 7, 2026*

The `v0.2.1` release adds real-time event streaming via Server-Sent Events (SSE). On-device applications can subscribe to a persistent event stream instead of polling for deployment status changes.

<DeviceApiReleaseLinks version="v0.2.1" />

## New endpoints

<Dropdown title="Events">
  * <GET /> `/events` — stream events via Server-Sent Events (SSE)
</Dropdown>

## Additive changes

<Dropdown title="Event types">
  Two event types are emitted for deployment lifecycle transitions:

  * `deployment.deployed` — a deployment's config instances have been written to the device's file system
  * `deployment.removed` — a deployment's config instances have been removed from the device's file system
</Dropdown>

<Separator />

<Dropdown title="Event replay">
  The SSE events endpoint supports cursor-based replay via the `?after=<id>` query parameter or the `Last-Event-ID` HTTP header, allowing clients to resume from a known position after reconnection.

  ```bash theme={null}
  # Resume from event ID 42 using the query parameter
  curl --no-buffer \
    --unix-socket /run/miru/miru.sock \
    --request GET \
    --url http://localhost/v0.2/events?after=42

  # Or using the standard SSE reconnection header
  curl --no-buffer \
    --unix-socket /run/miru/miru.sock \
    --request GET \
    --url http://localhost/v0.2/events \
    --header "Last-Event-ID: 42"
  ```
</Dropdown>

<Separator />

<Dropdown title="Event filtering">
  SSE events can be filtered by type using the `?types=` query parameter.

  ```bash theme={null}
  # Only receive deployment.deployed events
  curl --no-buffer \
    --unix-socket /run/miru/miru.sock \
    --request GET \
    --url http://localhost/v0.2/events?types=deployment.deployed
  ```
</Dropdown>

# v0.2.0

*March 13, 2026*

The `v0.2.0` release expands the Device API from basic device health/version endpoints to deployment-pipeline visibility.

The current release version and current deployment endpoints are the most exciting, enabling on-device applications to verify that the release version of the config instances matches the application's software version and programmatically inspect the deployment pipeline from the device itself.

<DeviceApiReleaseLinks version="v0.2.0" />

## New endpoints

<Dropdown title="Deployments">
  * <GET /> `/deployments/current` — get currently deployed deployment
  * <GET /> `/deployments/{id}` — get a deployment by ID
</Dropdown>

<Separator />

<Dropdown title="Releases">
  * <GET /> `/releases/current` — get the currently deployed release
  * <GET /> `/releases/{id}` — get a release by ID
</Dropdown>

<Separator />

<Dropdown title="Git commits">
  * <GET /> `/git_commits/{id}` — get a git commit by ID
</Dropdown>

## Breaking changes

<Dropdown title="Base path change">
  The URL version prefix changed from `/v1` to `/v0.2`. Update all request URLs in your client application.

  ```diff theme={null}
  - http://localhost/v1/{endpoint}
  + http://localhost/v0.2/{endpoint}
  ```
</Dropdown>

<Separator />

<Dropdown title="Version response">
  The `GET /version` response renamed `commit` to `git_commit`.

  ```diff theme={null}
   {
     "version": "0.7.0",
  -  "commit": "abc1234"
  +  "git_commit": "abc1234",
   }
  ```
</Dropdown>

## Additive changes

<Dropdown title="Version response">
  The `GET /version` response added richer information about the agent and API version.

  ```diff theme={null}
   {
     "version": "0.7.0",
     ...
  +  "api_version": "0.2.0",
  +  "api_git_commit": "def5678",
  +  "rust_version": "1.83.0",
  +  "build_date": "2026-02-15T00:00:00Z",
  +  "os": "linux",
  +  "arch": "aarch64"
   }
  ```
</Dropdown>

## Python SDK

Beginning with the `v0.2.0` Device API release, the Python SDK is published from [python-device-sdk](https://github.com/mirurobotics/python-device-sdk) and uses the `miru_device_sdk` import path.

```diff theme={null}
- from miru_agent_sdk import Miru
+ from miru_device_sdk import Miru
```

The previous Python SDK was published to [python-agent-sdk](https://github.com/mirurobotics/python-agent-sdk) and used the `miru_agent_sdk` import path.

Furthermore, SDK `v0.3.0` marks the major version rollout of the `v0.2.0` Device API. For the latest SDK version compatibility information, see the [Device SDKs](/developers/device-api/sdks) page.

## Migration steps

<Steps>
  <Step title="Verify agent compatibility">
    Ensure all devices in your fleet are running **Miru Agent v0.7.0** or later. See the [agent compatibility matrix](/developers/device-api/versions#agent-compatibility-matrix) for details.
  </Step>

  <Step title="Migrate breaking changes">
    Migrate your client application according to the breaking changes listed above.

    If you are using the [Python SDK](/developers/device-api/sdks#python), migrate from the legacy repository [`python-agent-sdk`](https://github.com/mirurobotics/python-agent-sdk) to [`python-device-sdk`](https://github.com/mirurobotics/python-device-sdk). This migration includes updating imports from `miru_agent_sdk` to `miru_device_sdk`.

    ```diff theme={null}
    - from miru_agent_sdk import Miru
    + from miru_device_sdk import Miru
    ```
  </Step>

  <Step title="Optionally integrate new endpoints">
    Integrate with the new deployments, releases, and git commits endpoints to inspect the deployment pipeline from your device.
  </Step>
</Steps>

***

# v0.1.0

*September 21, 2025*

Initial release of the Device API. This version establishes the core on-device integration surface, including health checks, version metadata, device metadata, and a manual sync trigger.

<DeviceApiReleaseLinks version="v0.1.0" />

## Endpoints

<Dropdown title="Agent">
  * <GET /> `/health` — retrieve the health of the agent
  * <GET /> `/version` — retrieve the version of the agent
</Dropdown>

<Separator />

<Dropdown title="Device">
  * <GET /> `/device` — retrieve the device
  * <POST /> `/device/sync` — manually force a device sync
</Dropdown>

## Python SDK

The initial `v0.1.0` release used the legacy Python SDK repository [`python-agent-sdk`](https://github.com/mirurobotics/python-agent-sdk) and the `miru_agent_sdk` import path.

Current Device API Python SDK releases are published from [`python-device-sdk`](https://github.com/mirurobotics/python-device-sdk) and use the `miru_device_sdk` import path.
