> ## 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.

# Scale

> Delegate bounded authority to an AI agent so it can discover, buy, and consume services on your machine's behalf.

**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`. Catalogue reads over HTTP still answer: `GET /skills`, `GET /market/services` and `GET /market/adapter-credential-stack`.

Scale pairs 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.) to an activated, bonded (PEAQ locked when a machine activates, proving skin in the game. It is priced per tier in USD and converted to PEAQ at the oracle rate, and it is not withdrawable. Bonded means the deposit is in place.) machine and gives it delegated, bounded authority to search and order for the machine from its 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.), limited by spend limits and an allow/denylist that the orchestrator enforces. The agent discovers, buys, and consumes services through the [Machine Markets API](https://docs.peaq.xyz/peaqos/api-reference/machine-markets-overview.md). The agent is provisioned outside peaq; pairing, policy, discovery, ordering, payment, and execution happen through peaqOS.

It uses the machine's identity from [Activate](https://docs.peaq.xyz/peaqos/functions/activate.md) and the credit signal from [Qualify](https://docs.peaq.xyz/peaqos/functions/qualify.md). The machine's MCR (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.) and trust level (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).) carry through to providers when the agent buys.

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

## What ships

| Component | Description |
| :- | :- |
| Machine Agent pairing | Bind a third-party AI agent (Claude, OpenAI, Virtuals, Teneo, etc.) to a machine via a signed challenge (EIP-191 for an EVM agent, ed25519 for a Solana agent). peaqOS verifies the signature, persists the agent's identity and verification metadata, and issues a signed HS256 session JWT (`pairingToken`) the agent presents as `x-agent-pairing-token` on market writes. Tokens rotate via a sessions endpoint. |
| Delegation policy | Per-transaction limit, daily spend limit, currency, and allowed/denied skill keys and service IDs. Enforced server-side on every market call. Policy changes invalidate the session token's `delegationPolicyHash`; rotate after a `PATCH`. |
| Skill registry and service catalogue | Curated capabilities (`oracle.price-feed`, `compute.marketplace`, `compute.confidential`, `storage.object`, `data.location`, `identity.proof-of-person`, `device.control`, `machine.commerce`, `network.partner-console`) and the concrete provider services that fulfil them. |
| Market search | `POST /market/search` takes machine context, requirements, region, budget, and execution preferences and returns ranked `MarketQuote`s with reasons. |
| Market orders | `POST /market/orders` locks a service from a quote into an order with state machine `created → payment_pending → ready → executing → delivered → confirmed` (or `disputed` / `cancelled` / `failed` / `handoff`). Server-side policy and spend checks fire on create. |
| Payment intent and escrow | `payment-intent` selects a rail; `payment-proof` records or RPC-verifies on-chain payment; `payment/escrow-lock`, `payment/release`, `payment/refund` cover the escrow lifecycle. Solana proofs are recorded; EVM proofs verify via RPC against the ERC-20 Transfer log. |
| Execute and runtime endpoints | `POST /market/orders/:orderId/execute` materialises the order as a task plus route, dispatches to a native provider or a machine-side runtime endpoint registered via `PUT /machines/:machineId/runtime-endpoints/:providerKey` or heartbeated by an on-machine runtime agent, and writes a `Run` and `Outcome`. |
| Confirm and dispute | `POST /confirm` closes the order and moves held payment to `release_pending`; `POST /payment/release` records the release once the rail has settled. `POST /dispute` opens a dispute record and freezes payment. Pairings with non-terminal orders cannot be revoked (`OPEN_MARKET_ORDERS`). |
| Machine identity proof | DID-controller challenge and signature flow (EIP-191 for a peaq-homed machine, ed25519 for a Solana-homed one) that ties orchestration writes to the on-chain machine identity. |

## How it works

```mermaid theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
flowchart LR
  Owner["Proxy Operator /<br/>Machine Owner"] -->|provisions| Agent["Machine Agent<br/>(third-party AI)"]
  Owner -->|pairs + sets policy| Orch["Machine Markets API<br/>peaqOS Orchestration"]
  Agent -->|x-agent-pairing-token| Orch
  Orch -->|verifies identity| MCR["peaqOS MCR<br/>(on-chain truth)"]
  Orch -->|ranked quotes| Agent
  Agent -->|order, pay, execute, confirm| Orch
  Orch -->|consume| Providers["Skill providers<br/>(QVAC, agentic.market, pay.sh...)"]
