@conto_finance/create-conto-agent. It provides the
create-conto-agent and conto commands. Run it with npx to start the setup wizard:
conto, which the global install provides. Without a global
install, run npx @conto_finance/create-conto-agent <command>, or npx conto <command> inside a
project the CLI set up. The unscoped npm package named conto is not the Conto CLI.
Init wizard
A headless run is any run with
--json or without a terminal. It never prompts or opens a browser,
so it uses the defaults above for flags you leave out and needs an organization key or --sandbox.
Before CLI 0.9.1, a --json run in a terminal still prompted.
The interactive wizard needs a terminal and a browser. For CI, scripts, and autonomous agents, use a
noninteractive mode instead. The wizard runs these steps:
1
Configure your agent
Choose your agent name, type, daily spending limit, and network.
2
Authenticate in the browser
The CLI opens a browser window to
conto.finance/cli-auth. Sign in with your Conto account (or
create one), and enter your two-step code if you use one. Check that the code in the browser matches
the one in your terminal, then click Connect CLI. The CLI collects its key from Conto, so the
browser never has to reach your machine. Browser-issued
organization credentials expire after seven days. Resetting your Conto password revokes them. Run conto login again to renew one.3
Create the agent and wallet
The wizard creates a wallet on your chosen chain, registers the agent, links the wallet with
spend limits, creates a default spending policy, and generates an SDK key.
4
Save your project files
The wizard writes or updates four files in your current directory:
.env.local: SDK key and configuration (owner-only permissions).gitignore: updated to ignore.env.localconto.config.json: agent metadataexample.mjs: runnable payment example
.env.local, setup replaces every CONTO_* key and keeps all other lines and
comments. If conto.config.json or example.mjs already exists with other content, the wizard
asks before replacing it. A headless run keeps the file and lists it under keptFiles in its
JSON output. Pass --overwrite to replace both without asking.It also adds @conto_finance/create-conto-agent as a dev dependency, creating a minimal
package.json if the directory has none. Pass --no-install to skip this. Setup skips it in a
project with a yarn.lock, pnpm-lock.yaml, bun.lock, or bun.lockb, so add the package with
that package manager. Until you do, use npx @conto_finance/create-conto-agent <command>, because
npx conto would fetch the unrelated conto package.Supported networks
The wizard lists every chain returned by
/api/chains, including Ethereum, Arbitrum, Polygon,
Base Sepolia, and Solana Devnet. The first run defaults to Tempo Testnet, so evaluation cannot move
real funds.
Run the example
GET /api/sdk/setup, then requests a
$0.01 payment through the policy engine from the agent’s Tempo Testnet (42431) wallet. An agent with
no Tempo Testnet wallet, such as a mainnet setup, gets an error. Without --execute it stops after the
policy decision. Each run without --status or --resume starts a new payment, so save the printed
request ID and continue it with --resume.
Headless and agent runs
For CI, scripts, and autonomous agents, use a noninteractive mode:.conto/sandbox-setup.env. Keep that
file out of the agent’s runtime. --json prints a machine-readable result to stdout with credential
file and environment-variable names, never the credential values.
From CLI 0.10.0, sandbox mode keeps a login already saved in ~/.conto/config.json and uses the
sandbox from the project’s .env.local only. The --json result then has savedLoginKept: true.
Earlier versions replaced the saved login with the sandbox.
An organization key passed with --api-key or CONTO_ORG_API_KEY is used for that setup only.
Setup does not save it in ~/.conto/config.json, where commands outside a project and in other
projects of the organization would use it (see Configuration files). In a
terminal without --json, setup asks first, and the default is No. The JSON result reports
credentials.orgApiKeySaved. A key from the browser sign-in or conto login is saved as before,
and setup keeps one already saved for the same server. This needs CLI 0.9.1 or later. Earlier versions save the passed key. To remove it, run
conto logout, which deletes ~/.conto/config.json and leaves the project’s .env.local.
A headless run without one of these modes exits with an error that lists them instead of hanging on
a prompt. --help and --version work in any terminal, TTY or not.
After a headless run:
Connect to a person’s account
--connect sets an agent up in a person’s real Conto account. Nothing opens a browser on the
agent’s computer, so it works from a server or a cloud sandbox. It needs CLI 0.10.0 or later.
--email, Conto emails the link to that person, who
can create an account from it if they have none. Without it, send them the link yourself. The
person opens the link, signs up or signs in, checks that the page shows the same code and approves.
The --json result has link, userCode and tellThePerson, a sentence to pass on. If Conto
could not send the email, the result has emailFailed: true.
Without --wait, the run returns right away and keeps the request in the owner-only, gitignored
.conto/setup-request.json. The next run with --wait picks that request up instead of starting a
new one, which suits agents whose tool calls time out. --wait polls until the person answers or
the link expires, or for the seconds you pass. On approval it saves the agent key (conto_agent_,
never an organization key) to the project’s .env.local, with the wallet and chain when the agent
has exactly one wallet. It writes nothing to ~/.conto.
From a sandbox project, setup sends the project’s CONTO_SANDBOX_API_KEY, and approval copies the
sandbox’s policies to the new agent. The key goes only to the server named next to it in
.env.local. After approval, the sandbox keys are removed from .env.local. If the server no
longer accepts that key, setup continues without it and says so. A refused --sandbox-key stops
setup.
Resume and exit codes
Organization setup records each step in.conto/init-checkpoint.json before it creates anything.
The record holds resource IDs and the requested configuration, never a key. When a step fails,
setup stops with "status": "partial", the failed step, the IDs it created, and a resume command.
It writes no agent credentials until every step succeeds. --resume checks each recorded resource
and creates only what is missing. It refuses a different base URL, organization, or configuration.
--restart discards the record. Resources the old setup created stay in the organization.
Global options
--json prints machine-readable output, see JSON mode. --help works on every
command. conto --version prints the CLI version.
Agent and status
conto status before querying approval history. With an organization login, it
shows the organization name and slug for approval-requests list. With only an agent
key, it shows the agent’s organization. Sandbox or live describes the organization.
A live organization can still have testnet wallets.
In JSON, credentials lists the selected credential types and
approvalRequestsListCredential is organization or null. The list command
requires transactions:read. A saved organization key borrowed by a project appears
only after Conto confirms it belongs to the agent’s organization. When explicit keys
belong to different organizations, organization identifies the organization login
and agent.organization identifies the agent’s. An organization-only profile reports
agent: null and wallets: []. Older servers can return an unknown organization.
From CLI 0.9.1, conto config refuses server.baseUrl, because the saved keys would go to the new
server. To use another Conto server, run conto login --base-url <url>. It removes the agent key
saved for the old server.
conto doctor calls GET /api/sdk/setup with your SDK key and reports each check, including
whether the key has payments:request and payments:execute and whether the wallet can execute
real transfers. When the server returns setup diagnostics,
those decide the result, and each issue says whether the agent or an owner acts next.For anonymous sandbox setups created with create-conto-agent --sandbox, conto doctor treats
simulated execution as healthy and reports the sandbox expiry instead of warning that the wallet
is manual-only.conto doctor --json prints exactly one JSON document with ok, exitCode, baseUrl,
diagnosticsSource (server or cli), checks, issues, diagnostics, and setup.
Sandbox handoff
Hand an anonymous sandbox to the person who will own it, from a remote or headless shell:sandbox claim uses only the sandbox organization key, CONTO_SANDBOX_API_KEY, from the
environment or .env.local. It returns a verificationUrl. Send that URL only to the person who
will own the sandbox, because it holds a temporary secret. The polling token stays in the
owner-only .conto/sandbox-claim.json and is never printed. Running sandbox claim again reuses a
pending link. claim-status never prints the link.
A claim makes that person the owner and revokes the sandbox setup key. The sandbox stays in test
mode. A claim does not fund a wallet, change spending limits, grant scopes, or enable live
payments. See hand off to a person.
Payments
--currency to choose the funding stablecoin (USDC, USDT, USDC.e, or pathUSD).
Omit it to use the wallet’s primary asset. The same option applies to --preview and --dry-run.
When a payment needs approval, conto pay prints a review link and opens it in your browser. In a
terminal it waits up to 5 minutes for the decision and sends the payment once it is approved. Use
--wait <seconds> (300 at most) to wait in scripts, --no-wait to return right away, and --no-open to skip
the browser. conto pay status <requestId> reads the stored state. When the payment is approved,
status exits with code 4 and returns conto pay execute <requestId> as the next command.
Pass policy and accounting context with --recipient-country (two-letter code), --department,
--project, and --invoice (a JSON object). Use --task for an approved shared task ID and
--purchase-key for its stable purchase identity. Preview the request with --dry-run --json.
--json, stdout stays one JSON document, so these two lines go to
stderr and both values are also in the JSON result.
A policy denial exits
1 with or without --json in CLI 0.9.0 and later. With --json, the
denied result is still printed, with status: "DENIED" and the reasons in reasons.
--dry-run makes no API calls. It checks the address, amount, purpose, and category locally
against the same rules the server uses, then prints the POST /api/sdk/payments/request it would
send. It runs no policy evaluation, so a valid dry run does not mean the payment will be
approved. Run conto limits to see the agent’s current limits.Transactions
--json for the full record, including source wallet, authorization decision, and block details.
Reconcile payments
transactions:read. Each row compares the
requested and settled amounts and currencies, and shows the transaction status and reconciliation
state. A missing settlement appears as a dash in the table and as null in JSON. Use --status
for the transaction status and --from and --to for inclusive initiation timestamps.
The default page size is 100 and the maximum is 1,000. In JSON, summary counts only rows on the
returned page. The top-level total counts every transaction matching the filters, including when
the requested offset yields an empty page.
Machine spend
analytics:read.
The summary shows spend and call counts by protocol, active services, agents and alerts,
micropayment transactions, and recent alerts. The services report ranks services and
endpoints and includes spend, calls and price per call. Use --json for the full API response.
Choose 24h, 7d, 30d (default), or all for the period, and all (default), x402,
or mpp for the protocol. The default limit is 10. The summary accepts up to 25 recent
alerts, and the services report accepts up to 50 rows in each breakdown.
Wallets
conto fund --json returns { wallet, fundingInstructions } for one wallet. For multiple
wallets it returns those entries in a results array. With no wallets it returns { "results": [] }.
link and limits take --per-tx, --daily, --weekly, and --monthly in USD. limits also
takes --clear-weekly and --clear-monthly, which go to review like a raise. link takes
--delegation: limited, full, view_only, preapproved, or allowlist.
Wallet controls use your organization login. See Owner review for the commands
marked owner review.
Spending limits
unlimited. With --json, its limit and remaining are null, and
its perTransaction is null when it has no per-payment limit.
Shared budgets
These commands manage one limit shared by several agents. Read supported payment paths before creating a budget. Amounts use decimal strings, such as"40.00".
create uses the fields in
admin.spending.createBudget().
update also accepts --expires <iso-date> to extend the budget’s end date. Read the budget again
before updating it and pass its current version. Pausing stops new purchases. It does not end the
budget’s restrictions on other payment paths.
Task approvals
request accepts --merchants <ids...> and --sources <ids...> to limit the task to named
recipients and payment sources. decide accepts --amount and --agents <ids...>. The approved
agents must include the requester. Listing supports --cursor <cursor> for the next page.
Once a task is approved, pay under it from a managed wallet with
conto pay <address> <amount> --task <taskId>.
Commerce purchases
Use an agent SDK key withtransactions:read to list and inspect its Commerce purchases.
items, total, limit, and offset.
The default page size is 20, with a maximum of 100. Use the purchase ID from a list item for
show. It returns the current snapshot, including who can act on any required action.
Buyer actions stay with the buyer.
Pass --after <version> to return { purchase, events }. Events start after that version.
Use 0 for the first page and pass events.nextCursor to continue when events.hasMore
is true.
Recurring purchases
Use the same agent key withtransactions:read to inspect repeat orders set up by the buyer.
items array with up to 50 recurring purchases, newest first. Use an
item’s id for show. The detail includes cadence, nextDueAt, order limits in USD
cents, and up to ten recent cycles. When a cycle has a purchaseId, use
conto commerce purchases show <purchaseId> to read that order.
Purchases against shared budgets
These are shared-budget records, separate from Commerce purchases.
Owner actions use the configured organization API key. Other actions use the agent’s SDK key.
--owner selects the organization key where offered. See
permissions and outcome fields.
Check status after a timeout before resuming a payment. A preview never authorizes execution, and
an unknown outcome must stay held until it is resolved.
Accounting export
Export spend across every payment rail, with categories and GL accounts, for month-end close. An organization key is required. See accounting export.--from is inclusive and --to is exclusive, both ISO timestamps ending in Z or an offset, and
--to defaults to now. A CSV export holds at most 20,000 payments and fails for a larger range, so
page through it with --format json (up to 1,000 rows a page, 500 by default). --output creates a
private file and refuses to overwrite an existing one. Without it, the export goes to standard output.
Audit
For read-only audit access, select Audit only when generating an SDK key on the agent’s Connect tab. Use an agent SDK key with theaudit:read scope to list events performed by or affecting that agent. Events appear newest first.
pagination.hasMore is true.
Inbox
--owner on either command for the organization
queue. With only an organization login configured, that queue is the default. Both credentials
require alerts:read. Organization transaction, wallet, and settings access determine which
additional kinds are visible. Owner-review proposals are visible only to their proposing key (or
agent), with agent-read (or policy-read) access. Use the same credential and scope when following a list ID or cursor.
Each item includes its ID, kind, summary, request time, expiry when available, and a review URL.
show --open opens the review page where the signed-in reviewer can decide. Listing and inspecting
only read pending records. A decided, expired, or inaccessible ID returns a not-found error.
watch polls the decision using the same credential on every read, including when the ID
has already left the pending queue. It prints one result with the ID and status. Use
--owner for an organization credential. The default wait is 300 seconds, the maximum
is 900, and --timeout 0 checks once.
Approval describes the review decision. A payment or change can still need execution.
For an alert, the underlying request supplies the decision when the credential can read it.
Alerts
0.9.1, conto alerts without --json failed as soon as an alert existed, and
--unread and --active always failed.
ack and resolve use the agent’s SDK key. Alerts about the agent’s own controls are left for a
person to handle in the dashboard.
Policies
Run policy commands from a project the CLI set up.conto policies lists with the agent’s SDK key.
The other policy commands also need an organization key. When the project’s .env.local has no
CONTO_ORG_API_KEY, they use the key that setup or conto login saved in ~/.conto/config.json,
once Conto confirms that it belongs to the agent’s organization. This needs CLI 0.9.0 or later.
See configuration files. conto policies shows [organization] for mandatory
baselines and the effective assignment path, such as [agent] or [wallet], for assigned
policies.
conto login they go to owner review.
conto policies all lists every policy in the organization, not only your agent’s, with each
policy’s ID, type, priority, rules, and active status.
create, update, add-rule, and delete prompt for input, so they need an interactive terminal.
From CLI 0.9.1, they stop with an error under --json instead of prompting. The listing commands
run without prompts:
Create a policy
conto policies create walks you through each step with descriptions. It prompts for:
- Policy name. A descriptive label.
- Policy type. One of the types below, each with an explanation.
- Scope. Apply to the entire organization or only explicitly assigned targets.
- Priority. Higher numbers are evaluated first. Use 0-100. Default is 50.
- Rules. Optionally add the first rule immediately.
- Assignment. Assigned policies can be linked to the current agent.
The type only sets which rules the builder offers. Conto evaluates each rule by its rule type, so an
allow list works the same under Counterparty, Merchant, or Whitelist.
Add rules
conto policies add-rule <policy-id> prompts for:
- Rule type: any rule type. Only
conto policies createlimits its first rule to the policy type’s rules - Operator:
<=,>=,in list,not in list,between, etc. - Value: with placeholders that show the format (dollar amounts for limits, JSON arrays for lists, country codes for geographic rules)
- Action: Allow, Deny, or Require Approval. Rules that block what they match, such as Blocked Counterparties and Blackout Period, take only Deny or Require Approval
Payment approval requests
Use an organization credential withtransactions:read from conto login or
CONTO_ORG_API_KEY to read payment approval requests, including resolved requests.
--status to see all visible requests, newest first. Filter by pending,
approved, not_approved (also rejected or denied), expired, or canceled
(also cancelled). The first page starts at offset 0 and defaults to 50 requests.
Set a limit from 1 to 100 and increase the offset by the page size for the next page.
List JSON includes requests, the filtered total, limit, and offset.
Pass a request ID from the list to show for payment details, the workflow, and
recorded reviewer decisions. In JSON mode the request object is returned directly.
Both commands are read-only. To approve or reject a pending request, open it in the
dashboard inbox with conto inbox show <id> --owner --open and review it in the browser.
Approval workflows
Use an organization credential withpolicies:read from conto login or
CONTO_ORG_API_KEY to inspect workflow definitions. Both commands are read-only.
--enabled to include both states, or pass true or false. The first page
starts at offset 0 and defaults to 50 workflows. Use a limit from 1 to 100.
List JSON includes workflows, the filtered total, limit, and offset. To fetch
the next page, add the limit to the offset. Pass an ID from the list to show for
the workflow’s triggers, approvers, expiry, and escalation settings. Its JSON
response contains the definition under workflow.
Agents
freeze --wallets also freezes the wallets only that agent uses. delete asks to confirm in a
terminal. In a script or with --json, pass --yes, or it exits 1 without deleting.
From CLI 0.9.1, conto agents unfreeze lets Conto unfreeze the wallets the agent’s freeze froze,
leaving any wallet a person froze or another frozen agent still holds. --wallets also does it for a
freeze recorded before Conto kept that list, and --keep-wallets leaves every wallet frozen. Earlier
versions unfreeze wallets only with --wallets.
Teams
Group agents into teams. A team’s policies apply to every agent in it, alongside company policies. Teams need CLI0.7.0 or later.
conto login, every change goes to
owner review: the command prints a review link and waits for an owner or admin to
confirm it. This needs CLI 0.8.0 or later. A key made in the dashboard under Developers, set as
CONTO_ORG_API_KEY, makes the change directly. A manager needs the Manager role or higher.
If your organization requires approval for budget changes and a move takes an agent off a budget,
the move can’t go through owner review. Make it in the dashboard, or with a dashboard key. With a
dashboard key, add and remove exit 4 and nothing changes. Once it is approved, run the same
command with --approval <id>.
Payees
Event delivery
approval.requested events unless --events lists others, comma-separated.
A new webhook channel gets a signing secret that the CLI prints once, or uses
CONTO_WEBHOOK_SECRET when it is set, without printing it. Add Slack, Telegram, and WhatsApp channels in
Settings > Notifications.
Owner review
The key thatconto login saves lives on your machine, where an agent running there can read it.
So it can only tighten controls: pause, freeze, revoke, block, and lower limits run at once. A
change that loosens controls, such as resuming an agent, raising a limit, linking a wallet,
creating an SDK key, or changing a team, is sent for review instead:
- The CLI prints a review link and opens it in your browser.
- An owner or admin signs in and confirms or declines the change.
- The CLI waits and reports the outcome. A new SDK key is shown once, in the terminal that asked.
--wait <seconds> waits up to 900 seconds in any
shell, --no-wait returns at once, and --no-open skips the browser. Follow a change later with:
An organization key made in Developers > API keys and passed as
CONTO_ORG_API_KEY makes these
changes directly, with no review.
Authentication
conto login prints a code, and the browser shows the same one next to Connect CLI. Connect only
when they match. The CLI then collects its key from Conto, so nothing passes from the browser to your
machine. Older Conto servers send the key to the CLI from the browser instead.
An agent key belongs to the server that issued it. Logging in to a different server removes the agent
key and the agent, wallet, and network details saved in ~/.conto/config.json, so they never reach
the new server. A project’s .env.local stays as it is. Run conto init to set up an agent on the
new server.
MCP server
.env.local, so the key stays off the command line. With no configured agent key, the
server starts in setup mode and offers start_setup and finish_setup for owner-approved onboarding.
Documentation
cli, commands, and policies all open this page.
JSON mode
Most commands support--json for machine-readable output:
Configuration files
Settings resolve from the process environment, then project
.env.local, then project
conto.config.json, then ~/.conto/config.json. Keys resolve as a set. They never come from
conto.config.json, and the first source that holds an agent key or an organization key supplies
both keys and the base URL. A base URL missing from that source is https://conto.finance.
CONTO_BASE_URL in the process environment overrides the base URL from any source. A key in the
process environment hides the keys in .env.local and ~/.conto/config.json, so also set
CONTO_API_KEY and CONTO_BASE_URL there when the command needs them.
Inside a project whose .env.local holds CONTO_API_KEY and no CONTO_ORG_API_KEY, a command
that needs the organization key uses the one that setup or conto login saved in
~/.conto/config.json. This needs CLI 0.9.0 or later, and these checks come first:
- The project’s base URL must match the one saved with the key. If it does not, the command stops
with
ORG_KEY_BASE_URL_MISMATCHand never sends the key. - The CLI asks Conto which agent the project’s key belongs to, then looks that agent up with the
saved key. If the agent is in another organization, the command stops with
ORG_KEY_ORG_MISMATCH. If the check can’t finish, it stops withORG_KEY_UNCONFIRMED. - The check runs once per command, only for commands that use the organization key. The CLI writes nothing to the project.
.env.local to the project
.gitignore. Init replaces only the CONTO_* keys in an existing .env.local. The CLI creates
.conto/ with owner-only permissions and adds it to .gitignore when it first writes a file there.
Local webhook testing
CONTO_WEBHOOK_SECRET to your local handler’s signing secret. The CLI sends a synthetic signed
payment event, reports response status and latency, and exits nonzero if delivery fails. This command
requires no Conto credentials and accepts only loopback destinations. See webhook testing.
Save a controlled-payment test report
transactions:read and audit:read. The command reads evidence and never requests or executes a
payment. It writes a new owner-only JSON file and refuses to overwrite one. It exits 2 if the saved
report has incomplete control or audit evidence.
--review is optional. Without it the report records reviewCoverage: "not_tested". For a rejection
or expiry exercise, pass --review-outcome denied or expired. A simulated receipt does not prove
an onchain transfer. A denied request with no recorded wallet stays incomplete evidence, so run a new
exercise instead of reusing it.