> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peaq.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# peaqOS CLI

> Drive activate, qualify, scale, and operator flows from your terminal.

The peaqOS CLI wraps the SDK (peaq's code library (Python and JS) you install to call all this functionality without writing low-level blockchain calls yourself.) into a terminal surface for the most common machine flows: activating a machine under [Economics 2.0](https://docs.peaq.xyz/peaqos/concepts/economics-2-0.md), managing its lifecycle and subscription, submitting events, querying credit ratings (A creditworthiness score for a machine (a Moody's-style grade AAA down to NR, plus a 0-100 number) computed from its recorded earnings and activity. Like a credit score for a robot.), running operator-controlled (An account that is DID controller of many machines. Each machine owns itself and pays its own bond; the operator cannot activate a machine it does not own.) fleets, reading a machine's [Verify](https://docs.peaq.xyz/peaqos/functions/verify.md) record and preparing its chip evidence, and the full Scale loop: pairing (The verified link between an AI agent and a machine, set up by signing a challenge. The pairing token is the signed credential the agent sends with each request, like a temporary access badge.) an AI agent (A third-party AI program (Claude, OpenAI, a custom bot) paired to a machine and given limited permission to find, buy, and pay for services on its behalf.), searching the Machine Markets (peaqOS's marketplace where machines list services they offer (Service Registry) and where agents discover, order, pay for, and run services from others.) catalogue, placing and confirming orders. It's the same on-chain (On-chain means written to the shared public ledger every machine agrees on: permanent and readable by anyone. Off-chain means kept on a normal private server instead.) and orchestration path as the [JS](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-js.md) and [Python](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-python.md) SDKs, scripted.

<details><summary>Key terms in this guide</summary></details>

## Install

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
pip install peaq-os-cli
peaqos --version
```

Python 3.10 or newer. Ships to PyPI as `peaq-os-cli` and exposes the `peaqos` command. Wraps the [Python SDK](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-python.md): same on-chain path, scripted.

Install the current release with `pip install -U peaq-os-cli`. Solana flows need the extras: `pip install -U 'peaq-os-cli[solana,ows]'`. The CLI pins the `click` and `peaq-os-sdk` versions it needs, and `pip install -U` installs them.

`peaqos --version` prints both the CLI and the underlying `peaq_os_sdk` versions on a single line. Global flags `-v` / `--verbose` and `-q` / `--quiet` toggle DEBUG and ERROR-only logging respectively (mutually exclusive; logs go to stderr). `--orchestration-url <url>` and `--orch-api-key <key>` are global overrides for the corresponding env vars on any `peaqos scale ...` invocation.

## Configure

The CLI reads the same environment variables as the SDKs. Full table on [Install](https://docs.peaq.xyz/peaqos/install.md#environment-variables).

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
export PEAQOS_RPC_URL=https://peaq.api.onfinality.io/public
export PEAQOS_PRIVATE_KEY=0x...

# Deployment record: peaq-mainnet (when unset) or agung-2026-08-28 (testnet).
# Contract addresses, the EventRegistry and the MCR host come from it.
export PEAQOS_DEPLOYMENT_ID=peaq-mainnet

# Solana (machines homed on Solana, see "Solana home" under activate). Two RPCs, not one.
# Needed after onboarding too: qualify event and every machine command with --chain solana.
export PEAQOS_SVM_NETWORK=mainnet-beta
export PEAQOS_SVM_RPC_URL=https://api.mainnet-beta.solana.com

# Verify API origin, read by `peaqos verify status` only (no default).
export PEAQOS_VERIFY_API_URL=https://mcr.peaq.xyz
```

The root flags `--svm-rpc-url` and `--svm-network` (before the command name) override the two Solana variables, which override `.env`.

Other RPC endpoints (The network address your code calls to read from or write to a chain, like the base URL of the chain's API server.) are available. See [Public RPC endpoints](https://docs.peaq.xyz/peaqos/install.md#public-rpc-endpoints).

Or scaffold a `.env` interactively with `peaqos init`.

## Commands

### `peaqos init`

Interactive wizard that scaffolds a `.env` with the peaqOS variables. Prompts, in this order: `Network` (`mainnet` or `testnet`), private key (The secret string that proves you control a wallet. Anyone who has it has full control, like a master password that can never be reset.) source (`paste`, `generate`, or `wallet`; then the key, or a wallet name and vault passphrase), `RPC URL`, `Deployment ID`, Gas Station (A peaq service that hands a brand-new, empty wallet a tiny starting amount of tokens so it can afford its first network fees. Gated by 2FA.) URL, and last `Orchestration API URL` and `Orchestration API key` for Machine Markets (leave both empty if you do not use them). `Deployment ID` is prefilled with `peaq-mainnet` on mainnet and `agung-2026-08-28` on testnet: pressing Enter keeps the prefill, a blank answer selects `peaq-mainnet`, and an unknown ID exits `3` before the overwrite prompt, without writing or changing `.env` (a wallet created at the `wallet` key source stays in the vault). There are no contract addresses to enter: they come from the SDK's deployment record. The orchestration key is masked in any echoed or logged output. The `wallet` path creates a new OWS vault (An open standard for storing wallet keys in an encrypted local file (a vault) with a backup phrase, instead of a bare key in a text file.) wallet (An account on the chain, identified by a public address, that holds a machine's funds and approves its actions. Really just a pair of keys, not a place money is stored.) and writes `PEAQOS_OWS_WALLET=<name>` instead of `PEAQOS_PRIVATE_KEY`. Writes `.env` with `0o600` permissions and auto-runs `whoami` to verify.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos init
peaqos init --force            # overwrite existing .env without prompt
peaqos init --non-interactive  # read all values from env vars
```

On testnet the wizard prefills only `PEAQOS_DEPLOYMENT_ID=agung-2026-08-28`. Agung has no default RPC URL: the `RPC URL` prompt repeats until you enter one, and `--non-interactive` exits `3` unless `PEAQOS_RPC_URL` is set. The Gas Station URL is written empty, so on agung run `peaqos activate --skip-funding` or set `PEAQOS_GAS_STATION_URL`.

| Exit | When |
| :- | :- |
| `0` | `.env` written; a `whoami` failure after writing prints a warning and keeps exit `0` |
| `1` | Malformed pasted key, `PEAQOS_PRIVATE_KEY` unset in non-interactive mode, declined overwrite |
| `3` | Unknown deployment ID (nothing written), no RPC URL in non-interactive mode (nothing written), OWS wallet creation failure |

### `peaqos whoami`

Read-only command that prints the signing address (The wallet whose private key authorizes an action: the account the network treats as the one taking it. NOT a file or an app.), network (`PEAQOS_NETWORK`, `unknown` when unset), RPC URL, chain ID (A number that uniquely labels a chain so software doesn't confuse networks (peaq is 3338, Base is 8453).), and a `Deployment:` block, always printed: the deployment ID, its chain ID and six shortened contract addresses (A program deployed on the chain that runs exactly as written and that anyone can call, identified by its own 0x... address.) (`InfoDesk`, `MachineRegistry`, `MachineStateAndSync`, `MachineSubscription`, `CrossChainMirror`, `EventRegistry`, printed as `0xA1e7...Ad1e`; `EventRegistry` reads `not recorded` on `agung-2026-08-28`). The addresses come from the SDK's deployment record, not from `.env`. It needs a signer (exit `3` without one) and reads the chain ID over RPC. It prints the RPC URL in full, so do not paste its output if your endpoint URL carries a key. Useful as a sanity check after `init`. When `PEAQOS_SVM_NETWORK` or `PEAQOS_SVM_RPC_URL` is set, it also prints the requested Solana cluster, the RPC origin with credentials, path and query stripped, and the SDK's Solana deployment and packaged-IDL metadata. Those lines are local checks; `whoami` makes no Solana RPC call.

The CLI does not read `TOKENOMICS_DEPLOYMENT_ID`, the `*_ADDRESS` contract variables or the old MCR URL variable. `peaqos -v <command>` names any of them that are set, never their values, so a `.env` that sets only `TOKENOMICS_DEPLOYMENT_ID` runs on `peaq-mainnet`.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos whoami
```

### `peaqos activate`

