x402-only model
The CLI is x402-only. It does not send anx-api-key header, and it ignores BRICKKEN_API_KEY / BKN_API_KEY if they are set. Preparing a transaction is free; the send is paid through x402:
- The CLI prepares a transaction with
/prepare-transactions(free). - On send, the API responds
402 Payment Requiredwith aPAYMENT-REQUIREDheader. - The CLI signs the x402 payment locally and retries with an
X-PAYMENTheader.
brickken-relayed mode the private key signs only the x402 payment — Brickken’s relayer signs and broadcasts the operation. In the default client-signed mode the same key also signs the blockchain transaction locally.
Provide a private key
BKN_PRIVATE_KEY is accepted as an alias.
Environments and base URLs
Select the environment with--env or BRICKKEN_ENV (default: sandbox):
Override the base URL directly with
--base-url or BRICKKEN_BASE_URL when needed.
The CLI’s default sandbox base URL is
https://api.sandbox.brickken.com. Some older API Reference pages show https://api-sandbox.brickken.com — use the value above for the CLI.Networks and chain IDs
Pass the target chain with--chain. Both decimal and hex forms are accepted, and common decimal IDs are normalized automatically — for example Base Sepolia can be passed as 84532 or 14a34.
RPC URL
Some commands (notablycreate-token) wait for the deployment receipt to read back the deployed tokenAddress. Set an RPC for the target chain:
BKN_RPC_URL is accepted as an alias, or use --rpc-url.
Configuration precedence
Configuration is resolved in this order (highest priority first):- Command-line flags —
--env,--base-url,--private-key,--rpc-url,--env-file,--json - Environment variables —
BRICKKEN_*orBKN_* .envfile in the current working directory (or the path given by--env-file)- Defaults —
sandboxenvironment,client-signedexecution mode (pass--execution-mode brickken-relayedto opt into relayed)
Global flags
Environment variables
Budget note
Preparing is free; only thesend is x402-priced. On Base Sepolia and other non-production environments the reference price is 0.01 USDC per send. Fund the wallet behind BRICKKEN_PRIVATE_KEY with enough USDC on the x402 payment chain (Circle USDC 0x036CbD53842c5426634e7929541eC2318f3dCF7e on Base Sepolia). See Pricing for the mainnet per-operation table.