One gateway. Zero surprise bills.
Route every model call through LayerFlow — your keys, hard budget caps, alerts at 50/80/100%, and usage history that explains itself.
Install the terminal CLI
One command, nothing else. Point it at the gateway with lf login — or skip login entirely and chat directly to a provider with your own key.
macOS / Linux
$curl -fsSL https://layerflow.dev/install | bashWindows (PowerShell)
$powershell -ExecutionPolicy Bypass -c "irm https://layerflow.dev/install.ps1 | iex"Runs in PowerShell or Windows Terminal. Works in Git Bash / WSL too — just use the macOS/Linux command.
verify
$lf version→ lf 0.2.6 — the latest release
Gateway quick start — 2 minutes
Create an API key, call one OpenAI-compatible endpoint, and your spend is capped and tracked from the first request.
$lf loginPaste your LayerFlow API key from the dashboard — the gateway then meters every request, no provider keys needed on your machine.
$lf chat "explain the auth flow"Stream a chat through the gateway. Same OpenAI-compatible call as the API — budgets, usage and alerts all apply.
$lf config key openai sk-...Set a provider key for direct mode — no account needed. lf chats straight to the provider at your configured base URL.
$lf modelsList the models your workspace can use right now, and which are available.
$lf cost --projectShow token and dollar usage — keep an eye on what each project is spending.
$lf doctorRun local diagnostics: config, storage, keychain and audit checks.
Everything in the dashboard
Keys, models, budgets and history — no install required:
Platform Keys
Create lf_live_… keys for the gateway in seconds. Use them from any OpenAI-compatible client.
BYOK Vault
Bring your own provider keys (OpenAI, Anthropic, DeepSeek, Groq…). Zero markup, zero resale.
Hard Budget Caps
Set a monthly cap per workspace — requests hard-block at 100%, no exceptions.
Alerts + Usage History
Email alerts at 50/80/100%. Every request shows model, tokens, project and exact cost.
Direct Mode
Point lf or any client straight at your provider with x-lf-provider — no account needed.
Per-Project Spend
Tag any request with x-lf-project: client-acme and see spend attributed instantly.
How it works
Calls enter the gateway, a key mode is resolved (direct, BYOK, or platform), cost is computed from the live model registry, and a budget cap + alert tier runs before the request counts.
Keys & modes
x-lf-provider-key says direct (never stored), x-lf-key provides a BYOK vault key, platform keys are plan-gated and demo-capped.
Budgets & alerts
Every request counts against the workspace limit. At 50/80/100% an email fires; at 100% new calls hard-block.
Usage history
Each completion records model, tokens, project tag and cost to 4 decimals — exportable, always.