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

# Connect locally to an Assistant

> Use the Orchestrator Proxy to connect a local client to an Assistant through Relay.

The Orchestrator Proxy lets a local client connect to an Assistant through RelayCloud. It runs on your local device and forwards HTTP, WebSocket, and server-sent event traffic to the selected Assistant.

## Start the proxy

<Steps>
  <Step title="Sign in on your local device">
    If you have not already authenticated the device, run:

    ```sh theme={null}
    relaycloud auth login
    ```

    The proxy reuses the credentials saved by this command.
  </Step>

  <Step title="Start the proxy and select an Assistant">
    Run:

    ```sh theme={null}
    relaycloud proxy serve
    ```

    When you run the command without an Assistant ID in an interactive terminal, the Orchestrator opens a selector. Choose the Assistant you want to connect to, optionally filtering by project or workspace. The proxy listens on `127.0.0.1:4090` by default. Keep this command running while you use the local client.

    You can provide an Assistant ID directly instead:

    ```sh theme={null}
    relaycloud proxy serve asst_123
    ```
  </Step>

  <Step title="Connect your local client">
    Point your local client at the proxy URL. For example, attach the OpenCode TUI with:

    ```sh theme={null}
    opencode attach http://127.0.0.1:4090
    ```

    Other compatible clients can use the same URL as their server endpoint. Requests and Assistant events are forwarded through Relay to the Assistant selected when the proxy started.

    You can also open the proxy URL in your browser to use the Web UI.
  </Step>
</Steps>

## Proxy options

Use `--host` and `--port` when you need a different local bind address or port:

```sh theme={null}
relaycloud proxy serve asst_123 --host 127.0.0.1 --port 4091
```

If you omit `--port` and port `4090` is already in use, the proxy asks the operating system for an available port and displays the resulting URL. An Assistant ID is required when you run the proxy without an interactive terminal.
