Rubylight Download 7.0.3
On this page
  1. Authentication
  2. Read-only examples
  3. Endpoint groups
  4. Console-only routes
  5. Errors
  6. Native API v1 (paired clients)

HTTP API #

Rubylight docs › For developers · Getting started · Configuration

The host serves its administration API at https://localhost:47990/api; the web console is built on the same API. Changing the base port setting moves the console to port + 1.

Routing, authentication and token scopes are implemented in web.rs, and the handlers for each area in web/. The C++ host's API guide is kept at the 2.0.0-rc.23 tag as a migration reference.

Paired clients use other routes, on the streaming HTTPS port (HttpsPort from /serverinfo, normally 47984), authenticated by the certificate the device paired with. None of the authentication methods on this page apply to them:

Route Reference
/api/native/v1/... Native API v1: game library, session state and actions, graphics driver settings (Radeon or NVIDIA), files, power and more. Summary below.
/api/hardware-metrics Hardware metrics: CPU and AMD GPU readings for a client's overlay.
/api/network-path Remote connection route: the requesting peer's current Tailscale route category (NetworkPathVersion).
/internet-play/v1 Play over the internet: this device's rendezvous secret, the host's session, public endpoints, IPv6 addresses, forwarded ports and port numbers (RustHostInternetPlayVersion).

Moonlight pairing, app discovery and streaming use the GameStream endpoints in nvhttp.rs.

Authentication #

Create the administrator account through the local console first. Initial account creation (POST /api/password while no account exists) is accepted only from the host PC. Access to the web interface also follows origin_web_ui_allowed: pc, lan (the default), or wan.

Method Use
HTTP Basic Send the administrator username and password over HTTPS. Useful for interactive scripts.
Scoped API token Send Authorization: Bearer <token>. Each token grants only the selected paths and HTTP methods.
Web session Sign in with POST /api/auth/login. The host issues secure, HttpOnly session and refresh cookies; it also returns the access, refresh and CSRF tokens in JSON.

The public API routes are /api/auth/status, /api/auth/login, /api/auth/refresh, /api/csrf-token and /api/configLocale. Other API routes require authentication, apart from local first-time account creation.

Scoped tokens #

Use the console's API token controls, or these administrator-authenticated routes. Select all permissions selects every available path and method, including paths hidden by search. You can clear the selection or deselect individual permissions before creating the token. A token may hold any number of the advertised paths, and the host keeps at most 256 tokens.

Method and path Result
GET /api/token/routes Available scope paths and their allowed methods.
POST /api/token Create a token from a scopes array; returns its secret once.
GET /api/tokens Token hashes, ownership, creation times and scopes.
DELETE /api/token/{hash} Revoke a token.

A read-only token request body can be:

{
  "scopes": [
    { "path": "/api/metadata", "methods": ["GET"] },
    { "path": "/api/session/status", "methods": ["GET"] }
  ]
}

Choose paths exactly as returned by /api/token/routes, including the pattern entries (/api/apps/[^/]+, /api/apps/[^/]+/cover, /api/apps/[^/]+/icon, /api/covers/[0-9]+). The host validates the selected methods and matches each scope against the whole request path. Secrets are stored as hashes; keep the creation response if the token will be used later.

Some routes are not in the catalogue, so no token can reach them: the authentication and token routes themselves, and the console-only routes.

Sessions and CSRF #

Browser sign-in takes username, password and optional remember_me. POST /api/auth/refresh rotates the refresh token; POST /api/auth/logout revokes the current session. GET /api/auth/sessions lists sessions, and DELETE /api/auth/sessions/{id} revokes one. Remembered sessions survive host restarts. GET /api/auth/status answers authenticated, credentials_configured and login_required, and renews a remembered browser whose access cookie lapsed.

For requests that change state:

Read-only examples #

These PowerShell examples read host status without launching an app or changing settings. Replace the certificate path with the console's root from the active profile and admin with your administrator name. curl.exe --user admin prompts for the password instead of putting it in the command.

The console's certificate names localhost, 127.0.0.1 and ::1. On an installed host, Windows' curl.exe also trusts it without --cacert, through the root setup adds to Windows, when given --ssl-no-revoke: the root publishes no revocation list, and Windows' curl otherwise refuses a certificate it cannot check for revocation. Browsers do not need this.

$certificate = 'C:\path\to\profile\credentials\console-root.pem'
curl.exe --fail-with-body --silent --show-error --cacert $certificate --user admin https://localhost:47990/api/metadata
curl.exe --fail-with-body --silent --show-error --cacert $certificate --user admin https://localhost:47990/api/session/status
curl.exe --fail-with-body --silent --show-error --cacert $certificate --user admin https://localhost:47990/api/token/routes

/api/metadata (also served as /api/meta) reports the host version, codec probe status, configured capture backend, displays, GPUs, audio endpoints, virtual-display capabilities and host warnings. Results are cached for up to five seconds; reading them does not start a codec probe. Codec state (encoder_status.state) is checking, ready or failed.

/api/session/status includes activeSessions, appRunning, appName, paused and running. An app can remain running after its stream disconnects, so these fields describe different states.

Endpoint groups #

JSON requests use Content-Type: application/json; most responses include a Boolean status. Display lists, images and log downloads have their own response formats. Every route below can be granted to an API token unless it is listed under Console-only routes.

