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_TOKENas an environment variable to the bearer token clients must provide. - Set
PYRF_API_AUTH_DISABLED=trueto skip bearer auth (for local browser testing only).
Docs¶
Deploy to Render.com (manual setup)¶
- Push the repo to GitHub (or connect GitLab/Bitbucket).
- In Render: New → Web Service, connect your repo.
- Configure:
- 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.
- Recommended (leaner):
- Start Command:
uv run uvicorn pyrf_api:app --host 0.0.0.0 --port $PORT - Environment: Add Secret
PYRF_API_TOKENwith your bearer token value. - Deploy. The API will be live at your
onrender.comURL.
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)