Onboard a machine in **one atomic transaction**. `MachineStateAndSync.activateMachine` mints the ERC-721, stores the DID document, bonds the subscription tier, and registers the home chain in a single call. Mirrors the [Activate](https://docs.peaq.xyz/peaqos/functions/activate.md) flow. Uses the deployment `PEAQOS_DEPLOYMENT_ID` selects (`peaq-mainnet` when unset).

The transaction sender becomes the machine's **owner and bond payer**. The bond is quoted in PEAQ per tier at the oracle rate; `--payment` chooses what settles it.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
# Self-owned: your configured signer owns the machine and is its DID controller
peaqos activate \
  --machine-type Sensor \
  --credential-subject-hex 0xdeadbeef \
  --manufacturer 0x3333333333333333333333333333333333333333 \
  --tier entry \
  --did-document ./did.json

# Machine-owned, operator-controlled: the machine key signs and pays, you become DID controller
peaqos activate ... --for 0xMachine --machine-key ./machine.key

# Preview the bond, the voucher credit, and the net PEAQ. Submits nothing and skips Gas Station
# funding: a signer without the net PEAQ plus 0.05 PEAQ of gas gets INSUFFICIENT_PEAQ (exit 2).
peaqos activate ... --dry-run

# Scripted: --yes is the only non-interactive consent
peaqos activate ... --json --yes

# USDT settlement (--payment usdt --slippage-bps 50) is not configured on peaq mainnet; see "Paying in USDT"
```

#### Flags

| Flag | Required | Meaning |
| :- | :- | :- |
| `--machine-type` | yes | Identity domain. Half of what fixes the permanent machine ID. |
| `--credential-subject-hex` | yes | `0x`-prefixed identity-anchor bytes. The other half. |
| `--manufacturer` | yes | Manufacturer address. Recorded on-chain, never verified by the contract. |
| `--tier` | yes | `entry`, `basic`, or `pro`. |
| `--did-document` | yes | Path to a UTF-8 JSON DID document (schema below). |
| `--for` | no | Machine EOA address. Switches to machine-owned mode; requires `--machine-key`. |
| `--machine-key` | no | File holding the machine's `0x`-prefixed hex private key. |
| `--payment` | no | `peaq` (default) or `usdt`. Which asset settles the PEAQ-quoted bond. `usdt` is not configured on peaq mainnet and fails there. |
| `--slippage-bps` | conditional | Accepted conversion movement, `0` to `10000`. Required for `usdt`, rejected for `peaq`. |
| `--skip-funding` | no | Skip the funding pre-check, 2FA, and Gas Station funding. The bond-plus-gas check before signing still runs (`INSUFFICIENT_PEAQ`). |
| `--dry-run` | no | Preview and stop. |
| `--json` | no | One JSON object on stdout. Never implies consent. |
| `--yes` / `-y` | no | Accept the displayed terms. The only non-interactive consent. |

`--machine-type` and `--credential-subject-hex` alone determine the machine ID (`uint256(keccak256(abi.encode(machineType, credentialSubject)))`). Neither can change after activation, and the same pair can never be activated twice.

Private keys must come from a file. Inline key flags are intentionally unsupported: a file keeps the key out of shell history and `ps` output.

Put documentation and API URLs into the `serviceEndpoints` array of `--did-document`; the DID document is recorded atomically during activation.

#### DID document schema

Exactly three root fields, all required. Unknown fields, duplicate keys, and a root `id` or `controller` are rejected: `id` is computed on-chain and `controller` is set by the CLI from the mode.

```json theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
{
  "verificationMethods": [
    {
      "id": "#key-1",
      "methodType": "Ed25519VerificationKey2020",
      "controller": "0x1111111111111111111111111111111111111111",
      "publicKeyMultibase": "z6MkiExamplePublicKey"
    }
  ],
  "authentication": [0],
  "serviceEndpoints": [
    {
      "id": "#telemetry",
      "serviceType": "TelemetryService",
      "serviceEndpoint": "https://machine.example/telemetry"
    }
  ]
}
```

Each `authentication` entry is an index into `verificationMethods`. The CLI bounds-checks them because the contract stores them unchecked at mint.

#### Ownership modes

| Mode | Who signs and pays | Controller |
| :- | :- | :- |
| Self-owned (no `--for`) | Your configured signer owns the machine and pays the bond | Same address |
| Machine-owned, operator-controlled (`--for` + `--machine-key`) | The **machine** signs, owns the NFT, and pays gas and the bond | Your configured signer's address (the `PEAQOS_OWS_WALLET` wallet, or `PEAQOS_PRIVATE_KEY`), which signs nothing in this mode |

In machine-key mode the CLI prints the changed rights before asking: the machine wallet can transfer the NFT and rotate or clear the controller; the operator can run lifecycle, subscription, and DID actions but cannot transfer the NFT or change the controller. There is no operator-sponsored activation.

#### Paying in USDT

Not available on peaq mainnet: `SubscriptionTokenProvisionPool` has no USDT token configured, so USDT settlement fails. Pay in PEAQ. The rest of this section describes the flow on a deployment where the token is set.

The bond, the voucher credit, and the net amount stay in PEAQ; only settlement differs. The CLI shows the USDT token, the quote, the accepted slippage, and the resulting **maximum USDT**, then submits that exact maximum. The allowance goes to `SubscriptionTokenProvisionPool`, not to `MachineSubscription`. A bond covered entirely by voucher credit converts and transfers nothing.

#### Output, exit codes, and `error_code`

Progress, the preview, and prompts go to stderr; stdout carries only the final summary (or one JSON object with `--json`). Machine IDs and every unbounded chain integer are **decimal strings** in JSON, never numbers.

```json theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
{
  "status": "activated",
  "mode": "self-owned",
  "deployment_id": "peaq-mainnet",
  "chain_id": "3338",
  "machine_id": "57896044618658097711785492504343953926634992332820282019728792003956564819975",
  "tier": "entry",
  "owner": "0xDC5b20847F43d67928F49Cd4f85D696b5A7617B5",
  "controller": "0xDC5b20847F43d67928F49Cd4f85D696b5A7617B5",
  "bond_amount": "909153310068100128",
  "voucher_credit": "0",
  "net_peaq_amount": "909153310068100128",
  "transaction_hash": "0xabab...",
  "is_homed_locally": true
}
```

The four CLI-wide exit codes apply. Once input validation has passed, every `activate` outcome is a JSON report (with `--json`) whose failures carry a stable `error_code`, bracketed in human output; success and preview reports have no `error_code` key and report a `status` instead: `preview`, `activated`, `already_active`, or `pending`. Before that point there is no report: the CLI's own input validation exits `1` with a plain message, a value Click itself rejects (an unknown option, a `--tier` outside the choices) exits `2` with a usage message, and a missing or unknown configuration exits `3` with a plain message. The codes to know:

| Exit | `error_code` examples |
| :- | :- |
| `0` | none; `status` is `activated` or `already_active` |
| `1` | `INVALID_INPUT`, `CANCELLED_BEFORE_SUBMIT` (interrupted before anything was submitted; declining the prompt exits `1` with a plain message and no report), `INVALID_TIER` |
| `2` | `ORACLE_UNPRICED` (contracts reachable, no PEAQ price committed), `INSUFFICIENT_PEAQ`, `QUOTE_MOVED`, `TX_REVERTED`, `EVENT_MISMATCH`, `PENDING`, `ALREADY_ACTIVATED_RACE` |
| `3` | `DEPLOYMENT_UNKNOWN`, `DEPLOYMENT_NOT_CONFIGURED` (the deployment does not configure what the command needs: a Solana endpoint or a creation home), `DEPLOYMENT_CONFIG_ERROR` (any other deployment error), `CHAIN_MISMATCH`, `PEER_MISMATCH`, `PEER_UNSET` (InfoDesk has no address for a role the call needs), `ADDRESSES_UNSET` (the selected record lacks a contract or half the command needs, such as an EventRegistry for events or a Solana half for `--chain solana`) |

The Solana path adds its own codes; they are listed under [Solana home](#solana-home).

#### Pending transactions and `peaqos.log`

A submitted transaction whose receipt does not arrive is reported as `PENDING` at exit `2` with its hash, not as a failure. It may still mine. Every submitted hash is appended to `./peaqos.log` (mode `0600`) **before** the receipt wait. Re-running the same command reconciles the recorded hash instead of resubmitting; a hash with no receipt blocks resubmission regardless of age. Never submit a second activation for the same machine, and never delete `peaqos.log` while a transaction is outstanding.

#### Solana home

`--chain solana` homes the machine on Solana instead of peaq. The identity, DID document and Machine NFT then live in Solana accounts that name a Solana key as owner. That key, the owner wallet, pays the bond on Solana, in PEAQ or USDC, through the subscription terminal; peaq then books the bond. Activation is seven stages on two chains instead of one transaction:

| Stage | Signer | `--phase` |
| :- | :- | :- |
| `[1/7]` Operator registration on peaq | operator wallet, once per owner wallet (gas only, about 0.01 PEAQ); reconciled, not sent, when already bound | `registration` |
| `[2/7]` Activation request on Solana | owner wallet: the escrow moves into the request, the bond is frozen | `request` |
| `[3/7]` Credit from peaq | peaq's Trust Validator node (the node; a wait) | none |
| `[4/7]` Settlement on Solana | owner wallet: PEAQ to the vault, or the USDC swap; the point of no return | `finalise` |
| `[5/7]` Bond on peaq | the node and peaq (a wait) | none |
| `[6/7]` Native onboarding on Solana | owner wallet: mints the machine against the bonded request | `native_onboarding` |
| `[7/7]` Link push Solana → peaq | owner wallet, then the Trust Validator node's delivery on peaq (a wait); no messaging fee | `linkage` |

`--phase cancel_request` (owner wallet) ends an open request that will not settle and returns the escrow. It prints `Cancel request on Solana: confirmed <signature>` and `landed after N sends`, like the stages. With no request open, the CLI decides before it asks for consent or a passphrase: a cancel this journal recorded is `already done; nothing was signed`; a cancel the journal did not record (the node's) is `REQUEST_CLOSED`; a request closed after the mint is `REQUEST_NOT_CANCELLABLE`. One command runs every stage and waits out the three waits; `--phase` runs one stage at a time. `--dry-run` without `--phase` previews the whole onboarding on one screen and needs no wallet. Step by step with costs and recovery: [Onboard a machine on Solana](https://docs.peaq.xyz/peaqos/guides/onboard-on-solana.md).

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos activate "${ARGS[@]}" --dry-run                  # keyless; ends with "Run it with --max-in N"
ARGS+=(--max-in "$MAX_IN")                               # the suggested escrow, in base units of the pay-in token

# one command, both wallets, all seven stages; rerun the same command to resume
OWS_PASSPHRASE=... peaqos activate "${ARGS[@]}" \
  --operator-wallet svm-operator --owner-wallet svm-owner \
  --wait-minutes 60 --yes

# or one stage per invocation
peaqos activate "${ARGS[@]}" --phase registration      --operator-wallet svm-operator --yes
peaqos activate "${ARGS[@]}" --phase request           --owner-wallet svm-owner --yes
peaqos activate "${ARGS[@]}" --phase finalise          --owner-wallet svm-owner --yes
peaqos activate "${ARGS[@]}" --phase native_onboarding --owner-wallet svm-owner --yes
peaqos activate "${ARGS[@]}" --phase linkage           --owner-wallet svm-owner --yes
```

`ARGS` is [the argument set](https://docs.peaq.xyz/peaqos/guides/onboard-on-solana.md#the-argument-set) from the guide. Production's link push goes to the Trust Validator node with no messaging fee, so neither command takes a fee cap; `--phase linkage --dry-run` names the route.

| Solana flag | Required | Meaning |
| :- | :- | :- |
| `--chain solana` | yes | Selects the Solana home. Also needs `PEAQOS_SVM_RPC_URL` (or `--svm-rpc-url`). |
| `--operator-wallet`, `--owner-wallet` | for writes | OWS wallet names, both defaulting to `PEAQOS_OWS_WALLET`. The operator wallet signs `registration` on peaq, the owner wallet every Solana write. |
| `--pay-in` | no | `PEAQ` (default; the OFT on Solana) or `USDC`: the token the owner pays the bond in. |
| `--max-in` | for `request` | The escrow, integer base units of the pay-in token. On PEAQ at least the bond (`ESCROW_BELOW_BOND`); on USDC the swap's simulated cost must fit. The dry run suggests it; what the bond does not use comes back at settlement. |
| `--tier` | for the run, `request` and a `registration` preview | `entry`, `basic` or `pro`, or a program tier `0`–`7`. The quote refuses a tier the deployment does not price. The request freezes it; the later stages do not read it. |
| `--slippage-bps` | no | Default `100`. The cushion on the suggested escrow: on USDC on the swap, on PEAQ on the price stamp. |
| `--phase` | single-stage writes | `registration`, `request`, `finalise`, `native_onboarding`, `linkage` or `cancel_request`. The waits are not phases: rerun without `--phase` and with `--wait-minutes` to wait them out. |
| `--nonce` | no | With `cancel_request`, the request to cancel when it is not the latest. |
| `--wait-minutes` | no | `0` to `60`, default `0`. One budget for the run's waits (the registration's mirror on a first machine, credit, bond, the link's delivery) and every receipt reconcile; reads only, signs nothing. The credit wait also stops after 3 minutes and the bond wait after 6, whatever is left of the budget. A wait that ran out: exit `2`, `PENDING`, naming `operator_binding`, `credit`, `bond` or `link_application`; rerun to keep waiting. Ctrl-C: exit `1`, `CANCELLED`. Refused with `--dry-run`. |
| `--timeout-seconds` | no | Time budget for each attempt of a write (checks, the send, the receipt wait), default `300`. |
| `--max-link-push-fee-lamports` | no | Only on a deployment that routes the link push over LayerZero: the cap on its messaging fee, on the one-command run or `--phase linkage`. On such a route a push without it is refused before signing (`INVALID_INPUT`, with the dry run as guidance). The node's route has no fee and ignores it. Refused with any other single stage. |
| `--solana-owner` | yes | Base58 public key of the Solana owner wallet. |
| `--solana-controller` | no | Optional native controller. Omitted means owner-only. |
| `--evm-operator` | no | Assertion: must equal the operator wallet's peaq address, checked before `[1/7]` (`EVM_OPERATOR_MISMATCH`). Omitted, the machine inherits the registration's operator. |
| `--max-native-fee-lamports` | yes | Network plus priority fee of each Solana write, excluding rent. The largest is the mint's: at the default price it was 6,210 lamports on the proven run with the sized compute limit, and it is 11,000 lamports with `--compute-unit-limit 600000`. |
| `--max-native-rent-lamports` | yes | Rent of each Solana write: the request's accounts, the machine's records, the push account. |
| `--compute-unit-limit` | no | The mint's compute budget. Omitted, the SDK sizes it from the mint's simulation: the simulated units × 1.3, rounded up to the next 1,000, at least 50,000 (about 121,000 on production). The CLI previews the mint once at 600,000, then again at that size, so the consent quotes the fee the mint will pay. An explicit value is used as given. The link push on the Trust Validator route asks for 120,000. |
| `--compute-unit-price-micro-lamports` | no | Default `10000`: the priority price of every Solana write, about 4,900 lamports across a PEAQ onboarding and about 7,900 on USDC. `0` sends without priority, which Solana's public endpoint can drop under load. |
| `--audit` | with `--dry-run` | Re-reads the onboarding from `peaqos.log` in this directory: every transaction confirmed against the chain, `spent`, and the link push's relay by the node with its outbox nonce. Signs nothing. |

`--manufacturer` and the verification-method controllers in `--did-document` are base58 Solana keys here. `--for` and `--machine-key` are rejected. The removed reservation flow's options are refused by name with `OPTION_NOT_FOR_CHAIN` (exit `1`), naming the replacement: `--payment` (`--pay-in`), `--max-net-peaq-amount` and `--max-usdt-amount` (`--max-in`). `--from-block` is accepted and ignored. Every ceiling is validated before signing and `0` means zero, not unlimited. The CLI warns when an exported `PEAQOS_*` variable differs from `.env`, and when a write goes to the public `api.mainnet-beta.solana.com`.

Human output starts with a plan block (both wallets, the expected bond and escrow, the rents, what the owner must hold before `[2/7]`), then each stage's terms and its numbered outcome on stderr. After every confirmed write the CLI prints an indented `landed after N sends` line, and for the mint also `· <used> of <limit> CU`. A wait prints a "still waiting" line every two minutes and "landed in …" when it ends. `[7/7]` reads "Link push queued for the Trust Validator node (seq N, TV nonce M)" before its wait. Once the SDK reports `complete`, stdout carries the summary with every reference (the push as `Link push (Trust Validator)`), `link seq N applied`, the `Spent (from receipts)` block and the audit trail. With `--json`, stderr is JSON lines only (`plan`, `consent`, stage and wait events) and stdout one JSON result with `phases: [{phase, status, reference, exit_code}]`; each confirmed phase's `confirmation` carries `sends`, `resend_errors` and, for the mint, the compute figures. Every write result also carries:

* `resume_command`: the command that continues; for the one-command run the run itself. `--yes`, `--dry-run`, `--svm-rpc-url` and `--orch-api-key` are never carried over; `--svm-network` is, and other options only when you gave them.
* `spent`: read from receipts, never from quotes: the escrow out and back, the rents out and back, the fees, the registration's gas.
* `audit_trail`: every transaction with its slot or block and finality, and the link push's delivery: the node's relay with its outbox nonce, or on a LayerZero route the message with a LayerZero Scan link (a convenience, not evidence).
* `record_file`: `onboarding-<machine-id>.json`, written beside `peaqos.log` after every write: each invocation, the references, `spent`, the trail, and once complete the chain-read history.
* a `provenance` label on each evidence block: `journal_claim` is what the CLI recorded at submit time in `peaqos.log`, `chain_verified` what the SDK read back from the chains. `--json` adds `provenance_legend`.

Onboarding is done when `next_step.phase` is `complete`. The SDK derives that from peaq's `MachineBridgeAdapter.lastAppliedMirrorPushSeq` for the machine reaching the link push's sequence (`reason` `link_applied`, or `later_push_pending` when a later Solana push is still in flight). Exit `0` on `--phase native_onboarding` or `--phase linkage` means that stage's Solana transaction confirmed, not that onboarding is complete. The Solana receipt of the push proves the send, not the delivery. The watermark is the only evidence of delivery.

| Solana `error_code` | Exit | Meaning |
| :- | :- | :- |
| `PENDING` | `2` | A receipt did not arrive in time, or a wait budget ran out. While the write's blockhash is still valid (about 80 s), the SDK re-sends the same signed bytes every 2 s, so a send the network dropped usually lands in the same run; same bytes, same signature, so nothing is paid twice. After that window, rerun: the recorded transaction is reconciled, not signed again. A request, settlement or cancellation that failed, or expired without landing, is replaced by a fresh one. The one write a rerun signs again is a mint the SDK has proven dead (its blockhash expired, no signature in history, no `Machine` or `MachineState` account), minted again on the next run with the dead row printed as `expired`; the same applies to a mint that ran out of compute and created nothing (`compute_budget_exceeded`; the audit reads the row `failed, no effect`). |
| `CANCELLED` | `1` | Ctrl-C before anything was signed, between stages or during a wait. |
| `WAIT_READ_FAILED` | the read's | A status read during a wait failed. |
| `REQUEST_EXPIRED`, `COMMIT_EXPIRED` | `2` | The node did not credit the request within its hour, or the commit expired before the settlement. Nothing was settled. The node cancels an expired request on its own once it is back and returns the escrow; or cancel it with `--phase cancel_request`. Then rerun: it opens a new request, even though the journal `peaqos.log` still holds the old one. |
| `REQUEST_CLOSED` | `2` | A single `--phase` (`finalise`, `cancel_request`) was run on a request that had been cancelled or refunded. Nothing was signed. Rerun the same command without `--phase`: it opens a new request at the next nonce. |
| `ACTIVATION_REFUNDED` | `2` | peaq refused the bond after the settlement; the Trust Validator refunded it in PEAQ (the error names the reason and the amount). Rerun: it opens a new request. |
| `ESCROW_BELOW_BOND`, `INSUFFICIENT_BALANCE` | `1`, `2` | `--max-in` is below the bond on PEAQ, or the owner's pay-in token account holds less than it. Refused before signing. |
| `FINALISE_TABLE_MISSING`, `FINALISE_TABLE_STALE` | `3` | USDC: no usable lookup table for the swap on this deployment. Refused before signing; pay in PEAQ or wait for the table. A pool that moved past the cap fails the pre-signing simulation instead (`sdk_code` `SLIPPAGE_EXCEEDED`); rerun. |
| `EVM_OPERATOR_MISMATCH` | `1` | `--evm-operator` is not the operator wallet's address. Refused before `[1/7]`. |
| `OPTION_NOT_FOR_CHAIN` | `1` | An option of the removed reservation flow; the message names the replacement. |
| `TECHNICALLY_PAUSED` | `2` | The suite's upgrade lock on Solana (or a technical pause on peaq) is set. Nothing was signed. |
| `RPC_RATE_LIMITED` | `2` | An endpoint kept answering 429 after the SDK's read retries. Sends are never retried. |
| `RPC_FAILED` (`sdk_code` `READ_FAILED`) | `2` | A read failed. When its message names `-32016`, a Solana server behind the slot the read needed kept answering after the retries; rerun, or use a provider endpoint. |
| `TV_OUTBOX_MISSING`, `TV_INBOUND_REFUSED` | `2` | The node's route is not set up: the adapter has no outbox for peaq, or peaq refuses the node's deliveries. Refused before signing; a deployment problem, not yours. |
| `FEE_LIMIT_EXCEEDED`, `RENT_LIMIT_EXCEEDED`, `INSUFFICIENT_SOL` | `2` | Refused before signing: a fee over its cap (the network fee over `--max-native-fee-lamports`, or on a LayerZero route the messaging fee over `--max-link-push-fee-lamports`), rent over `--max-native-rent-lamports`, or the owner cannot pay a write and keep its own rent-exempt minimum (650,240 lamports for a plain wallet). The message names the quoted amount and the cap. |
| `INVALID_INPUT` at `[7/7]` | `1` | LayerZero route only: the push needs `--max-link-push-fee-lamports`. Refused before signing. |
| `MACHINE_NOT_ONBOARDED`, `EVM_OPERATOR_UNSET`, `LINK_CONFIG_UNAVAILABLE`, `BRIDGING_DISABLED`, `LZ_SEND_LIBRARY_UNSUPPORTED` | `2` | Link push refused before signing: no native machine yet, no peaq operator on the machine record (`set-evm-operator` sets one), or a deployment-side configuration the owner cannot change (the last three on a LayerZero route). |
| `STATE_MISMATCH` | `2` (`1` for a wrong wallet) | Chain state disagrees with the plan: another owner or operator, a changed input, or the wrong wallet for the stage (`Select the accepted phase's wallet`, nothing signed). |
| `ADDRESSES_UNSET` with `sdk_code` `DEPLOYMENT_UNAVAILABLE` | `3` | The installed SDK's packaged deployment evidence does not match the chain (an outdated SDK, or the programs were upgraded after its release). Upgrade the CLI and SDK. |
| `link_already_pushed` | `0` | A `reason`, not an error: the last push already carries the machine's values, nothing was sent. |

Keep `peaqos.log`, the working directory and the exact inputs across runs. A rerun of a confirmed stage reconciles it and never resubmits it. The one write a rerun signs again is a mint the SDK has proven dead (the dead row stays in the journal, printed as `expired`). `peaqos machine history <id> --chain solana` lists every transaction of an onboarding from the chains alone, and `peaqos machine status <id> --json --chain solana` reads the machine afterwards without wallet or journal, including the top-level `link` block with peaq's watermark (`status` `not_pushed`, `pending_application`, `linked` or `unavailable`).

### `peaqos machine`

Everything after onboarding: lifecycle, subscription payments, ERC-721 ownership, DID updates, and relocation status. Uses the deployment `PEAQOS_DEPLOYMENT_ID` selects (`peaq-mainnet` when unset).

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos machine status MACHINE_ID
peaqos machine history MACHINE_ID --chain solana [--json]                # Solana-homed machines: every onboarding transaction, from the chains
peaqos machine suspend MACHINE_ID
peaqos machine resume MACHINE_ID

peaqos machine subscription activate MACHINE_ID --tier TIER --payment RAIL [--slippage-bps N]
peaqos machine subscription renew MACHINE_ID --payment RAIL [--slippage-bps N] [--tier TIER]

peaqos machine approve MACHINE_ID OPERATOR
peaqos machine approve-all OPERATOR --allow|--revoke
peaqos machine transfer MACHINE_ID TO [--unsafe] [--data-hex HEX]

peaqos machine did set-controller MACHINE_ID CONTROLLER
peaqos machine did clear-controller MACHINE_ID
peaqos machine did set-verification-methods MACHINE_ID --file PATH
peaqos machine did set-authentication MACHINE_ID [--index N]... | --clear
peaqos machine did set-services MACHINE_ID --file PATH

peaqos machine relocation status MACHINE_ID --destination-rpc-url URL --destination-deployment-id ID

peaqos machine set-evm-operator MACHINE_ID EVM_OPERATOR --chain solana   # Solana-homed machines only
```

Every write accepts `--yes`, `--json` and, except `subscription activate` and `subscription renew`, `--dry-run` (preview and reconcile, sign nothing); every read accepts `--json`. Machine IDs are full-width `uint256`: pass them as canonical unsigned decimal (no `0x`, no leading zeros) and read them back as decimal strings.

Every write runs the same sequence: validate locally, reconcile the journal (a pending transaction for the same action and machine blocks rather than repeats), ask the SDK for a preview (chain, contract, method, current state, intended effect), show it and ask, then submit once and record the hash before waiting for the receipt. A rerun reconciles an unresolved (pending) hash instead of resubmitting; once that outcome is recorded as confirmed, the next rerun is a new write and asks for consent again, so check state with `machine status` rather than rerunning a write with `--yes`.

Details that matter:

* **Who may sign.** Suspend, resume, renew, and DID updates: owner or controller. `set-controller` and `clear-controller`: owner only. Transfers: standard ERC-721 authority. Points and credits from a renewal land on the **owner** even when the controller pays.
* **`suspend` does not pause billing.** It sets a flag on the machine, for example to mark it as under maintenance. The subscription period, grace, runoff and renewal date are unchanged. See [Subscription lifecycle](https://docs.peaq.xyz/peaqos/concepts/economics-2-0.md#subscription-lifecycle).
* **`approve-all` is not scoped to one machine.** It grants the operator every MachineRegistry machine the signer owns, including ones activated later.
* **`transfer` is safe by default** (`safeTransferFrom`). `--unsafe` selects `transferFrom`, which can strand the NFT in an incompatible contract. Transfer does not rotate the DID controller.
* **DID setters replace whole arrays.** The file or index list you pass is the complete new state. Authentication indices point into the verification-method array by position. `--index` and `--clear` are mutually exclusive and one is required.
* **Renewal extends from the stored period end,** not from now, and keeps the stored tier. The contracts allow a tier change once the period has ended (Grace or Runoff), but no published deployment record enables tier selection on renewal (`peaq-mainnet` and `agung-2026-08-28` both set it off), so passing `--tier`, even the stored tier, reports `RENEWAL_TIER_UNSUPPORTED` (exit `3`, before any RPC). Omit `--tier`; pick the tier at activation. `--payment usdt` requires `--slippage-bps` and is not configured on peaq mainnet.
* **`history` reads an onboarding from the chains.** `machine history MACHINE_ID --chain solana` needs no wallet, journal or original inputs: one line per transaction of the machine's onboarding on both chains (step, who sent it, slot or block, cost to its payer), then totals per payer. The link push's delivery by the Trust Validator node reads actor `node`, and `-v` links the push to the node's outbox (`tv_outbox`). A Solana transaction the owner did not pay but that moved its balances, such as the node's cancel of an expired request, adds the owner's part to its row (`owner +3,657,600 lamports`, and the escrow back); the owner's total is its net change. `-v` adds full references and explorer links; `--json` carries every amount as a decimal string, with `owner_lamports_delta` and `owner_token_deltas` on every Solana row. The owner wallet's registration and binding are marked `reused` on a later machine of the same owner and kept out of its totals. A source that could not be read is named and the command exits `2`; the rows shown are still exact, and a rerun reads it.
* **Relocation is read-only.** `relocation status` reports `pending`, `arrived`, `completed`, `cancelled`, or `conflicting`. Initiation and cancellation are not available, and relocation is disabled on chain.
* **Solana-homed machines.** Add `--chain solana` to route a management command through the native SDK path: `machine status`, `transfer`, `suspend`, `resume`, `did set-controller` and the other DID setters, plus `machine set-evm-operator MACHINE_ID 0xOperator --chain solana`, which maintains the peaq subscription link and exists only for Solana. The flag is a routing choice; the SDK still resolves the machine's home from its ID and refuses the wrong chain. Needs `pip install 'peaq-os-cli[solana,ows]'` and `PEAQOS_SVM_RPC_URL`; without the endpoint a write stops with exit `3` before reading anything. A live Solana write takes its cost ceilings explicitly, as `activate --chain solana` does: `--max-native-fee-lamports` (network plus priority fee) and `--max-native-rent-lamports` (rent top-up; `0` refuses any). `--dry-run` without them previews the write and prints the values a live run needs; a live write without both stops before consent and before the wallet is unlocked. `--compute-unit-price-micro-lamports` sets the priority price (default `10000`, about 2,000 lamports per write). Four things differ from peaq and are refused rather than approximated: `transfer` needs `--unsafe` (there is no safe transfer, `--data-hex` is refused), `approve` and `approve-all` are refused, addresses are base58 and never converted, and operator synchronization is reported `unavailable` on a keyless read. Without `--chain solana`, `machine status` falls back to the Solana read when the peaq record is missing or homed elsewhere: `status: "observed"` plus a `native_current_state` with separate peaq and Solana observations (`absent`, `reserved`, `pending_external`, `present`, `conflict`, `in_flight`, `unavailable`). Status output also names the subscription account the deployed programs read (`subscription_source`, `terminal` on peaq mainnet) and shows the mirror and terminal evidence side by side, with unread values `null`. See [Onboard a machine on Solana](https://docs.peaq.xyz/peaqos/guides/onboard-on-solana.md#after-onboarding).

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos machine status 57896044618658097711785492504343953926634992332820282019728792003956564819975 --json
peaqos machine suspend <machine-id> --yes
peaqos machine subscription renew <machine-id> --payment peaq --yes
peaqos machine transfer <machine-id> 0xRecipient --yes

# Solana-homed machine: preview, which prints the ceilings a live run needs, then write
peaqos machine did set-services <machine-id> --file services.json --chain solana --dry-run
peaqos machine did set-services <machine-id> --file services.json --chain solana \
  --max-native-fee-lamports 7000 --max-native-rent-lamports 0 --yes
```

Exit codes and `error_code` values are the ones documented under [`peaqos activate`](#peaqos-activate): one taxonomy for both.

`qualify mcr`, `show machine` and `show operator machines` read from the deployment's MCR (`mcr.peaq.xyz` for `peaq-mainnet`). A machine DID is `did:peaq:<decimal machine id>`; a bare decimal exits `1`, and a `did:peaq:0x<address>` machine DID exits `1` with `INVALID_INPUT` (`Machine DID requires a canonical decimal ID in 0..2^256-1.`). `show operator machines` takes `did:peaq:0x<address>`, because an operator DID names an account, not a machine. All three are HTTP-only reads and need no signer. On `agung-2026-08-28`, which has no MCR, all three exit `3` with `CONFIG_ERROR` (`The SDK rejected the selected MCR deployment`). A machine the MCR does not serve exits `2` with `NOT_FOUND` (the MCR answers an untyped 404). A failed query exits `2` with the MCR error code (for example `SERVICE_UNAVAILABLE` while the operator index is syncing) instead of a traceback.

### `peaqos qualify event`

Submit a revenue or activity event to the EventRegistry. Wraps [`submit_event`](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-python#submit_event). See the [Submit events guide](https://docs.peaq.xyz/peaqos/guides/submit-events.md) for trust levels (A label on each submitted event saying how strongly its truth is backed: the machine's word (0), a checkable on-chain record (1), or tamper-proof hardware proof (2).) and cross-chain (Working across chains: a machine lives on one home chain (peaq or Solana), and its subscription stays on peaq.) patterns.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
# HK$1.23 (123 cents) revenue event
peaqos qualify event \
  --machine-id 42 \
  --type revenue \
  --value 123 \
  --currency HKD \
  --ts 2026-04-23T12:00:00Z \
  --trust self \
  --source-chain peaq
```

`--value` is an ISO 4217 minor-unit integer: cents for USD/HKD, whole units for JPY/KRW/VND. `HK$1.23 → --value 123`, `¥100 → --value 100`. The CLI defaults `--currency` to `USD` for revenue events and to `""` for activity events; pass `--currency` explicitly to override. The MCR API converts the value to USD using FX at the event timestamp.

| Flag | Required | Meaning |
| :- | :- | :- |
| `--machine-id` | yes | Canonical unsigned decimal, `1` to `2^256-1`; the SDK refuses `0` before any RPC (exit `1`). Required unless `--resume` is given. |
| `--resume <submission-id>` | no | Solana-homed machines only: reconciles a journaled native submission read-only and takes no payload flags, `--yes` or `--dry-run`. |
| `--type` | yes | `revenue` or `activity`. |
| `--value` | yes | Non-negative integer in the currency's minor unit. |
| `--ts` | yes | Unix seconds or ISO 8601 with timezone (`Z` or `+hh:mm`). Must be on or before block time. |
| `--currency` | no | ISO 4217 code, 3-10 uppercase alphanumerics (`^[A-Z0-9]{3,10}$`). Default: `USD` for revenue, `""` for activity. |
| `--trust` | no | `self` (default), `onchain`, or `hardware`. |
| `--source-chain` | no | `same` (default), `peaq`, or `base`. |
| `--source-tx` | conditional | 32-byte hex tx hash. **Required** when `--trust onchain`. |
| `--raw-data` | no | Path to a file; bytes are hashed and stored as the event data hash. |
| `--metadata` | no | Path to a file; bytes are attached as on-chain metadata. Absent = empty bytes. |
| `--dry-run` | no | Solana-homed machines only: preview and reconcile, then stop. Signs nothing. On a peaq machine it exits `1`. |
| `--yes` | no | Solana-homed machines: confirm non-interactively, required when stdin is not a terminal. No effect on a peaq machine, where the event is submitted immediately with no preview or prompt. |
| `--json` | no | One JSON object on stdout (`status`, `execution_chain`, `machine_id`, `type`, `value`, `trust`, `transaction_hash`, `data_hash`). Never implies consent. |

Human output on success:

```
Event submitted.
  Machine ID:  42
  Type:        revenue
  Value:       123
  Trust:       self-reported
  Tx:          0x3f4a8c1e2d9b7f05a6c3e8d1f4b2a7c9e0d5f3b1a8e2c6d9f7b4a1e3c5d8f2b4
  Data Hash:   0xa1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890
```

#### Failures

An EVM submission that the EventRegistry or the SDK's home-chain check refuses is reported by its SDK code: in human output as `Error: <message>` with guidance on stderr, and under `--json` as exactly one object with `execution_chain`, `machine_id`, `status: "error"`, `error_code`, `message` and `guidance` on stdout. Input errors print a plain message on stderr with exit `1`.

| `error_code` | Exit | Guidance |
| :- | :- | :- |
| `NOT_OWNER_OR_CONTROLLER` | `2` | The signer is neither the machine's owner nor its DID controller. Sign with one of them (`PEAQOS_OWS_WALLET` or `PEAQOS_PRIVATE_KEY`). |
| `SUBSCRIPTION_NOT_ELIGIBLE` | `1` | Events need an Active or Grace subscription. Check `peaqos machine status <id>`, activate or renew it, then retry. |
| `METADATA_TOO_LARGE` | `1` | `--metadata` exceeds the EventRegistry limit. Shrink it and retry. |
| `INVALID_CURRENCY_SHAPE` | `1` | A revenue event takes 3-10 uppercase letters or digits (for example `HKD`); an activity event takes an empty `--currency`. |
| `FUTURE_TIMESTAMP` | `1` | `--ts` is later than the chain's block time. Use a timestamp at or before now and retry. |
| `MACHINE_NOT_FOUND` | `2` | No machine with this ID exists on the selected deployment. Raised only when `PEAQOS_SVM_RPC_URL` is set and Solana confirms the machine is absent too. |
| `MACHINE_HOMED_ELSEWHERE` | `2` | The machine's home chain is not resolved to one this command can write to; the message names its state. Nothing was sent. Most often a mistyped `--machine-id`: peaq does not hold it and, without `PEAQOS_SVM_RPC_URL`, the SDK cannot rule it out on Solana. A machine still onboarding or moving takes events once it settles. |
| `ADDRESSES_UNSET` | `3` | The deployment records no EventRegistry (`agung-2026-08-28`), so EVM events cannot be submitted there. Nothing was sent. Use `peaq-mainnet`, or a Solana-homed machine on a deployment with a Solana half. |

#### Solana-homed machines

`qualify event` sends an event for a machine homed on Solana to the Solana `EventRegistry` program. What it needs:

* `pip install 'peaq-os-cli[solana,ows]'` and `PEAQOS_SVM_RPC_URL`: the same `.env` the machine was onboarded with.
* `PEAQOS_OWS_WALLET` naming the OWS wallet that holds the machine's Solana owner or controller key. That wallet signs and pays.
* SOL in that wallet. The first event for a machine pays rent for its event-log account (2,946,400 lamports measured) plus the 5,000-lamport network fee, about 0.003 SOL. Every later event pays the fee only.

Before anything is signed, the preview checks that the signer is the machine's current owner or controller, that its subscription is eligible, and that the event registry is not paused and the machine not relocating.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
# Preview: price and eligibility. Signs nothing.
PEAQOS_OWS_WALLET=<owner wallet> peaqos qualify event --machine-id <machine-id> \
  --type activity --value 1 --ts "$(date +%s)" --dry-run

# Submit: shows the same preview, asks, then signs and waits for confirmation.
PEAQOS_OWS_WALLET=<owner wallet> peaqos qualify event --machine-id <machine-id> \
  --type activity --value 1 --ts "$(date +%s)"
```

The preview, then the result (an activity event on mainnet; this machine's event log already existed, so no rent):

```
About to submit a machine event
  Machine ID              :  42581867695199888670555386101443910530672475932641965651512985654630415296741
  Submitter               :  GnGEGu32nvPp7EcQTnYJMn3yxMJaAoGQgA6HnB5MdGWJ
  Type                    :  activity
  Value                   :  1
  Currency                :  (none)
  Timestamp               :  2026-10-09T03:38:08Z
  Trust                   :  self-reported
  Source Chain            :  same
  Data Hash               :  0x0000000000000000000000000000000000000000000000000000000000000000
  Log State               :  initialized
  Rent (lamports)         :  0
  Network Fee (lamports)  :  5000
  Compute Units           :  39490
  Transaction Size (bytes):  630

This signs and broadcasts a transaction. It cannot be undone.

Submit this event? [y/N]: y
Event submitted.
  Execution Chain:  solana
  Submission ID  :  247303243568646217976204659601125903134
  Signature      :  4kLbofKm8Wwo2XYNCKtJ1hyC8Em1Vk9oY2akagjHN3fUioygR9pfNyWi5Cq9BPiHcJ5yPCq2tEhyaSZqCrnQyfCT
  Slot           :  454751920
  Confirmation   :  confirmed
  Machine ID     :  42581867695199888670555386101443910530672475932641965651512985654630415296741
  Data Hash      :  0x0000000000000000000000000000000000000000000000000000000000000000
  Event Index    :  2
  Event Log      :  EmAGCLWJ6WWgUhmogfPimGCVtwHC5pUzicibriGuzP12
  Compute Units  :  39490
```

`Log State` is `initializable` for a machine's first event, which is the one that pays rent. `Event Index` counts the machine's events from `0`. The signature can be looked up on any Solana explorer.

With `--json`, every integer is a decimal string:

* `--dry-run --json` prints `status: "preview"` with `execution_chain`, `submission_id`, `machine_id`, `data_hash`, `log_state`, `rent_lamports`, `network_fee_lamports`, `compute_units`, `transaction_size_bytes` and `last_valid_block_height`.
* A submission prints `status: "confirmed"` with `execution_chain`, `submission_id`, `signature`, `slot`, `confirmation`, `machine_id`, `data_hash`, `event_index`, `event_log` and `compute_units`. `--json` never confirms a write, so a live `--json` run needs `--yes`.

**If the wait ends without a confirmation** (exit `2`, `PENDING_TRANSACTION`), the event may still land. Every submission is written to `./peaqos.log` when it is broadcast, before the wait. From the same directory, run:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos qualify event --resume <submission-id>
```

It only reads the chain and reports one of three outcomes:

* `confirmed`: the event landed.
* `expired_unlanded`: nothing landed, and sending the event again is safe.
* `unresolved`: run it again later.

While an attempt is unresolved, sending the same payload for that machine again is refused, and the error names the `--resume` command. Events without `--raw-data` all have the same (zero) payload hash, so this applies to any two of a machine's events.

**Checking the event.** `peaqos qualify mcr did:peaq:<machine-id>` counts it within minutes (`Events: Total`, `Activity`). At the time of writing, `peaqos show machine` and machines.peaq.xyz do not list Solana events yet: the profile reads `event_count: 0` with `rating_unavailable: event_history_not_indexed`.

### `peaqos qualify mcr`

Fetch a machine's credit rating from the [MCR API](https://docs.peaq.xyz/peaqos/api-reference/get-mcr.md). Wraps [`query_mcr`](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-python#query_mcr).

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos qualify mcr did:peaq:95421033441768219866308236142098740813601779873019666949118591311634701061369
peaqos qualify mcr did:peaq:95421033441768219866308236142098740813601779873019666949118591311634701061369 --json
```

The DID (A globally unique, self-owned ID for a machine that lives on the chain and isn't issued by any single company. peaqID is peaq's version: did:peaq:\<machine ID as a decimal> for a machine; did:peaq:0x\<address> names an account, such as an operator.) is `did:peaq:<canonical decimal machine ID>`; an address DID exits `1`. `--json` emits the raw SDK response on stdout with no banner or prose: useful for `jq` and scripting.

Human output:

```
MCR for did:peaq:95421033441768219866308236142098740813601779873019666949118591311634701061369

  Rating:          A
  Score:           82 / 100
  Bond Status:     bonded

  Events:
    Total:         150
    Revenue:       120
    Activity:      30

  30-Day Revenue:  up
  Last Updated:    2025-04-20T12:30:00Z
  FX Degraded:     no
  Avg Revenue:     12851
```

`revenue_trend` is one of `up`, `stable`, `down`, `insufficient` (not enough revenue history to compute a trend), or `null` (no trend could be measured, for example while the machine's history is not indexed); the CLI prints `null` as `unavailable`. `FX Degraded:` reflects the top-level `mcr_degraded` field: `yes` when one or more scored events used a stale or unavailable FX snapshot, `no` otherwise. `average_revenue_per_event` is always present and can be `null`; `Avg Revenue:` then prints `unavailable`.

`--json` output (raw SDK `MCRResponse`):

```json theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
{
  "did": "did:peaq:95421033441768219866308236142098740813601779873019666949118591311634701061369",
  "machine_id": "95421033441768219866308236142098740813601779873019666949118591311634701061369",
  "mcr_score": 82,
  "mcr": "A",
  "mcr_degraded": false,
  "bond_status": "bonded",
  "negative_flag": false,
  "event_count": 150,
  "revenue_event_count": 120,
  "activity_event_count": 30,
  "revenue_trend": "up",
  "total_revenue": 1542075,
  "average_revenue_per_event": 12851,
  "last_updated": 1745152200
}
```

### `peaqos show machine`

Fetch a full machine profile: Machine ID, operator, MCR rating and score, bond status, event count and service endpoints. Wraps [`query_machine`](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-python#query_machine). The profile's MCR snapshot can name a different `rating_unavailable` reason than `qualify mcr` for the same machine (a new Solana machine reads `event_history_not_indexed` here and `no_events_yet` there); `qualify mcr` is the rating.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos show machine did:peaq:95421033441768219866308236142098740813601779873019666949118591311634701061369
peaqos show machine did:peaq:95421033441768219866308236142098740813601779873019666949118591311634701061369 --json
```

### `peaqos show operator machines`

List the machines registered under a proxy operator, with MCR per machine. Wraps [`query_operator_machines`](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-python#query_operator_machines).

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos show operator machines did:peaq:0xProxyAddress
peaqos show operator machines did:peaq:0xProxyAddress --json
```

### `peaqos wallet`

Manage OWS-format wallets in the local encrypted vault at `~/.ows/wallets/`. Requires the `[ows]` extra: `pip install 'peaq-os-cli[ows]'` (quote the bracketed extra so zsh does not glob it). The vault passphrase (The password that unlocks the encrypted wallet vault so its key can be used to sign.) is read from `OWS_PASSPHRASE` when set, otherwise prompted interactively. Subcommands wrap the SDK static helpers documented on [Wallets (OWS)](https://docs.peaq.xyz/peaqos/wallets.md).

| Subcommand | Purpose |
| :- | :- |
| `peaqos wallet create <name> [--words 12\|24] [--json]` | Generate a new BIP-39 mnemonic and derive accounts for every supported chain. The mnemonic is not displayed; back up via `wallet export`. |
| `peaqos wallet import <name> --mnemonic [--index N] [--json]` | Import from an existing BIP-39 mnemonic (hidden prompt). `--index` selects the derivation index (default `0`). |
| `peaqos wallet import <name> --private-key-file <path> [--json]` | Import a raw EVM private key from file. OWS derives an account for every chain family from it; the peaq account is the one peaqOS signs with. |
| `peaqos wallet list [--json]` | Compact table of all wallets: Name, ID, peaq Address, Key Type, Created. |
| `peaqos wallet show <name-or-id> [--json]` | Wallet metadata plus the full multi-chain address table. |
| `peaqos wallet export <name-or-id>` | Reveal the recovery phrase / private key. Requires interactive confirmation. Secret prints to stdout; warning prints to stderr. |
| `peaqos wallet delete <name-or-id>` | Securely delete a wallet (file overwritten with random bytes before unlink). Requires confirmation. |
| `peaqos wallet use <name-or-id>` | Set the active wallet. Writes `PEAQOS_OWS_WALLET=<name>` into `.env` in the current directory. Subsequent commands that call `load_client()` will sign with this wallet. |

When `PEAQOS_OWS_WALLET` is set, `load_client()` resolves the wallet from the vault using `OWS_PASSPHRASE` and skips `PEAQOS_PRIVATE_KEY` entirely. If both are set, the wallet wins.

### `peaqos stream`

The data-stream command group. The crypto core is offline: `publish` turns a source file into signed, encrypted chunks on disk; `grant` re-wraps the chunk keys for a buyer; `consume` decrypts and reassembles the original data on the buyer's side. Around it sits the paid flow: `distribute` waits for a buyer's payment confirmation and delivers access files to S3, `pay` transfers tokens to the seller on peaq, Base, or Solana, and `payproof` submits proof for a transfer completed elsewhere. Purchases and delivery are the SDK-level [distribution flow](https://docs.peaq.xyz/peaqos/sdk-reference/stream-distribution.md); the [P2P delivery channel](https://docs.peaq.xyz/peaqos/sdk-reference/stream-distribution.md#p2p-delivery) is not exposed as a CLI flag.

#### `peaqos stream publish`

Chunk, encrypt, and sign a data file into a local output directory. Each chunk gets a fresh key wrapped (X25519) for three recipients (owner, operator, machine), and the chain is signed Ed25519. Writes `chunk-{i}.json` (envelope) + `chunk-{i}.bin` (ciphertext) per chunk, plus a `manifest.json` (`peaq.stream.chunks.v1`).

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos stream publish \
  --input ./telemetry.bin \
  --output-dir ./out \
  --owner-public-key 0x<64hex> \
  --operator-public-key 0x<64hex> \
  --machine-public-key 0x<64hex> \
  --signing-key-file ./machine-ed25519.key \
  --machine-did did:peaq:0xMACHINE \
  --machine-key-id did:peaq:0xMACHINE#keys-1
```

Required: `--input` (file path or `http(s)` URL), `--output-dir` (created if missing), `--owner-public-key` / `--operator-public-key` / `--machine-public-key` (X25519, 64 hex), `--signing-key-file` (Ed25519 private key, one line of 64 hex with an optional `0x` prefix; the file the [onboarding quickstart](https://docs.peaq.xyz/peaqos/guides/onboarding-quickstart.md) writes), `--machine-did`, `--machine-key-id`.

Optional: `--chunk-size` (bytes, default `262144`), `--json` (emit the manifest to stdout), and S3 upload: `--s3 s3://bucket/prefix/`, `--s3-region`, `--s3-endpoint` (for MinIO / R2 / S3-compatible stores). S3 needs the extra (`pip install "peaq-os-cli[s3]"`) and credentials via `PEAQOS_S3_ACCESS_KEY_ID` + `PEAQOS_S3_SECRET_ACCESS_KEY` (or the standard boto3 chain); each chunk's `storageRef` is rewritten to its `s3://` URI.

The human summary goes to stderr; the manifest path prints to stdout for piping. Exit codes: `0` success, `1` validation (bad key hex, wrong length, missing input file, `StreamValidationError`/`StreamSigningError`), `2` URL download or S3 upload failure.

#### `peaqos stream grant`

Grant a buyer decryption access to a published chunk chain, fully offline. Reads the chunk envelopes, unwraps each chunk key with the owner's X25519 private key, re-wraps for the buyer, and writes `peaq.stream.buyer-access.v1` files (sharded by size). This is a local re-key, not an on-chain access grant.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos stream grant \
  --chunk-dir ./out \
  --buyer-public-key 0x<64hex> \
  --buyer-id did:peaq:0xBUYER \
  --owner-private-key-file ./owner-x25519.key \
  --output-dir ./buyer-access
```

Required: `--chunk-dir` (published envelopes), `--buyer-public-key` (X25519), `--buyer-id`, `--owner-private-key-file`, `--output-dir`.

Optional: `--max-file-size` (bytes per access file, default `512000`), `--json` (summary with per-file listing).

Exit codes: `0` success, `1` validation (invalid keys, no chunk files, malformed chunk, `--max-file-size <= 0`), `2` key-commitment mismatch, meaning the wrong owner key.

#### `peaqos stream consume`

Buyer-side: decrypt a purchased chunk chain and reassemble the original data. Reads the chunk envelopes, the encrypted `.bin` blobs, and the buyer access files (filtered to `--buyer-id`), verifies the chain (unless `--skip-verify`), decrypts each chunk with the buyer's X25519 private key, and writes the result to `--output`. Two input modes:

* **Local** (offline): `--chunk-dir`, `--access-dir`, and `--data-dir` point at directories already on disk.
* **Remote**: `--download-url` points at an HTTP/HTTPS **self-contained release package** bundling the envelopes, `.bin` blobs, and access files, exposed as a `manifest.json` file listing or a ZIP archive. The package is downloaded into a work directory (`--work-dir`, or a temp dir cleaned up after success unless `--keep-files`; preserved on any error for debugging), then the same verify → decrypt → reassemble pipeline runs. `--download-url` is mutually exclusive with the three directory flags.

`--download-url` does not consume the pre-signed URL from `peaqos stream distribute`: that URL delivers only the **first** buyer-access file, while the chunk envelopes and ciphertext stay behind each chunk's `storageRef`. A full distribute to consume roundtrip needs a self-hosted bundle as described above.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
# Local mode: directories already on disk
peaqos stream consume \
  --chunk-dir ./out \
  --access-dir ./buyer-access \
  --data-dir ./out \
  --buyer-private-key-file ./buyer-x25519.key \
  --buyer-id did:peaq:0xBUYER \
  --output ./recovered.bin

# Remote mode: fetch a self-contained release bundle
peaqos stream consume \
  --download-url "https://bundles.example.com/releases/ord-001/" \
  --buyer-private-key-file ./buyer-x25519.key \
  --buyer-id did:peaq:0xBUYER \
  --output ./recovered.bin
```

Required: `--buyer-private-key-file` (buyer X25519 private key), `--buyer-id` (must match the `recipientId` in the access files), `--output` (reassembled plaintext path), and, in local mode, `--chunk-dir` (envelopes), `--access-dir` (buyer access files), `--data-dir` (encrypted `.bin` blobs).

Optional: `--download-url` (remote release package; a query token on the URL is preserved when fetching each file), `--work-dir` / `--keep-files` (remote mode only), `--skip-verify` (skip chain verification; debugging only), `--json` (summary to stdout: `output`, `totalBytes`, `chunkCount`, `sourceHash`, `buyerId`, `verified`).

Exit codes: `0` success, `1` validation (empty `--buyer-id`, unreadable key, missing input files or dirs, `--download-url` combined with a directory flag or with a non-http(s) scheme), `2` decryption, integrity, or download failure (HTTP error, timeout, invalid ZIP). The buyer-side messages are specific: a wrong or ungranted key gives `Decryption failed for chunk <index>` with "access not granted for this buyer private key"; a mismatched `--buyer-id` gives `No buyer access for chunk <index> (<chunk-id>)`; a tampered chunk gives `Data integrity check failed for chunk <index>` with "plaintext hash mismatch".

#### `peaqos stream distribute`

Seller-side. Listen for a buyer's payment confirmation, then automatically generate buyer access files (same re-key as `stream grant`) and deliver them to S3 under `{prefix}{buyer_id}/`, returning a pre-signed download URL. Polls `--confirmation-url` every `--poll-interval` seconds (default `30`) until the endpoint reports a confirmed payment or `--timeout` seconds (default `3600`) elapse. The confirmation endpoint must return JSON with `status: "confirmed"`, an `order_id` matching `--order-id`, and non-empty strings for `buyer_id`, `buyer_public_key_hex`, and `tx_hash`; `confirmed_at` is optional.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos stream distribute \
  --chunk-dir ./out \
  --owner-private-key-file ./owner-x25519.key \
  --confirmation-url https://api.example.com/orders/ord-001/status \
  --order-id ord-001 \
  --delivery s3 \
  --s3 s3://my-bucket/distributes/
```

Required: `--chunk-dir` (published envelopes from `stream publish`), `--owner-private-key-file` (the X25519 key used at publish time, one line of 64 hex with an optional `0x` prefix), `--confirmation-url`, `--order-id`, `--delivery` (currently only `s3`), and `--s3` (bucket path).

Optional: `--poll-interval`, `--timeout`, `--s3-region`, `--s3-endpoint` (MinIO / R2 / S3-compatible), `--presign-expiry` (seconds, default `3600`), `--max-file-size` (bytes per access file, default `512000`), `--json`. S3 needs the extra (`pip install "peaq-os-cli[s3]"`) and credentials via `PEAQOS_S3_ACCESS_KEY_ID` + `PEAQOS_S3_SECRET_ACCESS_KEY` or the standard boto3 chain.

Exit codes: `0` success, `1` validation (no chunk files, unreadable key, non-positive interval/timeout, `--delivery s3` without `--s3`), `2` confirmation timeout or S3 upload failure, `3` `boto3` missing. In the SDK, the same loop is [`PollingConfirmationProvider` + `distributeData`](https://docs.peaq.xyz/peaqos/sdk-reference/stream-distribution#seller-getting-paid-and-preparing-access), where a [P2P delivery channel](https://docs.peaq.xyz/peaqos/sdk-reference/stream-distribution.md#p2p-delivery) can replace S3.

#### `peaqos stream pay`

Buyer-side. Transfer tokens on-chain to a seller, native or ERC-20/SPL on `peaq`, `base`, or `solana`, and optionally submit the transaction hash as payment proof in the same run. With `--confirmation-url`, proof is submitted right after the transfer; without it, only the transfer executes and the CLI prints the matching `peaqos stream payproof` command. In human output the tx hash is written to stdout before the proof step, so it survives a failed proof submission. With `--json` the one JSON object prints after the proof step; when proof submission fails it still carries the tx hash, with `proof` set to `null`.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
# Base USDC transfer with proof submission
peaqos stream pay \
  --seller-address 0xSeller... \
  --amount 1.0 \
  --chain base \
  --order-id order-002 \
  --rpc-url https://mainnet.base.org \
  --token-address 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 \
  --confirmation-url https://api.example.com/payments/proof
```

Required: `--seller-address` (EVM `0x...` or Solana base58), `--amount` (human-readable, e.g. `"10.5"`), `--chain`, `--order-id`.

Optional: `--confirmation-url`, `--token-address` (ERC-20 contract or SPL mint; omit for the native token), `--token-decimals` (override for tokens outside the well-known registry), `--rpc-url` (required for `base` and `solana`), `--private-key-file` (falls back to `PEAQOS_PRIVATE_KEY`; EVM chains only), `--json` (`proof` is `null` when no confirmation URL was given). `--chain solana` signs with the OWS wallet's Solana account instead: it needs `PEAQOS_OWS_WALLET` (and `OWS_PASSPHRASE` when non-interactive), the raw key is ignored for the Solana transfer (the OWS wallet's Solana account signs).

Exit codes: `0` success, `1` validation or signing failure (messages never contain key material; Solana support needs `pip install "peaq-os-sdk[solana]"`), `2` insufficient balance, revert, or proof HTTP failure, `3` missing config.

#### `peaqos stream payproof`

Buyer-side. Submit payment proof for a transfer completed outside `peaqos stream pay`, or retry a proof step that failed.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos stream payproof \
  --tx-hash 0xabc123... \
  --order-id order-001 \
  --confirmation-url https://api.example.com/payments/proof \
  --chain peaq \
  --payer-address 0xPayer... \
  --payee-address 0xSeller... \
  --amount 10.5
```

Required: `--tx-hash` (EVM hash or Solana signature), `--order-id`, `--confirmation-url`, `--chain`, `--payer-address`, `--payee-address`, `--amount` (must match the original transfer). Optional: `--token`, `--token-address`, `--json`. Exit codes: `0` success, `1` validation, `2` proof HTTP failure, `3` missing config.

### Solana payments

There is no `peaqos solana` command group. Solana is selected per command: `peaqos activate --chain solana` homes a machine there ([Solana home](#solana-home)), and `peaqos stream pay --chain solana` sends native or SPL transfers itself (requires `--rpc-url` and, for SPL, the mint via `--token-address`; install with `pip install "peaq-os-sdk[solana]"`). Solana-quoted **Machine Market** orders are paid externally: complete the SPL transfer with your own Solana wallet, then pass `--payment-tx-hash` to `peaqos scale order` so the orchestrator records it as the payment proof. Solana proofs are recorded, not verified on chain.

### `peaqos monetize`

Manage a machine's **Economics 2.0 monetization** decision in the MCR: `status` is a public read; `opt-in` and `opt-out` are signed, off-chain decisions. Thin wrappers over the SDK's [opt-in client](https://docs.peaq.xyz/peaqos/sdk-reference/monetization-opt-in.md): the SDK runs the compatibility check, EIP-191 signing, retries, HTTP, and response validation; the CLI adds parsing, prompts, and output.

The MCR at `https://mcr.peaq.xyz` serves every machine and publishes the `/.well-known/peaq-monetization` signal. `peaqos monetize status <decimal id>` returns `PENDING` for a machine that has never opted in. `agung-2026-08-28` has no paired MCR and exits `3` with `CONFIG_ERROR`.

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos monetize status  KEY [--timeout-seconds 30.0] [--max-unavailable-retries 2] [--unavailable-retry-delay-seconds 1.0] [--json]
peaqos monetize opt-in  KEY [same options] [--yes] [--json]
peaqos monetize opt-out KEY [same options] [--yes] [--json]
```

`KEY` is a canonical decimal machine ID or `did:peaq:<decimal machine id>`. Address DIDs (`did:peaq:0x…`), leading zeros, signs, hex, and exponents are rejected locally: an address DID names an account, not a machine.

Every command uses the deployment `PEAQOS_DEPLOYMENT_ID` selects (`peaq-mainnet` when unset). The SDK resolves the MCR URL, chain ID, `MachineRegistry`, and API version from that deployment and the server's live compatibility signal (`GET /.well-known/peaq-monetization`). `PEAQOS_RPC_URL` is not read. `status` needs no signer; writes sign with the selected OWS wallet or, without one, `PEAQOS_PRIVATE_KEY`, and the signing address must be the machine's current **owner or DID controller** (a machine-wallet-only key is not authorized).

Before a write the CLI reads the current state; an already-satisfied state returns without a prompt, signature, or PUT. Only `503 MACHINE_UNAVAILABLE` is retried. A timeout during a PUT is ambiguous (the MCR may have applied it): rerun the same command, which reads first and sends no second PUT if the state is already there.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
# Replace the example ID with your own machine ID
peaqos monetize opt-in did:peaq:57896044618658097711785492504343953926634992332820282019728792003956564819975
peaqos monetize status 57896044618658097711785492504343953926634992332820282019728792003956564819975 --json
```

```json theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
{ "machine_id": "57896044618658097711785492504343953926634992332820282019728792003956564819975", "status": "OPTED_IN", "signer": "0x7099...79C8", "updated_at": 1783944004 }
```

A machine's state starts at `PENDING`; [Tokenomics 1.0](https://docs.peaq.xyz/peaqos/concepts/economics-2-0.md#legacy-machines) decisions and signatures are not imported.

| Situation | Exit |
| :- | :- |
| Invalid or non-canonical `KEY` or option value; declined prompt; non-TTY write without `--yes` | `1` |
| Signer not owner or controller (`UNAUTHORIZED_SIGNER`); ineligible opt-in (`MACHINE_NOT_BONDED`, `MACHINE_DEACTIVATED`); network, timeout, or API rejection | `2` |
| Unknown `PEAQOS_DEPLOYMENT_ID` or a deployment with no MCR (`CONFIG_ERROR`); MCR compatibility mismatch, including a compatibility endpoint that answers a non-2xx status or a non-JSON body (`MONETIZATION_API_INCOMPATIBLE`) | `3` |

### `peaqos monetize provision`

Provision an **opted-in** machine as a compute provider node from a schema-driven manifest, entirely from the terminal. Thin wrappers over the SDK's [manifest runner](https://docs.peaq.xyz/peaqos/sdk-reference/provisioning.md): every command, secret redaction, and verification probe runs inside the SDK; the CLI adds prompts, terminal rendering, and the resume state file.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos monetize provision run       <provider> --machine <key> [--mode manual|auto] [--grant-sudo]
peaqos monetize provision preflight <provider> [--inputs <file>]
peaqos monetize provision verify    <provider> [--state-file <path>] [--json]
```

* `<provider>` is the manifest provider key (for example `akash`). Requires `PEAQOS_MANIFEST_REPO_URL` or `--manifest-repo`; `--manifest-version` pins a manifest version (default: latest).
* `run` walks the full flow: monetization pre-check (anything but `OPTED_IN` stops before the manifest is even fetched), manifest fetch pinned by sha256, input collection (`--inputs` file plus hidden prompts for secrets), blocking pre-flight, provisioning with a state checkpoint after each step, and verification probes that alone decide success.
* `--mode manual` (default) confirms each command; `--mode auto` runs unattended and requires `--grant-sudo`, scoped to the manifest's `allowedCommands`. Owner-action handoffs (funding, DNS, signing) always pause, even with `--yes`.
* `--machine` takes a decimal machine ID or `did:peaq:<decimal id>` (address DIDs are rejected), so the machine wallet address for the manifest's commission context must come from `PEAQOS_MACHINE_WALLET_ADDRESS`. Unset it before provisioning a different machine. The monetization pre-check goes through the 2.0 SDK read against the deployment's MCR (`mcr.peaq.xyz`).
* `--resume` continues an interrupted run from the state file (default `./peaqos-provision-state.json`, written atomically with `0600`). Non-secret inputs are restored; secrets are re-prompted, never persisted.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
# Full manual run
PEAQOS_MACHINE_WALLET_ADDRESS=0x9a5F...37C5 peaqos monetize provision run akash \
  --machine 57896044618658097711785492504343953926634992332820282019728792003956564819975 --inputs ./akash-inputs.yaml

# Re-check a provisioned node against the pinned manifest
peaqos monetize provision verify akash --json | jq '.[] | select(.passed == false)'
```

### `peaqos verify`

Read a machine's [Verify](https://docs.peaq.xyz/peaqos/functions/verify.md) record and build local chip preflight artifacts. Experimental: the command names are stable for v1 beta, the output may still change. Reads need only a Verify API origin: no wallet, private key, RPC or deployment ID.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
export PEAQOS_VERIFY_API_URL=https://mcr.peaq.xyz   # or the root flag --verify-api-url

peaqos verify status 123          # 123 is a placeholder (prints "Machine not found in the Verify service."); put in your own machine ID
peaqos verify status 123 --json
```

The root option `--verify-api-url <origin>` (before the command name) takes precedence over `PEAQOS_VERIFY_API_URL`, which the CLI also reads from `.env`. The value must be an HTTPS origin; there is no default and no fallback to the MCR host, so a missing value exits `3` with `Set PEAQOS_VERIFY_API_URL to a valid HTTPS origin.`

#### `peaqos verify status`

One `GET /v1/verify/machines/{machineId}` through the SDK read client ([API reference](https://docs.peaq.xyz/peaqos/api-reference/get-verify-machine.md)): one attempt, five-second deadline, no retry, no redirect, no cache. `MACHINE_ID` is the decimal machine ID (`1` to `2^256-1`, no leading zeros); a DID or an address exits `1`.

Human output prints the machine DID, the home chain (`peaq (EVM)`, `Agung testnet (EVM)`, `Solana`, or `EVM chain <id>` for an unnamed chain), the DID controller, the operator, the KYB and chip statuses, and `Source: Verify API`. `--json` prints the API record unchanged: `machineId`, `machineDid`, `homeChain`, `didController`, `operator`, `verification.kyb.status`, `verification.chip.status`. The root option `--quiet` (`peaqos --quiet verify status ...`) keeps the data output.

Each status is `unverified`, `verified`, `expired` or `revoked`. An existing machine with both `unverified` is a successful read.

| Exit | When |
| :- | :- |
| `0` | Record printed (including `unverified`) |
| `1` | `MACHINE_ID` is not a canonical decimal in range |
| `2` | Machine not found, rate limited, service unavailable, timeout, connection failure, an invalid response, or canceled with Ctrl+C |
| `3` | No or invalid `PEAQOS_VERIFY_API_URL`, or an installed `peaq-os-sdk` without `peaq_os_sdk.verify` |

An unknown machine prints `Machine not found in the Verify service.` and a rate limit prints `Verify API rate limit reached; retry later.` A `503` prints `Verify state is temporarily unavailable; retry later.` A Solana-homed machine always gets this message, and retrying does not help. A canceled read prints `Verify status request was canceled; retry when ready.` An invalid response says `do not treat it as verification state`.

#### `peaqos verify chip`

Three stages that turn a challenge, the chip's leaf certificate and two signatures into the canonical `peaq.verify.chip-evidence/1` document peaq's onboarding service submits. Every option is a file path, so no nonce, signature or certificate lands in argv or shell history. The commands never talk to the chip, a wallet or the Verify API, and hold no key: the chip signature comes from the secure element, the controller signature from the DID controller's wallet. Each stage rebuilds the earlier ones from the same files, so nothing is cached or resumed. Chip preflight is EVM-only in v1. The full flow, including the challenge and the submission the onboarding service runs, is in [Verify a chip, end to end](https://docs.peaq.xyz/peaqos/functions/verify.md#verify-a-chip-end-to-end).

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
# 1. context.json holds six fields of the onboarding service's challenge; leaf.der is the certificate read from the chip's 0xE0E0 object
peaqos verify chip prepare \
  --context context.json --certificate leaf.der --out prehash.bin

# 2. Have the chip's 0xE0F0 key sign prehash.bin (ECDSA without hashing, it is already the digest) -> chip-signature.bin
peaqos verify chip controller-request \
  --context context.json --certificate leaf.der \
  --chip-signature chip-signature.bin --out controller-message.bin

# 3. Have the current DID controller sign controller-message.bin once as an EIP-191 personal message -> controller-signature.bin
peaqos verify chip finalize \
  --context context.json --certificate leaf.der \
  --chip-signature chip-signature.bin \
  --controller-signature controller-signature.bin --out evidence.json
```

| Flag | File | Limit |
| :- | :- | :- |
| `--context` | The challenge the onboarding service issued | Strict JSON with exactly `chainId`, `didController`, `expiresAt`, `machineDid`, `machineId` and `nonce`, all strings, at most 4096 bytes. The challenge response also has `profile`, `protocol` and `verifier`; remove them first (`jq '{chainId, didController, expiresAt, machineDid, machineId, nonce}'`) |
| `--certificate` | Leaf certificate from `0xE0E0` | At most 1300 DER bytes |
| `--chip-signature` | Chip signature in the chip's native form: `r` and `s` as two DER integers with no `SEQUENCE` header | At most 80 bytes |
| `--controller-signature` | DID controller signature as raw binary (`r`, `s`, `v` with `v` 27 or 28), not hex | Exactly 65 bytes |
| `--out` | The artifact to write | Must not exist yet. Created `0600` and never overwritten, so there is no `--force` |

Every stage prints `Authority: local preflight only`; `finalize` also prints the fixed identifiers:

* `Protocol: peaq.verify.chip-proof/1`
* `Profile: infineon-optiga-trust-m-express-ca306/1`
* `Evidence Schema: peaq.verify.chip-evidence/1`
* `Trust Bundle: infineon-optiga-trust-m-express-ca306-roots/1`
* `Revocation Status: not_evaluated`

`--json` on any stage prints one metadata object (`stage`, `artifact`, `byteLength`, `authority`, plus the five identifiers on `finalize`) and never the artifact bytes, a path, a DID or an address.

> [!NOTE]
>
> Hand `evidence.json` unchanged to the onboarding service that issued the challenge; it submits the file with [`POST /v1/verify/chip/evidence`](https://docs.peaq.xyz/peaqos/api-reference/post-verify-chip-evidence). Delete the artifacts afterwards. A successful `finalize` is not a verified machine. Read the state with `peaqos verify status`.

The challenge is valid for at most five minutes and every stage rechecks it against the local clock. Failures print one line naming the input and the constraint, for example `Chip prepare failed because the challenge is outside its freshness window. Request a new challenge and retry.`

| Exit | When |
| :- | :- |
| `0` | Artifact written |
| `1` | Invalid input file, rejected chip or controller signature, expired challenge, or `--out` cannot be created |
| `2` | Unexpected internal failure, or canceled with Ctrl+C (`Chip <stage> was canceled; retry when ready.`) |
| `3` | Installed `peaq-os-sdk` without the preflight functions |

### `peaqos scale`

Machine Market orchestration commands. Pair an AI agent to an activated machine, search the curated catalogue, and drive the full purchase loop.

The `peaqos scale` surface: `agent pair`, `machine onboard` (plus `machine status [MACHINE_ID]` and `machine list`, both with `--json`; `list` exits 0/2/3, `status` 0/1/2/3), `search`, and the `scale order` family: place (dispatched from a service UUID), `status`, `list` with cursor pagination, `received`, `dispute`. Order placement also supports the x402 (A web payment standard where a server answers 'payment required' with exact instructions, and the buyer's wallet signs an authorization instead of sending a separate transaction. Built for machines and agents paying per request.) payment rail.

#### Setup

Two env vars, both optional in `load_client()`. Override at any point with the root-level flags `--orchestration-url` / `--orch-api-key`.

| Env var | CLI override | Purpose |
| :- | :- | :- |
| `PEAQOS_ORCHESTRATION_URL` | `--orchestration-url <url>` | Machine Markets API base URL |
| `PEAQOS_ORCH_API_KEY` | `--orch-api-key <key>` | Platform API key (`x-api-key` header) |

**Scale is paused.** Machine Markets is not open to new partners yet. The orchestrator accepts active, bonded machines homed on peaq or on Solana; the machine's DID controller signs the identity proof (an EVM address on peaq, a Solana public key on Solana), and an agent pairs with an EVM or a Solana wallet. Any other machine is refused with `403 MACHINE_NOT_ACTIVATED` (see [Scale](https://docs.peaq.xyz/peaqos/functions/scale.md)).

`peaqos init` prompts for both during the wizard and writes them as active `.env` lines (not commented placeholders). The API key is entered at a hidden prompt (not echoed to the terminal), then written to `.env` in plaintext, so treat the file as a secret:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
# Machine Market orchestration
PEAQOS_ORCHESTRATION_URL=https://orchestration.peaq.xyz
PEAQOS_ORCH_API_KEY=<your-orch-api-key>
```

`peaqos init --non-interactive` reads both from existing env vars.

The pairing token returned by `agent pair` is the credential for agent-side commands. Save it once to a single-line file with `chmod 600` and reference it via `--pairing-token-file`.

**Signature schemes.** The orchestrator picks the signature scheme from the signer, never from a CLI flag: an EVM address (`0x` + 40 hex) gets an EIP-191 (A standard way to sign a plain message to prove you control an EVM account, without sending any on-chain transaction.) challenge, a Solana public key (base58, 32 bytes) gets an ed25519 (The signature scheme of Solana wallets. peaqOS verifies a base58 signature over the exact challenge message, with no transaction and no prefix.) one, and the challenge says which in `verificationMethod`. `scale machine onboard`, `scale agent pair` and `scale agent refresh` sign either through the SDK (`sign_machine_identity_challenge` / `sign_agent_pairing_challenge`); the CLI never builds the message. The EVM path, its output and its exit codes are unchanged. On an `ed25519` challenge the server's four outcomes are exit `2`, with the server's own message appended after `—`; the EVM codes `MACHINE_IDENTITY_PROOF_*` and `AGENT_PAIRING_PROOF_*` stay as they were.

| Code | HTTP | CLI message |
| :- | :- | :- |
| `PROOF_METHOD_MISMATCH` | 400 | `The signature scheme does not match the challenge. Sign with the signer the challenge named: an EVM key for eip191, a Solana key for ed25519.` |
| `PROOF_SIGNATURE_INVALID` | 400 | `The signature does not verify over the challenge message. Sign the exact message shown by this run, with no prefix, hash or envelope, and retry.` |
| `PROOF_SIGNER_MISMATCH` | 400 | `The signing key is not the controller or agent named in the challenge. Check that you are signing with the correct key.` |
| `PROOF_EXPIRED` | 401 | `The challenge has expired. Run the command again to request a new one.` |

The CLI's own checks make the first and third unreachable in practice: a key file or wallet always signs in the scheme its address form implies, a pasted value that is not base58 of 64 bytes is refused before any request, and the same address goes to the challenge and the create call (a keypair or wallet that is not that address is refused before any request). An SDK pre-check refusal (a signer the challenge did not seal, a signature that is not 64 bytes) is exit `1` with its field and constraint. `--json` on these commands prints the SDK's snake\_case dump of the record (`identity_proof.method`, `verification.method`, `agent_did`, `pairing_token`), not the API's camelCase wire shape.

#### `peaqos scale machine onboard`

Operator-facing. Walks a machine through the four-step orchestration onboard: request an identity challenge (A login-style handshake: the server sends a random message, you sign it with your key, and the signature proves you control the account without sending the key.), sign (Using your private key to produce a cryptographic stamp proving you approved a specific action, without ever revealing the key.) with the DID controller key, register the machine with proof attached, then activate (unless `--skip-activate`). Hits `POST /api/v1/machine-identity/challenges` and `POST /api/v1/machines`. The challenge names the scheme: `eip191` for a peaq-homed machine (an EVM controller address), `ed25519` for a Solana-homed one (a base58 controller key). Activation sends no proof; the server reuses the one stored at registration.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos scale machine onboard \
  --identity-ref did:peaq:<decimal machine id> \
  --display-name "rover-014" \
  --owner-id op_xyz \
  --machine-type qvac \
  --runtime-profile machine-runtime-agent
```

Required: `--identity-ref`, `--display-name`, `--owner-id`, `--machine-type`, `--runtime-profile`.

Optional: `--capabilities` (CSV), `--skill-keys` (CSV), `--labels` (`KEY=VALUE,...`), `--identity-key-file`, `--skip-activate`, `--yes`, `--json`.

Signing modes, checked in order: `--identity-key-file` (the CLI signs in-process with the DID controller's key), the OWS wallet named by `PEAQOS_OWS_WALLET` (signs with the active wallet), or none of them, in which case the CLI prints the challenge and prompts for a pasted signature. `--json` requires one of the first two. `--identity-signature-file` is retired and refused before any request: the challenge carries a server nonce, so a signature prepared before the run cannot match it.

**Solana-homed machines.** After the challenge the scheme selects what each mode does. `--identity-key-file` holds a `0x` + 64 hex key for a peaq-homed machine or a `solana-keygen` JSON keypair (an array of 64 integers) for a Solana-homed one; a key of the wrong kind exits `1` after the challenge is shown and before anything is registered (`The challenge is ed25519 (Solana-homed machine); --identity-key-file holds an EVM key.`, and the converse). OWS mode signs with the wallet's Solana account, whose public account is checked against the challenge's controllers before the passphrase is asked for (exit `1` listing them on a mismatch). Paste mode prompts `Paste the base58 ed25519 signature`. The SDK refuses a signer that is not one of `controller_addresses` with exit `1`; the activation `PATCH` carries no proof.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
# Solana-homed machine, controller keypair file
peaqos scale machine onboard --identity-ref did:peaq:42 --display-name "Dock 7" \
  --owner-id operator-42 --machine-type robot --runtime-profile linux-docker \
  --identity-key-file ./controller-keypair.json --yes
```

Step 2 prints the challenge, then `Method:` and one `Controller:` line per controller key, in full, then the signing lines (stderr; `--json` suppresses them). From a keypair run:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
Identity:    did:peaq:9007199254740993
Method:      ed25519
Controller:  7cixCgDw6yN6L8s2qVzznm7aJjMBMFc1PHjtGQLm8Xeh

      Signed with key from <keys>/controller.json
      Signer: 7cixCgDw6yN6L8s2qVzznm7aJjMBMFc1PHjtGQLm8Xeh
[3/4] Registering machine...
[4/4] Activating machine...
```

The result adds a `Proof:` line for any stored proof (`eip191 by 0x1111...1111` for a peaq-homed machine; a record without a stored proof omits the line):

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
Machine onboarded successfully (active).

  Machine ID:  mach_ec8be0ceedf5
  Identity:    did:peaq:9007199254740993
  Status:      active
  Name:        Dock 7
  Proof:       ed25519 by 7cixCgDw6yN6L8s2qVzznm7aJjMBMFc1PHjtGQLm8Xeh

  Next: peaqos scale agent pair --machine-id mach_ec8be0ceedf5
```

`--json` prints the full machine; its `identity_proof` carries the scheme, the signer and the challenge nonce the server stored (`mid_…`, not the `mic_…` id the proof was submitted with):

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
  "identity_proof": {
    "method": "ed25519",
    "identity_ref": "did:peaq:9007199254740993",
    "signer_address": "7cixCgDw6yN6L8s2qVzznm7aJjMBMFc1PHjtGQLm8Xeh",
    "challenge_id": "mid_b00e4be1f478773dabb9b45a5bdba222",
    "verified_at": "2026-10-20T22:38:30.384Z",
    "challenge_expires_at": "2026-10-20T22:48:30.356Z",
    "controller_addresses": [
      "7cixCgDw6yN6L8s2qVzznm7aJjMBMFc1PHjtGQLm8Xeh"
    ],
    "resolution_source": "peaqos-mcr",
    "extra": {}
  },
```

Exit codes: `0` happy path, `1` input error (a key file of the wrong kind, a pasted value that is not a signature, the retired flag), `2` server / proof error (`MACHINE_IDENTITY_EXISTS`, `MACHINE_IDENTITY_PROOF_INVALID`, `MACHINE_NOT_ACTIVATED`, `PEAQOS_IDENTITY_UNAVAILABLE`, and on an `ed25519` challenge `PROOF_METHOD_MISMATCH`, `PROOF_SIGNATURE_INVALID`, `PROOF_SIGNER_MISMATCH`, `PROOF_EXPIRED`), `3` missing `PEAQOS_ORCHESTRATION_URL`. Two of the `ed25519` outcomes as the CLI prints them:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
Error: The signature does not verify over the challenge message. Sign the exact message shown by this run, with no prefix, hash or envelope, and retry. — machine identity signature is invalid
```

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
Error: The challenge has expired. Run the command again to request a new one. — machine identity challenge has expired
```

#### `peaqos scale agent pair`

Operator-facing. Pairs an AI agent to a machine via a three-step challenge-sign flow. Returns a one-time signed-JWT `pairingToken`.

Internally the command:

1. Calls `client.orchestration.create_agent_pairing_challenge(machine_id, params)` for a server-issued challenge keyed to `agentAddress`, `agentProvider`, `agentRole`, and optional `agentDid`. The server picks the scheme from `--agent-address`: an EVM address gets an EIP-191 (A standard way to sign a plain message to prove you control an EVM account, without sending any on-chain transaction.) challenge, a base58 Solana public key an ed25519 (The signature scheme of Solana wallets. peaqOS verifies a base58 signature over the exact challenge message, with no transaction and no prefix.) one.
2. The challenge message is signed with the wallet key behind `agentAddress`, in the scheme the challenge names: by the CLI with `--agent-key-file <path>` or `--agent-wallet <name>`, or by the agent wallet, whose signature the operator pastes at the prompt (the CLI prints the message). For an EVM agent the CLI checks that the signature recovers to `--agent-address` before submitting; for a Solana agent the SDK checks that the signer is `--agent-address` (an exact base58 compare).
3. Calls `client.orchestration.create_agent_pairing(machine_id, params_with_proof)` to persist the pairing and issue the session JWT.

| Signer source | Option | `eip191` challenge (EVM `--agent-address`) | `ed25519` challenge (base58 `--agent-address`) |
| :- | :- | :- | :- |
| Key file | `--agent-key-file` | `0x` + 64 hex | `solana-keygen` JSON keypair (an array of 64 integers) |
| OWS wallet | `--agent-wallet NAME` | refused: `--agent-wallet signs Solana agents only; use --agent-key-file for an EVM agent.` | the wallet's Solana account; the vault passphrase is prompted or read from `OWS_PASSPHRASE`, and `PEAQOS_OWS_WALLET` is never used for the agent |
| Paste | none | `Paste the EIP-191 signature` | `Paste the base58 ed25519 signature` |

`--agent-key-file` and `--agent-wallet` are mutually exclusive, and `--json` requires one of them. Before any request the CLI checks the address form (`--agent-address must be an EVM address (0x + 40 hex) or a Solana public key (base58, 32 bytes).`), that the key file's kind matches it (`--agent-key-file holds an EVM key, but --agent-address is a Solana public key.`, and the converse), and that a keypair's public key or the wallet's public Solana account is the agent address; no passphrase is asked for before that check. Each refusal is exit `1` with nothing submitted:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
Error: The keypair in <keys>/agent2.json signs as 92UHVHMwu5ZkhWfnHhScxqSyoHJMrSee2y8CXB9bxp5T, not the agent address CW2RYZdKooRdxKjpNBDXgM78tbj9KfSxk7ioL4NjDkcv. Nothing was submitted.
```

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
Error: Wallet agent-wallet holds AGUc67Xjkuq6qTaJM113Pxb1ysttiiDrzYtHmWQNosp3, not the agent address CW2RYZdKooRdxKjpNBDXgM78tbj9KfSxk7ioL4NjDkcv. Nothing was signed.
```

`--agent-signature-file` is retired and refused before any request, for both schemes: a signature prepared before the run cannot match the run's nonce.

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
Error: --agent-signature-file is no longer supported: a signature prepared before this run cannot sign its fresh challenge message.

  Use --agent-key-file or --agent-wallet, or omit both and paste the agent's signature at the prompt.
```

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos scale agent pair \
  --machine-id mach_61f043950cf1 \
  --agent-address 0xagent...0101 \
  --agent-did did:pkh:eip155:1:0xagent...0101 \
  --agent-provider teneo \
  --agent-role machine-market-buyer \
  --agent-key-file ./agent.key \
  --per-tx-limit 5 --daily-limit 20 --currency USD \
  --allowed-skills agentic-market-claude-inference,pay-sh-google-generative-language \
  --allowed-service-ids svc_abc \
  --denied-service-ids svc_xyz
```

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
# Solana agent, OWS wallet
peaqos scale agent pair --machine-id mach_61f043950cf1 \
  --agent-address 4ajKRcMqWNAd3k2rQRSA5FVCUrk2g9p3b6tZTZ2ZBCo8 \
  --agent-did did:pkh:solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:4ajKRcMqWNAd3k2rQRSA5FVCUrk2g9p3b6tZTZ2ZBCo8 \
  --agent-provider teneo --agent-role machine-market-buyer \
  --agent-wallet trading-agent --json
```

Required: `--machine-id`, `--agent-address`, `--agent-provider`, `--agent-role`.

Optional: `--agent-did`, `--agent-key-file` (the agent's private key file, which must match `--agent-address`; signs this run's challenge), `--agent-wallet` (the OWS wallet whose Solana account is the agent; Solana agents only), `--description`, `--per-tx-limit`, `--daily-limit`, `--currency`, `--allowed-skills` (CSV), `--denied-skills` (CSV), `--allowed-service-ids` (CSV), `--denied-service-ids` (CSV), `-y`/`--yes` to skip the confirmation prompt, `--json` for raw JSON (implies `--yes`; requires `--agent-key-file` or `--agent-wallet`). Without either the CLI prints the challenge message and prompts for the agent's pasted signature.

`--agent-did` takes `did:pkh:eip155:<chainId>:<address>` for an EVM agent or `did:pkh:solana:<reference>:<base58 key>` for a Solana agent, and goes to the server as given; the CLI derives no DID. Omitted, the server derives `did:pkh:eip155:1:<address>` or `did:pkh:solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:<key>` (the Solana mainnet reference), so a devnet agent passes its own `did:pkh:solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1:<key>`.

Preconditions: `PEAQOS_ORCH_API_KEY` set. Machine already active in peaqOS or the server returns `MACHINE_NOT_ACTIVATED` and the CLI exits 2.

Step 2 names the signer (stderr; `--json` suppresses the steps, `--quiet` hides them but never the signing material). From a keypair run and from a wallet run:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
[1/3] Requesting pairing challenge...
[2/3] Waiting for agent signature...
      Signed with key from <keys>/agent2.json
      Signer: 92UHVHMwu5ZkhWfnHhScxqSyoHJMrSee2y8CXB9bxp5T
[3/3] Creating pairing...
```

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
[1/3] Requesting pairing challenge...
[2/3] Waiting for agent signature...
      Signed via OWS wallet agent-wallet (solana)
      Signer: AGUc67Xjkuq6qTaJM113Pxb1ysttiiDrzYtHmWQNosp3
[3/3] Creating pairing...
```

The pairing summary includes `Agent DID`, `Session ID`, `Session Expires`, and `Verification` lines; a base58 agent is abbreviated on the `Agent` line and printed in full on the other two. The token prints exactly once on stdout, never written to `peaqos.log` or `--verbose` output:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
Agent paired successfully.

  Pairing ID:       pair_6cf626d53890
  Machine ID:       mach_be1b392cb2c5
  Agent:            92UH...xp5T
  Provider:         teneo
  Role:             machine-market-buyer
  Per-tx limit:     —
  Daily limit:      —
  Agent DID:        did:pkh:solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:92UHVHMwu5ZkhWfnHhScxqSyoHJMrSee2y8CXB9bxp5T
  Session ID:       aps_86e22fab8c1a74b1c43affedbc26c165
  Session Expires:  2026-10-20T23:38:45.000Z
  Verification:     ed25519 by 92UHVHMwu5ZkhWfnHhScxqSyoHJMrSee2y8CXB9bxp5T
  Token hint:       ...cTho

  !! Pairing token (shown once — store securely):
  [REDACTED pairing token]
```

`--json` prints the full pairing (snake\_case); with `--agent-did` omitted, `agent_did` is the server-derived mainnet form and `verification` carries the scheme and the signer:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
  "agent_did": "did:pkh:solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:CW2RYZdKooRdxKjpNBDXgM78tbj9KfSxk7ioL4NjDkcv",
  "verification": {
    "method": "ed25519",
    "signer_address": "CW2RYZdKooRdxKjpNBDXgM78tbj9KfSxk7ioL4NjDkcv",
    "verified_at": "2026-10-20T22:38:44.193Z",
    "challenge_expires_at": "2026-10-20T22:48:44.188Z"
  },
```

A pasted signature that does not verify is `PROOF_SIGNATURE_INVALID`, exit `2`:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
Error: The signature does not verify over the challenge message. Sign the exact message shown by this run, with no prefix, hash or envelope, and retry. — agent pairing signature is invalid
```

Pipe the token to a file:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos scale agent pair ... --agent-key-file ./agent.key --json | jq -r .pairing_token > ~/.peaqos/agent.token
chmod 600 ~/.peaqos/agent.token
```

Session tokens expire (default 1 hour). Rotate with `peaqos scale agent refresh <pairing-id>`, or from your own tooling with `client.orchestration.create_agent_pairing_session(...)` (Python) or `createAgentPairingSession(...)` (JS).

#### `peaqos scale agent refresh <pairing-id>`

Issues a fresh session token for an existing pairing. It takes the pairing ID and its stored agent bindings, requests a fresh challenge, signs it with the same signer sources and checks as `scale agent pair` (`--agent-key-file` with a `0x` key or a `solana-keygen` keypair, `--agent-wallet NAME`, or the paste prompt), and sends only the new `agent_proof` to the session endpoint. The server verifies the proof against the stored pairing, not the request. `--machine-id`, `--agent-address`, `--agent-provider` and `--agent-role` are required (a missing one is a usage error, exit `2`); pass the pairing's stored `--agent-did` when one was supplied at creation (a devnet agent), and omit it only when the server derived the DID.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos scale agent refresh pair_67c50f8fdd3c \
  --machine-id mach_61f043950cf1 \
  --agent-address 4ajKRcMqWNAd3k2rQRSA5FVCUrk2g9p3b6tZTZ2ZBCo8 \
  --agent-provider teneo --agent-role machine-market-buyer \
  --agent-wallet trading-agent --json
```

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
Usage: peaqos scale agent refresh [OPTIONS] PAIRING_ID
Try 'peaqos scale agent refresh --help' for help.

Error: Missing option '--machine-id'.
```

The result reads as for `pair`, with a new session and token; `--json` prints the full pairing with the new `session_*` fields:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
Agent session refreshed.

  Pairing ID:       pair_64df5ca7fbec
  Machine ID:       mach_be1b392cb2c5
  Agent:            CW2R...Dkcv
  Provider:         teneo
  Role:             machine-market-buyer
  Per-tx limit:     —
  Daily limit:      —
  Agent DID:        did:pkh:solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:CW2RYZdKooRdxKjpNBDXgM78tbj9KfSxk7ioL4NjDkcv
  Session ID:       aps_814049b57dee2e2c7b54193315dba20e
  Session Expires:  2026-10-20T23:38:47.000Z
  Verification:     ed25519 by CW2RYZdKooRdxKjpNBDXgM78tbj9KfSxk7ioL4NjDkcv
  Token hint:       ...D1to

  !! Pairing token (shown once — store securely):
  [REDACTED pairing token]
```

The expired-token hint on protected commands points here: `Pairing token has expired. Refresh it with 'peaqos scale agent refresh <pairing-id>' or create a new pairing.`

#### `peaqos scale search`

Agent-facing. Posts a market search and returns ranked service quotes. Hits `POST /api/v1/market/search` and renders the search record that request returns.

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
peaqos scale search \
  --machine-id mach_1 \
  --agent-pairing-id pair_1 \
  --service-type oracle.price-feed \
  --pairing-token-file ~/.peaqos/agent.token \
  --budget-amount 1 --budget-currency USD \
  --native-only
```

Required: `--machine-id`, `--service-type`, `--pairing-token-file`.

Optional: `--agent-pairing-id`, `--operation`, `--capabilities` (CSV), `--region`, `--max-results`, `--budget-amount`, `--budget-max`, `--budget-currency`, `--native-only`, `--allow-handoff`, `--provider-credentials` (path to JSON), `--json`.

Preconditions: machine active with verified `identityRef`, active agent pairing, pairing token in the token file. Provider credential file contents never appear on stdout, stderr, or in log output.

Output:

* Human mode: ranked quote table with columns `Service ID`, `Quote ID`, `Operation`, `Provider`, `Score`, `Execution`, `Integration`. Footer prints `Search ID: msearch_...` plus a concrete next-step hint: `peaqos scale order <service-id> --search-id <search-id> --quote-id <quote-id>`.
* Empty results print `No matching services found.` with the same aligned `Search ID:` line and broaden-your-search guidance.
* `--json` emits the full `MarketSearch` envelope. The raw `MarketSearchRequest` is constructed from typed SDK data classes, not raw dicts.

The `order` group is dynamic-dispatch. Any first token that is not `status`, `list`, `received`, `dispute` or `execute` is interpreted as a service UUID and routed to the placement flow. `peaqos scale order foo-bar` reads as "place an order for service `foo-bar`."

#### `peaqos scale order <service-uuid>`

Agent-facing. End-to-end purchase. Hits the [`POST /market/orders` + payment intent + execute](https://docs.peaq.xyz/peaqos/api-reference/machine-markets-orders) flow. Four payment paths chosen from the `MarketPayment` returned at order create:

* **No payment**: create → execute (2 steps).
* **Wallet payment**: create → intent → transfer → proof → execute (5 steps). If `PEAQOS_OWS_WALLET` is set the CLI auto-signs the ERC-20 transfer via OWS; otherwise it prompts for a pasted tx hash (or use `--payment-tx-hash`).
* **Escrow / handoff**: same five steps with the escrow (Holding a buyer's payment in a neutral locked place until the service is delivered, then releasing it, so neither side has to trust the other first.) rail (The specific method or channel a payment moves through, like choosing card vs bank transfer vs a particular token.).
* **x402**: create → intent → sign → proof → execute → confirm (6 steps), for paid-HTTP Agentic Market providers (e.g. Wolfram Alpha over USDC on Base). The CLI signs the provider's payment challenge locally with the active wallet (`client.account`, the OWS wallet when `PEAQOS_OWS_WALLET` is set, otherwise the local key) and hands the signed `PAYMENT-SIGNATURE` header to peaqOS, which pays the provider during execute. **No separate on-chain transfer**, no tx-hash prompt; delivery is confirmed automatically in step 6. If execution fails after proof is recorded, the error reports the current payment status so you can check whether the authorization is held.

Set `PEAQOS_ORDER_STEP_DELAY_SEC` to a non-negative number of seconds to pause between placement steps (demos, eventually-consistent order state); unset means no delay.

Required: `--machine-id`, `--agent-pairing-id`, `--pairing-token-file`.

Optional: `--search-id`, `--quote-id`, `--operation`, `--budget-amount`, `--budget-currency`, `--input <path>` (JSON object file; there is no `@file` shorthand), `--provider-credentials <path>` (JSON file with provider creds; never logged), `--payment-tx-hash`, `--payment-chain` (CAIP-2 alias: `base`, `peaq`, `agung`, `ethereum`/`eth`, `polygon`, `arbitrum`, `optimism`, `bsc`, `solana`), `--payment-token` (both required with `--payment-tx-hash`), `--skip-payment` (requires `--payment-tx-hash`), `-y`/`--yes`, `--json`.

`PEAQOS_RPC_URL` supplies the payment RPC for peaq; the other chains have built-in endpoints. Without it a peaq payment exits with a configuration error pointing at `--payment-tx-hash`.

Error codes: `QUOTE_EXPIRED`, `EXECUTION_UNSUPPORTED`, `PAYMENT_REQUIRED`, `PAYMENT_RPC_ERROR`, `PAYMENT_TX_FAILED`, `PAYMENT_TRANSFER_NOT_FOUND`, `ORDER_CLOSED`, `ORDER_NOT_DELIVERED`, `NOT_FOUND`.

`--json` suppresses placement progress and prints the JSON envelope to stdout. Global `--quiet` suppresses progress in human mode and sets logging to ERROR; errors still print to stderr.

#### `peaqos scale order status <order-id>`

Returns current state of the purchase. Read-only platform auth. Hits [`GET /market/orders/:orderId`](https://docs.peaq.xyz/peaqos/api-reference/machine-markets-orders) plus the payment lookup.

Optional: `--json` for the `{ order, payment }` envelope; `--pairing-token-file` to read the order with the agent's pairing token instead of platform auth.

Missing payment record (`NOT_FOUND`) is not an error: `payment` is `null` in the JSON envelope. Missing order ID exits 1.

#### `peaqos scale order list --machine-id <id>`

Lists orders for a machine. Hits [`GET /market/orders?machineId=...`](https://docs.peaq.xyz/peaqos/api-reference/machine-markets-orders).

Required: `--machine-id`.

Optional: `--limit <int>` (1-500, server default 100; outside range exits 1), `--cursor <opaque>` (from a prior `next_cursor`; never logged), `--json`.

Output behaviour:

* Human mode: one page, `N order(s) shown.` footer. When `next_cursor` is set, the CLI prints a copy-paste hint: `Next page: peaqos scale order list --machine-id <id> [--limit N] --cursor <verbatim>`.
* `--json` without `--limit`: auto-paginates all pages and emits a flat root-level JSON array.
* `--json` with `--limit`: emits a single-page envelope `{ "items": [...], "next_cursor": ... }`.

The CLI surfaces `next_cursor` (snake\_case) on stdout; the wire field is `nextCursor`.

#### `peaqos scale order received <order-id>`

Confirms delivery and marks the payment for release. It does not move funds. Requires `--pairing-token-file`. Hits [`POST /market/orders/:orderId/confirm`](https://docs.peaq.xyz/peaqos/api-reference/machine-markets-orders).

Optional: `--json`.

Status moves to `confirmed`, payment to `release_pending`. Error codes: `ORDER_NOT_DELIVERED`, `ORDER_CLOSED`, `AGENT_AUTH_INVALID`. Missing order ID or token file exits 1.

#### `peaqos scale order dispute <order-id>`

Raises a dispute. Requires `--reason` and `--pairing-token-file`. Hits [`POST /market/orders/:orderId/dispute`](https://docs.peaq.xyz/peaqos/api-reference/machine-markets-orders).

Optional: `--evidence <path>` (JSON object file), `-y`/`--yes` to skip the `Raise dispute? [y/N]` prompt, `--json` (also skips the prompt).

Status moves to `disputed`, payment to `frozen`. Error codes: `ORDER_CLOSED`, `AGENT_AUTH_INVALID`. Missing order ID, reason, or token file exits 1.

## Exit codes

Every subcommand funnels SDK and network exceptions through a single error handler that raises with a stable exit code.

| Exit code | Meaning |
| :- | :- |
| `0` | Success |
| `1` | User / validation error (invalid DID, a cap or rate-limit value the CLI rejects before any RPC, declined prompt). A quoted cost above a cap and an RPC that rate-limits reads are chain-side and exit `2`. An unknown flag or a value Click rejects exits `2` with a usage message |
| `2` | Network, RPC, or on-chain error (connection failure, HTTP, revert) |
| `3` | Configuration error (missing env var, invalid private key file, unknown `PEAQOS_DEPLOYMENT_ID`, incompatible MCR, Solana selected without `PEAQOS_SVM_RPC_URL` or without the `[solana]` extra, an SDK whose deployment record lacks a feature: `RENEWAL_TIER_UNSUPPORTED`, `LINK_PUSH_UNSUPPORTED`, `PEER_UNSET`; a deployment with no MCR or EventRegistry: `CONFIG_ERROR` / `ADDRESSES_UNSET`) |

`peaqos verify` uses `1`, `2` and `3` with the meanings in its own tables ([`verify status`](#peaqos-verify-status), [`verify chip`](#peaqos-verify-chip)): `verify status` exits `2` for an unknown machine, and `verify chip` exits `1` for a rejected signature or an expired challenge and `2` only for an unexpected failure or a cancellation. A missing `PEAQOS_VERIFY_API_URL` is a configuration error (`3`). `peaqos activate` adds a stable `error_code` to every failure after input validation (see [`peaqos activate`](#peaqos-activate)). `peaqos machine status --json`, `peaqos monetize status --json`, `peaqos monetize opt-in --json`, `peaqos monetize opt-out --json`, `peaqos qualify mcr --json`, `peaqos show machine --json` and `peaqos show operator machines --json` print exactly one JSON object on failure, with `status: "error"`, `error_code` (for example `CONFIG_ERROR`), `message`, `guidance`, plus `sdk_code` on machine reads and `context` on the MCR and monetize commands; the exit code is unchanged. Every `peaqos machine` write prints the same structured object for a failure inside its runner (plus the retained transaction context); input validation and configuration errors before the runner starts print a plain message. `peaqos monetize provision verify --json` prints a plain error message, after the probe rows if any ran.

## See also

> [card] [peaqOS AI](https://docs.peaq.xyz/peaqos/peaqos-ai.md)
>
> The peaqOS agent skill that drives these CLI flows from any AI agent.

> [card] [SDK reference](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-js.md)
>
> The TypeScript / Python API the CLI wraps.

> [card] [API reference](https://docs.peaq.xyz/peaqos/api-reference/overview.md)
>
> The MCR API that `qualify mcr`, `show machine`, and `show operator machines` hit.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.