Skip to content

HTTP API

A thin FastAPI adapter exposes pyrf as a HTTP API.

Start the server (development)

uv run uvicorn pyrf_api:app --reload

Do not use --reload in production; it watches files and restarts the process on changes.

Authentication

  • Set PYRF_API_TOKEN as an environment variable to the bearer token clients must provide.
  • Set PYRF_API_AUTH_DISABLED=true to skip bearer auth (for local browser testing only).

Docs

Deploy to Render.com (manual setup)

  1. Push the repo to GitHub (or connect GitLab/Bitbucket).
  2. In Render: New → Web Service, connect your repo.
  3. Configure:
  4. Build Command: Either:
    • Recommended (leaner): uv sync --frozen --no-dev && uv cache prune --ci — excludes dev deps (marimo, pytest, etc.) for a smaller, faster build.
    • Render default: uv sync --frozen && uv cache prune --ci — installs all deps; simpler but larger.
  5. Start Command: uv run uvicorn pyrf_api:app --host 0.0.0.0 --port $PORT
  6. Environment: Add Secret PYRF_API_TOKEN with your bearer token value.
  7. Deploy. The API will be live at your onrender.com URL.

Do not set PYRF_API_AUTH_DISABLED on Render; keep bearer auth enabled in production.

API Reference

pyrf_api

Thin HTTP API adapter for pyrf library.

Run: uv run uvicorn pyrf_api:app --reload

Env

PYRF_API_TOKEN - Bearer token (required when auth enabled) PYRF_API_AUTH_DISABLED - Set to true to skip Bearer auth (for local browser testing)