Talk to Kira from your phone through your own domain.
OpenCohost 0.5.0 includes an opt-in remote voice gateway. It is a second, small server on 127.0.0.1:8780, separate from the main API. Your phone turns speech into text in its browser, sends the text to your PC through a Cloudflare Tunnel on your own domain, gets Kira's final reply and reads it aloud with the phone's own voices. Kira also speaks on the PC. You set up the tunnel yourself; OpenCohost never starts one.
The gateway is off until you switch it on. It only answers a short list of routes, each phone must pair with a one-time code, and Cloudflare Access asks you to log in before anyone reaches it. If a step is missing, the phone simply cannot connect.
How a phone turn travels
Phone browser
Speech becomes text in the browser, or you type the message.
Your domain
Cloudflare Access login, then your Cloudflare Tunnel.
Gateway on 8780
Opt-in loopback server with a small allowlist of routes.
Kira on your PC
The text is handled like a typed turn; the final reply returns to the phone.
Setup path
- 1Enable the gateway: set OPENCOHOST_REMOTE_GATEWAY=1 in the environment of the process that starts the backend, then restart the app. Optionally set OPENCOHOST_REMOTE_GATEWAY_PORT (default 8780). The desktop app starts the backend with the environment of the terminal or Windows user that launched it, so set the variable there first.
- 2Check it: open http://127.0.0.1:8780/status in a browser on the PC. It should answer.
- 3Install cloudflared yourself, log in and create a named tunnel. Add a public hostname on your own domain (for example kira.example.com) that points to http://127.0.0.1:8780. Never target 8765 or 8770.
- 4Put Cloudflare Access in front: in Cloudflare Zero Trust create a self-hosted Access application for that hostname, with a policy that allows only your own email through the email one-time PIN login. This blocks scanners and anyone guessing pairing codes before they reach the gateway.
- 5Pair the phone: in the desktop app open Controles, find the "Link phone" panel in the Voice pane (right after the push-to-talk card) and set the public URL (https://kira.example.com). Generate a code: it lasts 120 seconds, works once and is burned after 5 wrong attempts. Open the link on the phone, pass the Access login and name the device. The phone receives a device token.
- 6Use it: hold the button to talk or type in the text box. The phone shows the reply and reads it with its own voices.
- 7Lost phone? Revoke the device in the "Link phone" panel; its token stops working at once.
Security checklist
Opt-in
Off by default. With the flag off nothing listens on 8780 and the main app is unchanged.
Loopback only
The gateway binds 127.0.0.1. Exposing it beyond your PC is your decision and happens only through your own tunnel.
Allowlist
It serves only the phone page, a status check, pairing, sending a turn and polling the reply; every other path returns 404.
Pairing and tokens
Pairing codes live in memory for 120 seconds and work once. The PC stores only a hash of each device token, never the raw token.
Outer gate
Cloudflare Access with your email only is the intended outer layer; the gateway's own checks are a second layer, not a replacement.
No message text in logs
Gateway logs carry device ids, counts and outcome codes only. Phone messages appear in the desktop conversation as "Remote message" and stay in memory only.
Commands and config
OPENCOHOST_REMOTE_GATEWAY=1http://127.0.0.1:8780/statusingress:
- hostname: kira.example.com
service: http://127.0.0.1:8780
- service: http_status:404