CryptoCadet

Reference

CLI commands

Every cryptocadet command, grouped by task. Version 0.6.0. The binary is also available as ccx.


Commands print JSON to standard output, so agents and scripts can parse them. Errors print error: … to standard error and exit with status 1. Amount flags ending in -usd (and --usd, --usdc) take dollars, like 5 or 2.50. --price and --amount take base units (1 USDC = 1,000,000).

Account

CommandWhat it does
loginSign in with your cryptocadet.app email and password. Stores the account's API key in the OS keychain; the password is not stored.
login --email <email>Skip the email prompt. Set CRYPTOCADET_PASSWORD to skip the password prompt too, for scripts.
login --value <api key>Store an API key directly instead of signing in.
logoutRemove the stored account credential from this machine.
api-keyPrint your account's API key (stored by login), for direct HTTP calls. Also on cryptocadet.app/v4/api-key.
versionPrint the CLI version. Also --version and -v.

Wallet and policy

These work on your machine only. Nothing here is sent to CryptoCadet.

CommandWhat it does
initCreate the agent wallet, the starting policy and the local config. Re-running it never replaces an existing key.
wallet:showThe agent address, network, USDC and ETH balances, and a warning when ETH for gas is low.
policy:showPrint the local spending policy.
policy:set --kind <kind> --token <address> --usdc <n>kind is perTx, daily, requireHumanAbove or reserve. Use --amount for base units instead of --usdc.
allowlist:add --kind recipient --address <address>Trust a seller's payout address for USDC payments.
allowlist:add --kind token --token <address> --symbol <s> --decimals <n>Allow another ERC-20 token. Fee-on-transfer tokens are refused.
allowlist:remove --kind recipient --address <address>Stop trusting a seller. --kind token --token <address> removes a token.
topup:request <token>=<target>Work out the shortfall to bring a token up to a target balance (base units). You send it from your main wallet yourself.
sweep --to <address>Send everything in the agent wallet to an address.
rotateReplace the agent key, after a confirmation. Offers to move funds out of the old wallet first; the old key is destroyed. Non-interactive: --and-sweep, --to <address>, --yes.

init flags

CommandWhat it does
--role buyer|seller|bothSkip the role question.
--network base-mainnet|base-sepoliaSkip the network question. The hosted server runs on Base mainnet.
--server <url>CryptoCadet server URL. Default https://api.v4.cryptocadet.app.
--rpc <url>Base RPC endpoint to use.
--yesAccept every default without prompting.
--jsonPrint a JSON summary instead of the interactive output (implies --yes).

Paying

CommandWhat it does
fetch <url>Fetch a URL and pay its 402: card credits first, then USDC within your policy. Only https URLs.
fetch … --method <M> --data <body>Request method (default GET) and body.
fetch … --header 'Name: value'Add a request header. Repeatable. Payment headers can't be set this way.
fetch … --approveConfirm a USDC payment above your requireHumanAbove threshold.
checkout --quote-file <path>Pay a complete signed quote a seller gave you (--quote-json <json>, or piped on standard input). --allowlist-recipient trusts its payee first; --approve as for fetch.

Card credits and agent tokens

CommandWhat it does
credits:buy --usd <n>Start a card top-up ($5 to $1,000). Prints the Stripe Checkout link and the session id.
credits:showYour credits balance, your earnings balance as a seller, and the 10 most recent entries.
credits:verify --session <id>Credit a paid top-up by hand, if it hasn't appeared.
agent-token:create --name <name>Create an agent token and store it in this machine's keychain. Optional: --per-call-usd, --daily-usd, --sellers a,b.
agent-token:listYour agent tokens (never the secret), and whether this machine holds one.
agent-token:revoke --id <id>Stop a token immediately.
agent-token:clearForget the token stored on this machine. Revoke it too if it may have leaked.

Selling

CommandWhat it does
handle:set --handle <handle>Claim or change your public handle (3 to 32 characters).
payout:set --token <usdc> --address <address>Set the Base wallet you are paid at. --token is USDC on Base.
product:create …Publish an item. Flags below.
product:listYour items, with their gatewayUrl.
product:update --id <id>Change --name or --price (base units).
product:disable --id <id>Take an item offline.
share:add --item <slug|id> --email <email> --mode unlock|per_queryShare a private item with one person. They pay once (unlock) or per query.
share:list --item <slug|id>Who an item is shared with.
share:revoke --item <slug|id> --id <grant id>Stop sharing with that person.
origin-secret [--rotate]Show (or replace) the secret your API uses to verify X-CryptoCadet-Signature.
historyYour account's on-chain payment history.

product:create flags

CommandWhat it does
--name <name>Required. Shown to buyers.
--slug <slug>The item's URL name: 1 to 64 characters of a-z, 0-9 and dashes. Puts the item behind the gateway.
--kind hosted|proxyHosted content (the default) or a proxy to your API.
--usd <n> | --price <base units>The price per request. One of them is required; use --usd 0 for a free item.
--visibility paid|free|privateWho can read it. Default paid.
--content-file <path>Hosted items: the file to serve, up to 200 KB.
--content-type <mime>Hosted items: the MIME type to serve it with. Default Markdown.
--origin-url <https url>Proxy items: your API's base URL. Required for --kind proxy.
--description <text>Up to 500 characters, shown in the 402 response.
Example
cryptocadet product:create --name "Quotes API" --slug quotes --kind proxy --usd 0.002 --origin-url https://api.example.com/v1/quotes
NoteThe CLI also has subscription and operator commands (subs:*, collector:*, treasury:*, reserve:check, dashboard:sync) that this guide doesn't cover. Running cryptocadet with an unknown command lists every command.

Walkthroughs: Buying and Selling.