```

1. **Activate the machine.** Pairing needs an active, bonded machine whose identity the orchestrator can resolve through the MCR API. Its DID controller signs the identity proof in step 2: an EVM address for a peaq-homed machine (the MCR `operator`), a Solana public key for a Solana-homed one (the MCR `controller`, or its `owner` when no controller is set). A machine with no such key is refused with `MACHINE_NOT_ACTIVATED`. Scale is paused (see the top of this page). See [CLI: Scale setup](https://docs.peaq.xyz/peaqos/cli.md#setup).
2. **Prove identity ownership.** `POST /machine-identity/challenges` returns a message that the DID-controller key signs in the scheme the challenge names in `verificationMethod`: EIP-191 (A standard way to sign a plain message to prove you control an EVM account, without sending any on-chain transaction.) for an EVM controller, ed25519 (The signature scheme of Solana wallets. peaqOS verifies a base58 signature over the exact challenge message, with no transaction and no prefix.) for a Solana one (see [Signing a challenge](https://docs.peaq.xyz/peaqos/api-reference/machine-markets-machines.md#signing-a-challenge)). The signed proof is attached when the machine is registered with the orchestration service.
3. **Provision a Machine Agent.** Get an agent from any provider you trust: Claude, OpenAI, Virtuals, Teneo, your own runtime. peaq does not provide the agent.
4. **Pair the agent.** 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.) is 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.)-based.
   1. `POST /machines/:machineId/agent-pairings/challenges` with the agent's `agentAddress`, `agentProvider`, `agentRole`, and optional `agentDid`. The response is an `AgentPairingChallenge` with `challengeId`, `message`, `expiresAt` and `verificationMethod` (`eip191` for an EVM `agentAddress`, `ed25519` for a base58 Solana public key: the server picks it from the address).
   2. The Machine Agent signs `message` with the wallet key behind `agentAddress`: EIP-191 `personal_sign` for an EVM key, ed25519 over the raw UTF-8 bytes for a Solana key.
   3. `POST /machines/:machineId/agent-pairings` with `agentProof: { challengeId, signature }` and the delegation policy. The orchestrator verifies the signature, persists the pairing with `verification` metadata, and returns the `AgentPairing` with a signed session JWT in `pairingToken`. Store it client-side and send it as `x-agent-pairing-token` on market writes.
   4. Tokens expire (default 1 hour). Rotate by issuing a fresh challenge and calling `POST /machines/:machineId/agent-pairings/:pairingId/sessions` with the new proof. Rotate after any `PATCH` to the delegation policy.
5. **Search the market.** The agent calls `POST /market/search` with machine context, service type, capabilities, region, budget, and optional `providerCredentials`. The orchestrator returns ranked `MarketQuote`s with reasons for each ranking.
6. **Place an order.** `POST /market/orders` with `machineId`, `agentPairingId`, `serviceId`, and optional `searchId` + `quoteId` creates an order (status `created`). The orchestrator enforces the delegation policy (The rules an owner gives an AI agent that cap how much it can spend per transaction and per day and which services it may use, so it transacts within guardrails.) and per-transaction and daily spend limits at create. The recommended payment rail (The specific method or channel a payment moves through, like choosing card vs bank transfer vs a particular token.) is copied from the service into `order.payment`.
7. **Settle payment.** `POST /market/orders/:orderId/payment-intent` mints a payment record on the chosen rail. For wallet-based rails, submit `POST /payment-proof` after the 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.) transfer (EVM proofs are RPC-verified against the ERC-20 Transfer log). For the x402 rail there is no buyer transfer: the agent wallet signs the provider's payment challenge and the signed header is the proof; the provider is paid during execute. For 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.) rails, call `POST /payment/escrow-lock` with the on-chain lock transaction. Once funds clear, the order moves to `ready`.
8. **Execute.** `POST /market/orders/:orderId/execute` materialises the order as a task plus route, dispatches to a native provider or a machine-side runtime endpoint, and writes a `Run` plus an `Outcome`. Successful runs land in `delivered`. External-handoff services return a structured handoff and land in `handoff`.
9. **Confirm or dispute.** `POST /market/orders/:orderId/confirm` closes the order and moves held funds to `release_pending`. Settle through the payment rail, then call `POST /market/orders/:orderId/payment/release` to record the release (the endpoint updates the payment record, it does not move funds). If the service did not deliver, `POST /market/orders/:orderId/dispute` opens a dispute and freezes payment until peaq resolves it.

### Read-only shortcut

Free, read-only operations can skip the order flow entirely. `POST /market/services/:serviceId/execute` runs the operation directly with `machineId`, `agentPairingId`, `operation`, and optional `input` / `providerCredentials`. The orchestrator dispatches through the same task + route + run + outcome machinery as `executeMarketOrder` but does not create an order, payment intent, or escrow record. Paid, external-handoff, and state-changing operations still go through `POST /market/orders`.

## Payment model

peaqOS does not collect marketplace payments. The payment-intent and payment-proof endpoints record provider/service payment state only when the selected adapter requires direct provider payment. Operators or machines pay the selected provider directly through that provider's supported rail. Raw payment headers are never stored.

## Payment rails

The orchestrator quotes services in the rail the provider supports. Active rails:

| Rail | Where it shows up |
| :- | :- |
| `x402` | Some [agentic.market](https://agentic.market) services (2Captcha, Firecrawl, Wolfram\|Alpha), the Acurast Deploy Agent and pay.sh StableUpload. Agent wallet responds to an HTTP 402 payment-required challenge; orchestrator replays the request with the agent's payment headers via the `paidHttp` adapter. |
| `mpp` | Solana micro-payment protocol. The main paid rail for [pay.sh](https://pay.sh) services. |
| `vault-stripe` / `external` | Card-mediated or external handoff. |
| `wallet` / `wdk-usdt-transfer` | Direct USDT transfer on peaq (default token `USDT`, decimals from `PEAQOS_USDT_DECIMALS`). |
| `onchain-escrow` / `escrow` | Funds locked into a service-specified escrow contract via `payment/escrow-lock`. |
| `not-required` | Free or pre-authorised services. Order proceeds straight to `ready`. |
| `offchain-record` | Off-chain attestation, recorded but not RPC-verified. |

The orchestrator does no cross-chain (Working across chains: a machine lives on one home chain (peaq or Solana), and its subscription stays on peaq.) or token conversion: the agent pays in the chain and token the service quotes.

## Service providers

* **QVAC**: private inference.
* **[agentic.market](https://agentic.market)**: 2Captcha, Firecrawl and Wolfram|Alpha over 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.); Claude, ChatGPT and Exa as external handoffs.
* **[pay.sh](https://pay.sh)**: Gemini, BigQuery, Document AI, StableUpload, Cloud Translation.
* **Akash**: decentralized compute.
* **Aethir**: decentralized GPU compute.
* **Allora**: topic inference and worker registration.
* **Pyth**: price feeds.
* **Acurast**: decentralized compute; its Deploy Agent runs as a native x402 provider runtime in the orchestrator.
* **Arcium**: confidential compute (`compute.confidential`).
* **GEODNET**: RTK precision-positioning data.
* **Naver Maps**: mapping and geolocation APIs.
* **Korea Public Data** (Data.go.kr): EV charging stations and chargers, next-hour weather, and AirKorea PM2.5. Needs a portal service key, sent with every request and never stored.
* **World ID**: proof of personhood (`identity.proof-of-person`).
* **Walrus**: object storage.
* **Home Assistant**: device control on the machine's local network, on a self-hosted orchestrator configured with `HOME_ASSISTANT_BASE_URL` and `HOME_ASSISTANT_TOKEN`.
* **Aave**: treasury deposits.
* **peaq Telemetry Export**: fleet telemetry export and machine data publishing.

The live catalogue is on [robotic.sh](https://robotic.sh); query it programmatically via [`GET /market/services` and market search](https://docs.peaq.xyz/peaqos/api-reference/machine-markets-discovery). The adapter registry (`GET /market/adapter-credential-stack`) is the authoritative list of what needs credentials or setup.

## Delegation policy

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
type DelegationPolicy = {
  allowedSkillKeys: string[];   // skill keys from GET /skills, e.g. ["walrus-storage-object", "akash-compute-deployment"]
  deniedSkillKeys: string[];
  allowedServiceIds: string[];  // exact service IDs from /market/services
  deniedServiceIds: string[];
  perTransactionLimit?: number | null;
  dailySpendLimit?: number | null;
  currency?: string | null;     // ISO 4217 or token symbol
};
```

