Skip to content
Remote voice gateway

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.

Plain-language version

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

1

Phone browser

Speech becomes text in the browser, or you type the message.

2

Your domain

Cloudflare Access login, then your Cloudflare Tunnel.

3

Gateway on 8780

Opt-in loopback server with a small allowlist of routes.

4

Kira on your PC

The text is handled like a typed turn; the final reply returns to the phone.

Setup path

  1. 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.
  2. 2Check it: open http://127.0.0.1:8780/status in a browser on the PC. It should answer.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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

Environment of the process that starts the backend
OPENCOHOST_REMOTE_GATEWAY=1
Open in a browser on the PC to check the gateway
http://127.0.0.1:8780/status
Tunnel config.yml: the only ingress target is the gateway
ingress:
  - hostname: kira.example.com
    service: http://127.0.0.1:8780
  - service: http_status:404

Troubleshooting and known limits

No microphone on the phone
Browsers need HTTPS for the microphone. A LAN address over plain http will not get the mic on Chrome; use the tunnel hostname.
Speech recognition is not local
On Chrome for Android the browser's speech recognition sends your audio to Google. Typing avoids that.
iOS Safari does not speak
iOS needs a first tap on the page to unlock speech.
Error 409
The gateway is off or the engine is not ready yet. Check the flag and wait for the app to finish loading.
"No reply"
A guardrail dropped the reply, or it timed out (about 90 seconds).
Port in use
The gateway logs a warning and the main app keeps running. Change OPENCOHOST_REMOTE_GATEWAY_PORT and the tunnel target together.
Known v0 limit
If you type a direct message on the PC at the very same moment, the phone may receive that reply.
Avatar on the phone
The page can show Kira's avatar after pairing; the first load is about 20 MB, so use Wi-Fi. If it does not appear, the page still works by voice.