Command reference#
Every command a Lockpin user runs, with its flags and an example. New to Lockpin? Start with the Quickstart.
lockpin with no command runs the proxy. lockpin -h lists the commands and the proxy’s flags.
lockpin COMMAND -h prints one command’s own flags and usage. A flag takes one dash (-day);
--day works too.
Where the ledger is#
The ledger is the file that keeps spend across restarts. The installed service writes it as
lockpin-ledger.jsonl in the data folder:
System |
Data folder |
|---|---|
Windows |
|
macOS |
|
Linux |
|
LOCKPIN_DATA_DIR changes it. projects, suggest, gaps, pause, resume, stop and quit
look in the data folder on their own. The other commands that read the ledger default to
lockpin-ledger.jsonl in the current folder: run them from the data folder, or pass -ledger FILE.
Command groups#
Group |
Commands |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
Everyday#
lockpin (run the proxy)#
Runs the proxy that caps each call. It listens on http://127.0.0.1:8787/v1 and serves the meter at
http://127.0.0.1:8787/lockpin/. The installer already runs it as a background service; run it
by hand to try flags or to run it in a terminal.
lockpin [flags]
Every flag can also be set under "flags" in lockpin.json and read with -config. A flag given on
the command line wins over the file. These are the flags most people use. lockpin -h lists all of
them, and Configuration lists every key.
Flag |
Default |
What it does |
|---|---|---|
|
|
Address to listen on. Keep it on localhost unless |
|
none |
File written by |
|
|
File that keeps spend across restarts. |
|
|
Budget in USD for tasks that set none. |
|
|
The most every task on this machine may spend together per UTC day, in USD (solo mode). |
|
|
Hold a call that would pass its task’s budget this long and ask in the meter or VS Code. With nobody watching, or no answer in time, it is refused. |
|
off |
Hold calls at the cap even when no screen reads the meter. For a server, container or CI node whose operator answers with |
|
|
Alert when spend reaches this percent of a key, team, tag or project limit (and of a task budget when |
|
|
Warn when a task has spent these percents of its budget, once each: an alert, and the |
|
none |
Team mode: require a Lockpin key from this file on every call (see |
|
none |
Catalog file(s), comma-separated, with extra or changed providers and model prices. |
|
|
When Lockpin’s own ledger or keys file fails: |
|
|
Optional reporting to the dashboard: |
|
off |
Open the meter in your browser once Lockpin is running. If Lockpin already runs on |
|
off |
Log every request. |
lockpin -default-budget 5 -open
lockpin -config lockpin.json
In team mode every call with a key that has an end carries X-Lockpin-Key-Expires (RFC 3339), so a
client or an agent harness can show it.
lockpin init#
Writes lockpin.json (and, for a team server, a keys file with a first key), then prints what to
set and what to give your agent. It asks about anything you did not pass as a flag. It never asks
for, reads or prints a provider key. lockpin init -schema prints every key lockpin.json may set.
lockpin init [flags]
lockpin init -schema
Flag |
Default |
What it does |
|---|---|---|
|
|
|
|
the ones whose key variable is set, else |
Comma-separated, for example |
|
|
Address to listen on. |
|
|
Budget in USD for tasks that set none. |
|
|
Team mode: the first key’s name. |
|
|
Team mode: that key’s daily limit in USD ( |
|
none |
Team mode: that key’s monthly limit in USD. |
|
this folder |
Where to write the files. |
|
none |
Extra catalog file, as for |
|
off |
Overwrite an existing |
|
off |
Do not ask; use flags and defaults. |
lockpin init -yes -providers anthropic,openai
lockpin init -dir team -mode team -key-name alice -yes -providers openai
lockpin doctor#
Checks the whole chain and prints a pass/fail list with a fix for each failure: the price catalog and its age, the port, whether a Lockpin answers there, the background service, the ledger, each provider’s key variable, which agents on this machine send their calls through Lockpin and which hooks they have, and where a test call to each provider would go. It makes no model calls and never prints a key.
lockpin doctor [-config FILE] [-providers LIST] [-network] [flags]
Flag |
Default |
What it does |
|---|---|---|
|
none |
The file |
|
the config’s, else the ones whose key is set |
Providers to check. |
|
off |
Also send one HEAD request, with no credentials, to each provider’s host. |
|
as for the proxy |
As for |
|
|
Extra root certificates (PEM) to trust. |
|
this system’s |
The machine’s signed policy folder. |
lockpin doctor
lockpin doctor -config lockpin.json -network
lockpin connect and lockpin disconnect#
connect points an agent at Lockpin by changing its own settings, after showing the change and
asking. The old file is kept as a backup. disconnect takes out what connect added. A company can
set the same for everyone in the agents’ managed settings, which connect does not change (see
Connect an agent).
lockpin connect claude|codex|cursor [-project] [-default] [-listen ADDR] [-dry-run] [-yes] [-force]
lockpin disconnect claude|codex [-project] [-listen ADDR] [-dry-run] [-yes]
Agent |
What |
|---|---|
|
Sets |
|
Adds a Lockpin provider to |
|
Prints the steps. Cursor’s own servers make its calls, so they cannot reach a Lockpin on this machine. |
Flag |
Default |
What it does |
|---|---|---|
|
off |
Claude Code: write |
|
|
The project folder, with |
|
off |
Codex: make Lockpin the default provider. |
|
|
The address Lockpin listens on. |
|
off |
Show the change, write nothing. |
|
off |
Write without asking. |
|
off |
Connect even when no Lockpin answers on |
lockpin connect claude
lockpin connect codex
lockpin disconnect claude
lockpin run#
Runs an agent with its calls charged to one task, so the task’s budget caps it even when the agent
cannot send X-Lockpin-Task. The task is -task, else the git branch of this folder, else the
folder’s name. The agent’s base URLs (ANTHROPIC_BASE_URL, OPENAI_BASE_URL,
GOOGLE_GEMINI_BASE_URL) point at Lockpin with the task and project in the path. An agent whose own
settings name a base URL (lockpin connect writes Claude Code’s) uses those instead.
lockpin run [-task NAME] [-project NAME] [-listen ADDR] -- COMMAND [ARGS...]
Flag |
Default |
What it does |
|---|---|---|
|
the git branch, else the folder’s name |
The task to charge. |
|
the one Lockpin finds for this folder |
The project to charge. |
|
|
The address Lockpin listens on. |
lockpin run -- claude
lockpin run -task nightly-refactor -- codex exec "fix the tests"
lockpin pause, resume, stop and quit#
These four talk to the Lockpin running on -listen. They use its control token, kept beside its
ledger.
lockpin pause 15m|1h|8h [-listen ADDR] [-ledger FILE]
lockpin resume [-listen ADDR] [-ledger FILE]
lockpin stop [-listen ADDR] [-ledger FILE]
lockpin quit [-listen ADDR] [-admin-listen ADDR] [-ledger FILE] [-yes]
Command |
What it does |
|---|---|
|
Calls pass through without a cap until then (1m to 8h, 8h a day), each one still counted. The pause ends by itself, or at |
|
Cap calls again now. |
|
Stop Lockpin. Agents still pointed at it then fail until it is started again, so to end Lockpin use |
|
First disconnect Claude Code and Codex (and this folder’s |
Flag |
Default |
What it does |
|---|---|---|
|
|
The address Lockpin listens on. |
|
none |
The address Lockpin serves its meter on, when not |
|
the data folder’s |
Lockpin’s ledger file; its control token is beside it. |
|
off |
|
lockpin pause 15m
lockpin resume
lockpin approve and lockpin deny#
Answer a call that a Lockpin on this machine holds at a task’s budget, or in a loop, without the
meter. Use them on a server, in a container (kubectl exec) or over SSH. Lockpin holds a call only
while someone can answer it: on a machine no screen watches, run it with -ask-headless (see
Approvals at the cap). A headless Lockpin takes an answer only
with its control token, which it keeps beside its ledger for its own account.
lockpin approve list [-json] [-listen ADDR] [-admin-listen ADDR] [-ledger FILE]
lockpin approve ID [-budget | -raise USD] [-listen ADDR] [-admin-listen ADDR] [-ledger FILE]
lockpin deny ID [-listen ADDR] [-admin-listen ADDR] [-ledger FILE]
Flag |
Default |
What it does |
|---|---|---|
|
off |
|
|
off |
|
|
none |
|
|
|
The address Lockpin listens on. |
|
none |
The address Lockpin serves its meter on, when not |
|
the running Lockpin’s |
Its ledger; the control token is beside it. |
approve ID lets the held call go: the task’s budget rises by what the call needs beyond what is
left (in a loop: the call goes on). deny ID refuses it: the held call gets its 402 now. The ledger
records each answer.
lockpin approve list
lockpin approve ID -raise 2
lockpin deny ID
lockpin receipt#
Prints the receipts of the last N calls, newest first: what each would have cost without Lockpin, what it cost, the lines that explain the difference, and the refusals. It reads the ledger file, so it works with Lockpin stopped.
lockpin receipt [-ledger FILE] [-n N] [-json] [TASK]
Flag |
Default |
What it does |
|---|---|---|
|
|
The ledger file Lockpin writes. |
|
|
How many calls to print. |
|
off |
Print JSON. |
|
all tasks |
Limit the receipts to one task. |
lockpin receipt -n 5
lockpin projects#
Shows each project’s spend today, this week, this month and in total, against the limits under
"projects" in the config file, and what is left on the tightest. A call’s project is the
repository its agent works in. Project names stay on this machine.
lockpin projects [-ledger FILE] [-config lockpin.json] [-json]
Flag |
Default |
What it does |
|---|---|---|
|
the service’s ledger |
The ledger file. |
|
|
The config file with the project limits. |
|
off |
Print JSON. |
lockpin projects
lockpin suggest#
Says when a task would have cost less on its model’s cheaper step in the catalog, priced from its
own calls with the same tokens, and how sure that is. With no TASK, it shows the five tasks that
would have saved most. Advice only: Lockpin never switches models. It is off unless
"suggest-cheaper" is on in the config file or a team admin turned it on in the dashboard.
lockpin suggest [-ledger FILE] [-config lockpin.json] [TASK]
Flag |
Default |
What it does |
|---|---|---|
|
the service’s ledger |
The ledger file. |
|
|
The config file. |
|
the top five |
One task to look at. |
lockpin suggest
lockpin digest#
Prints the last 7 days from the ledger: what was spent (against the week before), what Lockpin
saved, the calls it blocked, the loops it caught and the tasks that spent most. A running Lockpin
posts it to the alert destinations itself every week (-digest-at, default mon 09:00).
lockpin digest [-ledger FILE] [-send] [-alert-slack URL] [-alert-teams URL]
[-alert-ntfy URL] [-alert-webhook URL]
Flag |
Default |
What it does |
|---|---|---|
|
|
The ledger file. |
|
off |
Also post it to the alert destinations. |
|
|
Slack incoming webhook URL. |
|
|
Microsoft Teams Workflows webhook URL. |
|
|
ntfy topic URL. |
|
|
URL that gets every alert as JSON. |
|
|
The address Lockpin listens on, for the meter’s link. |
lockpin digest
lockpin alerts#
Sends one test alert to each destination, so you can check the setup without spending anything.
lockpin alerts test [-alert-slack URL] [-alert-teams URL] [-alert-ntfy URL] [-alert-webhook URL] [-ledger FILE]
The destination flags are the same as for lockpin digest.
Tip
Keep webhook URLs out of shared shell history: set them in the LOCKPIN_ALERT_* environment
variables instead of passing them as flags.
lockpin alerts test -alert-slack URL
lockpin phone#
Pairs a phone for Lockpin’s alerts, its weekly digest and, with -ask-remote, its questions about
held calls, as end-to-end encrypted notifications. There is no app store: the page installs to the
home screen. See Alerts and phone approvals.
lockpin phone pair [-ledger FILE] [-relay URL] [-wait 15m]
lockpin phone list [-ledger FILE]
lockpin phone forget [-ledger FILE]
Flag |
Default |
What it does |
|---|---|---|
|
|
The ledger file Lockpin writes; the phones are kept next to it. |
|
|
The relay that serves the phone page. |
|
|
|
pair shows a link and a QR code. list shows the paired phones. forget unpairs them all.
lockpin phone list
lockpin drift, goal, show and restore#
Drift tracking catches work an agent redoes, undoes or loses. Start Lockpin with -drift FOLDER on
the project to turn it on. These commands read its history. drift lists the findings (drift tree
shows them against the goal). goal shows or sets the project’s goal. show prints a file as it
was at a drift step, and restore puts it back. See Loop checks and drift.
lockpin drift [tree] [-repo DIR] [-all] [-goal FILE] [-store DIR]
lockpin goal [show] [-repo DIR] [-goal FILE]
lockpin goal set [-repo DIR] "what the work is for"
lockpin show [-repo DIR] -step N PATH
lockpin restore [-repo DIR] -step N PATH
Flag |
Default |
What it does |
|---|---|---|
|
|
The project folder that was tracked with |
|
off |
List every finding, not just the latest 20. |
|
none |
Step number (from |
|
|
The goal file in the project. |
|
none |
The |
lockpin drift
lockpin goal set "Fix the login bug without changing the API"
Keys and teams#
lockpin keys#
Makes and manages Lockpin keys (lp_...) for team mode. A key gives a person or an agent their own
daily, weekly and monthly limits, so nobody holds the provider key. Start the proxy with
-keys FILE to require them. A running lockpin -keys picks up changes within a second. Periods are
UTC calendar days, weeks (from Monday) and months. See Person and service keys.
lockpin keys create NAME [-day USD] [-week USD] [-month USD] [-total USD] [-user-day USD] [-tag NAME=VALUE ...]
[-providers LIST] [-models LIST] [-team TEAM] [-role ROLE] [-expires WHEN]
[-service] [-task USD] [-task-cap ask|hard]
lockpin keys list
lockpin keys set NAME [limits] [-expires WHEN] [-task USD] [-task-cap ask|hard]
lockpin keys disable NAME
lockpin keys enable NAME
lockpin keys rotate NAME [-expires WHEN]
lockpin keys lifetime [-max-days N] [-person-days N] [-service-days N] [-force]
lockpin keys seal PROVIDER [-sealed FILE]
Command |
What it does |
|---|---|
|
Add a key and print it, with the date it expires. The secret is shown only this once. A person’s key lives 180 days, a service key 90, unless |
|
Keys, their kind ( |
|
Change a key’s limits (only the ones given; |
|
Stop a key at once. |
|
Let a disabled key work again. |
|
Renew a key: a new secret and a fresh lifetime as long as before, with the same name, limits, team, role and spend history. The old secret stops working. An expired key comes back this way. |
|
Show or set how long keys live. |
|
Team node: read a provider’s API key from stdin (one line; |
Flag |
Default |
What it does |
|---|---|---|
|
none |
Limit in USD per day, per week, per month, or in total. |
|
none |
USD per day for each user of the key, named by |
|
none |
|
|
all |
Comma-separated providers the key may use. An empty value allows all again. |
|
all |
Comma-separated model patterns the key may use, |
|
none |
The team the key belongs to (see |
|
none |
|
|
the kind’s lifetime |
When the key stops working: |
|
off |
|
|
|
USD each new task of the key starts with. A task’s |
|
|
At a task’s budget: |
|
|
The keys file. |
|
|
The spend log, read by |
|
|
|
Note
A service key’s name is svc.TEAM.JOB or svc.TEAM.JOB.ENV, and -team is required. It is always
a member, never administers or answers held calls, and every call must name its run in
X-Lockpin-Task (else 400 task_required). A run that would pass its task budget is refused with
no one asked.
lockpin keys create alice -team eng -day 40
lockpin keys create bob -expires 30d
lockpin keys create svc.eng.ci-review.prod -service -team eng -day 50 -task 8
lockpin keys list
lockpin keys set alice -day 60
lockpin keys rotate alice
lockpin keys lifetime -max-days 365
A key’s holder sees its own spend and limits at /lockpin/me on the server’s -listen address,
and in VS Code (extension 0.1.5 and later) with Lockpin: Set my Lockpin key, which keeps the
key in VS Code’s secret storage and shows it under Me in the Overview; Lockpin: Forget my
Lockpin key removes it.
Lockpin warns 14 and 3 days before a key expires, and when it has (alerts key_expiring and
key_expired, in the meter, the member page, VS Code and the alert destinations). An expired key’s
calls are refused with 401 key_expired, naming the command that renews it.
lockpin teams, workspace and invites#
Teams group keys under a shared budget. The workspace is the whole organisation on this server. An invite is a link that makes one key when someone opens it. See Set up a team.
lockpin teams list
lockpin teams create NAME [limits] [-providers LIST] [-models LIST]
lockpin teams set NAME [limits] [-providers LIST] [-models LIST] [-member-day USD] [-member-week USD]
[-member-month USD] [-member-total USD]
lockpin teams delete NAME
lockpin workspace show
lockpin workspace set [-name NAME] [-kind business|personal] [limits] [-providers LIST] [-models LIST] [-owner KEY]
lockpin invites list
lockpin invites create -url ADDRESS [-team TEAM] [-role member|lead] [-days N]
lockpin invites revoke ID
Flag |
Default |
What it does |
|---|---|---|
|
none |
Limits in USD ( |
|
all |
Providers the team or workspace allows. A team cannot allow one the workspace does not. |
|
all |
Model patterns it allows. |
|
none |
|
|
none |
|
|
none |
|
|
none |
|
|
none |
|
|
none |
|
|
none |
|
|
|
|
|
|
The keys file. Every change goes into its audit list. |
An invite is single-use. Only its hash is kept, so the link is shown once. A key made from an
invite lives 180 days, like one made with lockpin keys create. Put an existing key in a team with
lockpin keys set NAME -team TEAM -role member.
lockpin teams create backend -day 100
lockpin teams set backend -member-day 20
lockpin invites create -url http://10.0.0.5:8787 -team backend
lockpin enroll#
Joins this machine to your team with the code your admin gave you. Joining shares a short status
report with your team’s admins; it never includes prompts, replies, code, file names, task names,
screens or keystrokes. It does not turn on the usage upload. lockpin enroll status shows exactly
what your admin sees.
lockpin enroll CODE [-url ORIGIN] [-ledger PATH] [-yes]
lockpin enroll status [-ledger PATH]
lockpin enroll trust sk_... [-ledger PATH]
lockpin enroll leave [-ledger PATH] [-yes]
Command |
What it does |
|---|---|
|
Join a team with the code your admin gave you. |
|
Show exactly what your admin sees. |
|
Accept a status key your admin reset. |
|
Leave the team. |
Flag |
Default |
What it does |
|---|---|---|
|
|
Ingest base URL. |
|
|
Local ledger file. |
|
off |
Do not ask first. |
lockpin enroll status
lockpin report#
Optional reporting to the hosted dashboard. Reporting runs off the call path and never changes a
decision. preview prints what would be uploaded, so you can see it before you turn reporting on.
status prints the reporter’s state. Turn reporting on with -report on and -report-token (see
Configuration and Hosted dashboard and reporting).
lockpin report preview|status [-ledger PATH] [-state PATH]
Flag |
Default |
What it does |
|---|---|---|
|
|
Local ledger file. |
|
|
Report state file. |
|
|
|
lockpin report preview
Team node and remote admin#
A team node is one Lockpin on a shared machine that holds the team’s provider keys, runs as its own
account, and hands out lp_... keys or short-lived lpc_... spend capabilities instead. These
commands are for the people who set one up. See Run a team node and
Remote admin.
lockpin node#
Makes this machine a team node. Run install elevated: from an administrator’s prompt on Windows,
with sudo on macOS and Linux.
lockpin node install|uninstall|status|start|stop|restart [-args "FLAGS"] [-key-file FILE] [-reseal] [-yes]
[-dry-run] [-no-start] [-pause] [-policy-trust FILE.pub] [-policy-required]
lockpin node run [-data DIR] [-key-file FILE] [-listen ADDR] [-admin-listen ADDR] [-- PROXY FLAGS]
lockpin node health [-listen ADDR]
lockpin node admin-key [-data DIR] [-keep]
Command |
What it does |
|---|---|
|
Make the node’s account and folder, copy |
|
Stop it and remove the definition and the program’s copy. The folder (sealed store, keys file, ledger) and the account stay. |
|
Installed or not, running or not, its pid and the log; start, stop or restart it. |
|
Run a node in the foreground, as the current account: for a container, a Kubernetes pod or a service manager you set up yourself. SIGTERM stops it cleanly. |
|
Exit 0 when the node on |
|
Print the admin key |
Flag |
Default |
What it does |
|---|---|---|
|
none |
More proxy flags (split on spaces), after the node’s own. |
|
|
Read the provider keys from FILE ( |
|
off |
|
|
off |
Go ahead without asking. |
|
off |
Print every file and command, and change nothing. |
|
off |
|
|
off |
|
|
none |
|
|
off |
|
|
|
The node’s folder. |
|
|
|
|
|
|
|
off |
|
sudo lockpin node install
lockpin node status
lockpin admin#
The remote admin channel of a team node: how an admin on another computer changes the node’s keys, teams and limits over TLS with pinned keys and a signed grant per change.
lockpin admin keygen -name NAME [-sealed FILE]
lockpin admin node-id [-data DIR]
lockpin admin enroll "LINE" -role owner|admin [-team TEAM] [-data DIR]
lockpin admin call -node https://HOST:PORT -node-fp sha256:HEX [-sealed FILE] METHOD PATH [BODY]
Command |
Where |
What it does |
|---|---|---|
|
the admin’s computer |
Make the admin’s keys, keep them in a sealed store, and print one line of public keys to give the node. |
|
the node, as an administrator |
Make the node’s channel identity once and print the fingerprint every admin pins. Run it again to print it again. |
|
the node, as an administrator |
Add an admin’s line to the node’s admin list as |
|
the admin’s computer |
Send one request to the node over the channel, with a fresh grant for a change, and print the answer. |
Flag |
Default |
What it does |
|---|---|---|
|
none |
|
|
|
The sealed store that keeps your keys. |
|
this system’s node folder |
The node’s folder, as for |
|
none |
|
|
none |
|
|
none |
|
|
none |
|
lockpin admin keygen -name alice
lockpin admin call -node https://10.0.0.5:8790 -node-fp sha256:HEX GET /lockpin/api/teams
lockpin admin call -node https://10.0.0.5:8790 -node-fp sha256:HEX POST /lockpin/api/teams '{"name":"ops"}'
Note
The channel does not let a remote admin raise a task’s budget or a team’s limits. Those need the meter page on the node’s own machine.
lockpin capabilities, delegate and revoke#
A spend capability (lpc_...) is a short-lived token that says which task, how many dollars, which
models and tools, and until when. A client sends it where it sends a team key:
Authorization: Bearer lpc_... or x-api-key.
lockpin capabilities mint -issuer NAME -usd USD [-expires 24h] [-task TASK] [-models LIST] [-tools LIST] [-sealed FILE]
lockpin capabilities show
lockpin capabilities rotate [-grace 10m] [-sealed FILE]
lockpin delegate -usd USD [-expires DUR] [-task SEGMENT] [-models LIST] [-tools LIST] [-fresh SECONDS]
lockpin revoke -root ID | -issuer NAME [-sealed FILE]
Command |
What it does |
|---|---|
|
Mint a root capability on this node and print it (the node’s admin). |
|
Print what a capability allows, read from |
|
Start a new root secret. Tokens under the old one work until the grace ends. |
|
Read a capability from |
|
Add a root capability ( |
Flag |
Default |
What it does |
|---|---|---|
|
none |
|
|
none |
The budget in USD. For |
|
|
When it ends. |
|
random segment for |
The task. |
|
all of the parent’s |
Comma-separated lists. |
|
none |
|
|
|
|
|
none |
|
|
|
The node’s sealed store. |
lockpin capabilities mint -issuer ci -usd 5 -expires 24h
lockpin delegate -usd 0.50
lockpin policy#
The signed policy file IT pushes to every machine. It sets floors that other settings can only tighten. See Signed policy.
lockpin policy keygen -out DIR [-name NAME]
lockpin policy sign -key NAME.key [-out FILE] POLICY.json
lockpin policy verify [-pub NAME.pub | -policy-dir DIR] FILE
lockpin policy trust [-policy-dir DIR] [-note TEXT] NAME.pub|BASE64
lockpin policy trust -list | -remove KEY_ID [-policy-dir DIR]
lockpin policy show [proxy flags]
Command |
What it does |
|---|---|
|
Make a signing key pair: |
|
Check a policy and sign it (in place without |
|
Check a signed policy as this machine would, against its pinned keys. |
|
Pin a public key on this machine (as an administrator). |
|
The settings in force and where each one comes from. |
Flag |
Default |
What it does |
|---|---|---|
|
none |
|
|
none |
|
|
none |
|
|
none |
|
|
|
The machine’s policy folder (Windows, macOS, Linux). |
|
none |
|
|
off |
|
|
none |
|
lockpin policy keygen -out . -name it
lockpin policy sign -key it.key policy.json
lockpin policy show
Prices and providers#
lockpin providers#
Lists each provider, the base URL to give its SDK, whether its key is set, and its models with a
price. lockpin prices is the same command. A model without a price is refused, so the catalog
matters. See Prices and the price feed.
lockpin providers [-models] [-listen ADDR] [-prices FILE]
lockpin providers update [flags]
lockpin providers missing -provider NAME [-base URL] [-prices FILE]
Flag |
Default |
What it does |
|---|---|---|
|
off |
List every model with its price. |
|
|
The address Lockpin listens on. |
|
none |
Extra catalog file, as for |
providers update fetches the signed price feed and checks it. It refuses a catalog that lowers a
price a lot or changes where calls go, unless you say so. Run lockpin with -prices on the file
to use it.
Flag |
Default |
What it does |
|---|---|---|
|
off |
Check and show what would change; write nothing. |
|
the machine policy’s feed, else the built-in one |
HTTPS URL of a signed price feed (its signature is the URL with |
|
none |
HTTPS URL of an unsigned catalog JSON to fetch instead of the signed feed. |
|
none |
Read the catalog from this file instead of a URL, with the same checks. |
|
none |
With |
|
|
Refuse a catalog that lowers a model’s price by more than this percent, unless |
|
off |
Accept price drops above |
|
off |
Accept a catalog that adds a provider or changes where calls go. A key follows them: review it first. |
|
|
Refuse a signed feed issued longer ago than this. |
|
|
Give up fetching after this long. |
providers missing lists a company’s own models with the provider’s key and prints the text
models the price list cannot price. Listing models is free.
Flag |
Default |
What it does |
|---|---|---|
|
required |
The provider to check, as |
|
the catalog’s |
The provider’s API base URL. |
lockpin providers -models
lockpin providers update -dry-run
lockpin providers missing -provider openai
Reports and import#
lockpin import#
Reads what Anthropic, OpenAI and Cursor billed, from their admin APIs, and shows it by key or
person and model, with outliers. Admin keys are read from ANTHROPIC_ADMIN_KEY,
OPENAI_ADMIN_KEY and CURSOR_ADMIN_KEY. They are never written down, and nothing is sent
anywhere. No agent has to go through Lockpin for this.
lockpin import [flags]
Flag |
Default |
What it does |
|---|---|---|
|
off |
List every key or person and model, not the top 10 per provider. |
|
|
How many days back to read, 1 to 30. |
|
off |
Show people’s emails in full (they are masked by default). |
|
off |
Print the report as JSON. |
|
every provider whose admin key is set |
Comma-separated: |
|
|
Time zone for the overnight rule, such as |
lockpin import -days 7
lockpin import -providers anthropic -json
lockpin reconcile#
Compares a provider’s own usage export (CSV) with what Lockpin charged for the same days and models.
lockpin reconcile EXPORT.csv [flags]
Flag |
Default |
What it does |
|---|---|---|
|
none |
The provider’s usage or cost CSV (or give it as the first argument). |
|
|
Export layout: |
|
none |
Name the export’s columns yourself, such as |
|
the export’s first and last day |
First and last day to compare, |
|
none |
Compare the last N days ending today instead of |
|
the detected vendor, or all for a generic export |
Compare only ledger charges for this provider. |
|
|
Percent difference in the period total that still counts as agreement. |
|
|
Local ledger file. |
|
off |
Print the report as JSON. |
lockpin reconcile usage.csv -days 7
lockpin waste-scan#
Reads the Claude Code session logs on this machine and says what the calls in them cost at API list prices, and what Lockpin’s cache options would have saved. It needs no Lockpin running, makes no network call, and prints totals only, never what the logs say.
lockpin waste-scan [-days 30] [-details] [-dir DIR] [-skip TEXT]
Flag |
Default |
What it does |
|---|---|---|
|
|
Count the last this many days. |
|
off |
Also show repeated and very large tool results, per tool, and the |
|
|
Folder of Claude Code transcripts ( |
|
none |
Comma-separated text: skip transcripts whose path contains any of it. |
lockpin waste-scan -days 7
lockpin plan#
Reads the Claude Code and Codex session logs on this machine and says where a subscription’s usage went: calls, tokens, cache share and API-equivalent dollars by window, model and session, and the window percentages Codex records. A proxy cannot cap a subscription; this shows where the usage went. It needs no Lockpin running, makes no network call, and prints totals only.
lockpin plan [-claude-dir DIR] [-codex-dir DIR] [-json]
Flag |
Default |
What it does |
|---|---|---|
|
Claude Code’s folder in your home folder |
Folder of Claude Code transcripts. |
|
Codex’s folder in your home folder |
Folder of Codex rollouts. |
|
off |
Print JSON. |
lockpin plan
lockpin ledger#
Checks the ledger and exports it. verify recomputes the chain of each ledger file and checks every
signed checkpoint with the node’s public key. export writes the ledger as audit records or, with
-format focus, as spend for a finance team’s FinOps tools. No prompt, response, key or alert text
is in it. See Receipts, ledger and reports.
lockpin ledger verify [-key HEX] FILE...
lockpin ledger export [-format jsonl|csv] [-since T] [-until T] [-o FILE] FILE...
lockpin ledger export -format focus [-keys FILE] [-since T] [-until T] [-o FILE] FILE...
lockpin ledger export -follow DIR FILE
Flag |
Default |
What it does |
|---|---|---|
|
none |
|
|
|
|
|
none |
|
|
standard output |
|
|
none |
|
|
none |
|
verify prints verified N entries, or chain broken at entry N or signature failed at checkpoint N, and exits 1. Give it a copy of a live ledger.
lockpin ledger verify lockpin-ledger.jsonl
lockpin ledger export -format csv -since 2026-11-01 -o spend.csv lockpin-ledger.jsonl
Service and install#
lockpin service#
Keeps Lockpin running in the background: started when you sign in, started again when it stops on an
error, with its output in one log file. Nothing here needs admin rights or sudo.
lockpin service install|uninstall|status|start|stop|restart [-args "FLAGS"] [-yes] [-dry-run]
System |
What |
Log |
|---|---|---|
Windows |
A Scheduled Task named |
|
macOS |
A LaunchAgent, |
|
Linux |
A systemd user unit, |
|
Command |
What it does |
|---|---|
|
Write the definition, enable it and start it. An existing one is replaced, so run it again to change |
|
Stop it and remove the definition. |
|
Installed or not, running or not, its pid, and the log path. |
|
Start, stop or restart it. |
Flag |
Default |
What it does |
|---|---|---|
|
the flags the last install saved |
Flags for the proxy, stored in the definition, split on spaces. |
|
off |
|
|
off |
Write without asking. |
|
off |
Print what would be written and run, and change nothing. |
lockpin service status
lockpin service install -args "-default-budget 5"
lockpin hooks#
Adds Lockpin’s checks to each agent’s own hook file, or takes them out. For each agent it prints
the change as a diff and writes it only after you answer yes. Other hooks and settings in the file
are kept, and the old file is copied to FILE.lockpin-backup-TIME first.
lockpin hooks install [-agent LIST] [-project] [-dir DIR] [-model ID] [-lint] [-guard] [-events] [-yes] [-dry-run]
lockpin hooks uninstall [-agent LIST] [-project] [-dir DIR] [-yes] [-dry-run]
Flag |
Default |
What it does |
|---|---|---|
|
each agent whose folder is in your home folder |
Comma-separated: |
|
off |
Change the project’s files in |
|
this folder |
The project folder for |
|
none |
Model to price a session’s first prompt with, for example |
|
off |
Claude Code: also add |
|
off |
Claude Code: also add |
|
off |
Claude Code: also add |
|
|
The |
|
off |
Write without asking, for scripts. |
|
off |
Print the changes and write nothing. |
The hooks call four commands, which you can also run yourself. lockpin hooks NAME -h prints each
one’s flags:
Command |
What it does |
|---|---|
|
Prices a prompt before it is sent and blocks one that holds a secret or whose fixes would save at least |
|
Checks a prompt for repeats, size and topic changes. |
|
Refuses a whole read of a file over |
|
Tells the running Lockpin which file the agent touched, so drift tracking can tell the agent’s changes from yours. |
The older names (lockpin hook install, lockpin review, lockpin lint, lockpin guard and
lockpin tool-event) still work, so hooks installed by an earlier version keep running.
lockpin hooks install -dry-run
lockpin hooks install -agent claude-code -guard
lockpin hooks uninstall
lockpin upgrade#
Runs the one-line installer, which downloads the latest release (or -version), checks it against
the release’s SHA256SUMS and replaces this program. It keeps how Lockpin was installed: the same
folder, and whether it starts at login. A running Lockpin is restarted on the new version; a stopped
one stays stopped. See Upgrade and uninstall.
lockpin upgrade [-version v0.3.0] [-dry-run]
Flag |
Default |
What it does |
|---|---|---|
|
the latest release |
The release to install, such as |
|
off |
Print the command it would run. |
lockpin upgrade -dry-run
lockpin upgrade -version v0.3.0
lockpin uninstall#
Removes what the installer set up: the program, and what starts it at login (the LaunchAgent, the
systemd user service, or the Windows shortcuts and PATH entry). Your spend history and settings stay
unless you add -purge. It lists what it will do and asks first.
lockpin uninstall [-purge] [-yes] [-dry-run]
Flag |
Default |
What it does |
|---|---|---|
|
off |
Also delete your spend history and settings. |
|
off |
Do not ask first. |
|
off |
List what it would do and change nothing. |
lockpin uninstall -dry-run
lockpin version#
Prints the version, commit and build date.
lockpin version
Advanced#
These commands measure what Lockpin’s own savings features do on your calls. They read local files only and send nothing. Most people never need them.
Command |
What it does |
|---|---|
|
Reads the ledger of a Lockpin started with |
|
Replays recorded model calls ( |
|
Writes one shape file per session of this machine’s Claude Code transcripts or Codex rollouts. A shape keeps the sizes and times of each call and nothing more: no prompt, reply, file or folder name. |
|
Shows the gap tables Lockpin keeps from its ledger: how long agents pause before their next call, how many calls a task makes, and how often each provider dropped a cache early. |
|
Trains two small pause models on this machine’s calls and keeps each only if it beats the gap tables on calls it did not learn from. They can then decide the 1-hour cache choice, where |
Run lockpin COMMAND -h for each one’s full flags.