Policy is enforced server-side on every call. Update it at any time via `PATCH /machines/:machineId/agent-pairings/:pairingId`. Revoking a pairing (`DELETE`) terminates the agent's delegated access immediately, unless the pairing has open market orders (`OPEN_MARKET_ORDERS`).

## Multichain

A machine's peaqID and Machine NFT live on its home chain (peaq or Solana); the Service Registry (peaqOS's marketplace where machines list services they offer (Service Registry) and where agents discover, order, pay for, and run services from others.) is on peaq; Machine Agents pay in the chain and token a service quotes. Read the [Omni-chain concept](https://docs.peaq.xyz/peaqos/concepts/omni-chain.md) for where a machine lives and the [roadmap](https://docs.peaq.xyz/roadmap.md) for chain rollout.

## Build with Scale

> [card] [Machine Markets API](https://docs.peaq.xyz/peaqos/api-reference/machine-markets-overview.md)
>
> Base path, access model, error codes, and the full HTTP endpoint surface.

> [card] [Machine Markets (concept)](https://docs.peaq.xyz/peaqos/concepts/machine-markets.md)
>
> How pairing, skills, services, orders, payments, and execution hang together.

> [card] [peaqOS CLI: `scale`](https://docs.peaq.xyz/peaqos/cli#peaqos-scale)
>
> `peaqos scale agent pair`, `search`, and the `order` family from your terminal.

> [card] [SDK: orchestration namespace](https://docs.peaq.xyz/peaqos/sdk-reference/orchestration-js.md)
>
> `client.orchestration` for [JS](https://docs.peaq.xyz/peaqos/sdk-reference/orchestration-js.md) and [Python](https://docs.peaq.xyz/peaqos/sdk-reference/orchestration-py.md).

## Related

* [Activate](https://docs.peaq.xyz/peaqos/functions/activate.md)
* [Qualify](https://docs.peaq.xyz/peaqos/functions/qualify.md)
* [Wallets (OWS)](https://docs.peaq.xyz/peaqos/wallets.md)


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