Area Read Change
Host settings GET /api/config, GET /api/metadata (or /api/meta), GET /api/configLocale POST or PATCH /api/config, POST /api/warnings/dismiss
Applications GET /api/apps, GET /api/apps/{id}/cover, GET /api/apps/{uuid}/icon POST /api/apps, DELETE /api/apps/{id}, POST /api/apps/delete, POST /api/apps/reorder, POST /api/apps/launch, POST /api/apps/close
Game library GET /api/library/discovery POST /api/library/import, POST /api/library/sync, POST /api/library/restore
Paired devices GET /api/clients/list, GET /api/clients/pending POST /api/pin, POST /api/otp, POST /api/pairing/qr (with qr_pairing on, the default), POST /api/clients/update, POST /api/clients/disconnect, POST /api/clients/unpair, POST /api/clients/unpair-all, POST /api/clients/reset-network-history
Webhooks (format) GET /api/webhooks POST /api/webhooks, POST /api/webhooks/delete, POST /api/webhooks/test
Active sessions GET /api/session/status, GET /api/rtsp/sessions, GET /api/sessions/history, GET /api/session/console POST /api/session/console
Forwarded USB devices GET /api/usb POST /api/usb/detach
Stream DVR and clips (setting) GET /api/dvr, GET /api/dvr/clips?limit=50&cursor=, GET /api/dvr/clips/{id}/video, GET /api/dvr/clips/{id}/download POST /api/dvr/clip, POST /api/dvr/record, DELETE /api/dvr/clips/{id}
Displays GET /api/display-devices, GET /api/clients/display-layout, GET /api/clients/hdr-profiles, GET /api/display/golden_status PUT /api/clients/display-layout, POST /api/display/export_golden, POST /api/display/restore_golden, DELETE /api/display/golden, POST /api/display/terminate_virtual, POST /api/reset-display-device-persistence
Frame limiting and HDR GET /api/frame-limiter/status, GET /api/rtss/status, GET /api/health/vulkan-hdr-layer, GET /api/framegen/edid-refresh?device_id=... POST /api/health/vulkan-hdr-layer/register
Steam GET /api/steam/status, GET /api/steam/games POST /api/steam/force_sync, POST /api/steam/launch
Playnite GET /api/playnite/status, GET /api/playnite/games, GET /api/playnite/categories POST /api/playnite/install, POST /api/playnite/uninstall, POST /api/playnite/force_sync, POST /api/playnite/cover, POST /api/playnite/launch
Library extras GET /api/covers/{id}, GET /api/lossless_scaling/status, GET /api/browse?path=...&type=... POST /api/covers/upload, POST /api/apps/purge_autosync
Graphics driver (Radeon or NVIDIA) GET /api/radeon Set radeon-profile and radeon-settings on the application.
Updates GET /api/updates POST /api/updates/check, POST /api/updates/install, POST /api/updates/install_now, POST /api/updates/cancel
Diagnostics GET /api/logs, GET /api/logs/tail, GET /api/logs/analysis, GET /api/logs/export, GET /api/logs/export_crash, GET /api/logs/export_crash/manifest, GET /api/health/crashdump POST /api/health/crashdump/dismiss
Administration Authentication and token routes above. POST /api/password, POST /api/restart, POST /api/quit

Request and response details:

Console-only routes #

These routes back console pages. They take Basic or web-session authentication like the others, but they are not in the token catalogue, so no API token reaches them.

Area Read Change
Stream guests (guests) GET /api/guests, GET /api/guests/addresses, GET /api/guests/internet POST /api/guests/invite, POST /api/guests/internet, POST /api/guests/revoke, POST /api/guests/kick
Co-op (Nucleus Co-op) GET /api/coop, GET /api/coop/sessions POST /api/coop/folder, POST /api/coop/open, POST /api/coop/close, POST /api/coop/kick, POST /api/coop/end
Neural Rendering (setting) GET /api/neural?uuid=... POST /api/neural/accept, POST /api/neural/enable, POST /api/neural/disable
Managed game files (files) GET /api/game-settings?uuid=... POST /api/game-settings/release
Wake and sleep (power) GET /api/power POST /api/power/wake/fix
Settings backup (backup and restore) POST /api/backup/export, POST /api/backup/inspect, POST /api/backup/restore
Stream in the console (WebRTC) GET /api/webrtc/signal (WebSocket, web session only)
Opening the clips folder (Stream DVR) POST /api/dvr/open-folder
Account and file picker GET /api/browse POST /api/password

Errors #

Authentication failures return HTTP 401; denied origins or network reach return 403; invalid requests commonly return 400 with {"status":false,"error":"..."}. Login rate limiting returns 429 for the sign-in endpoint and 401 for HTTP Basic authentication. Check the HTTP status and response body together.

For exact request fields beyond this overview, follow the API router and its area handlers, token scope validation and administration checks.

Native API v1 (paired clients) #

Rubylight 3.0 and later. Nightjar and other paired clients use /api/native/v1 on the streaming HTTPS port. No Basic authentication, cookies or API tokens apply, and nothing is served on plain HTTP or the console port: the client presents the TLS certificate it paired with, and the host checks the device's permissions on every request. GET /serverinfo carries NativeApiVersion: missing on hosts without the API, 0 for a request that may not use it, and 1 when a paired HTTPS request may call /api/native/v1/capabilities. Stock Moonlight ignores the field.

Native API v1 is the contract: discovery, features, every endpoint, permissions, errors and versioning. Host control, Approve new devices and the other per-device grants it needs are set only in the console (Devices → device → Other) or through POST /api/clients/update above.

View this page on GitHub