Installation
The betflux package bundles the Python client library and the betflux CLI.
Python 3.10+.
Install the CLI
Section titled “Install the CLI”For command-line use, install BetFlux as an isolated uv tool:
uv tool install betfluxbetflux --versionbetflux auto-update statusStarting with BetFlux 0.3.0, automatic stable-release updates are enabled
by default for verified uv tool install betflux installations on Linux and
macOS. If you installed the CLI with uv before 0.3.0, run this once to get the
updater:
uv tool upgrade betfluxThen verify that betflux --version reports 0.3.0 or later and
betflux auto-update status reports updates are on. uv preserves the version
constraint from your original installation. If it excludes 0.3.0, revise the
pin deliberately before upgrading.
Updates run before data commands and may occasionally delay startup. They use
uv’s saved package source and version constraints. Automatic updates do not
run for Windows, pip or editable installs, or temporary uvx commands.
Importing the Python SDK never checks for or installs updates.
Disable updates in CI or for reproducible scripts by setting
BETFLUX_NO_AUTO_UPDATE=1 for the process. For persistent settings and manual
updates, see CLI updates.
Install the Python SDK
Section titled “Install the Python SDK”Install the Python package into your project environment with pip:
pip install betflux # core client + CLIpip install "betflux[pandas]" # adds pandas for .df() DataFramespip install "betflux[polars]" # adds polars — build frames from .rows()The pip install also provides the CLI, but pip, editable, and project installs do not update automatically. For an isolated CLI, use uv as shown above.
Run a one-off command without installing a tool:
uvx betflux keys checkpip install betflux-cli also works — it is an alias that depends on
betflux, so either name gives you the same library and the same CLI. For
automatic updates, use a supported uv tool installation that exposes the
betflux command.
The core install includes pyarrow — dataset payloads are per-game Parquet files, and the SDK parses and filters them locally, so it’s a required dependency rather than an extra.
.df() is pandas-only. The [polars] extra just installs polars alongside
the client — build the frame yourself from .rows():
import polars as pldf = pl.DataFrame(bf.closing_lines.rows(league="NBA", date_from="2026-04-01", date_to="2026-04-07"))Configuration
Section titled “Configuration”The client and CLI read two environment variables:
export BETFLUX_API_KEY=bfx_live_... # required — mint at betflux.ai/account/api-keysexport BETFLUX_BASE_URL=... # optional — override the API hostBoth can also be passed explicitly — Client(api_key=...) in Python,
betflux --api-key ... on the CLI.
Verify the setup:
$ betflux keys checkkey valid (https://api.betflux.ai)tier: Beta — 120 requests/minusage: 12,345 rows this month (no row cap on this plan)This calls GET /v1/me with your key and prints your tier, rate limit, and
monthly row usage (with the reset date, when your plan has a row cap).