Agents: buy inference on P2P

Offers, neutral matching, x402 or scoped keys, server-enforced budgets, agent-readable errors, MCP/A2A/OpenAPI. This page is part of the P2P AI chapter of the TokenOS documentation.

Try it: live match

The same POST /api/p2p/v1/match the agents call, against the live network. Move the constraints and read the reasons[] each peer was ranked on — price floor, trust, measured first-token latency, verification, bonding. Free, no key, nothing reserved.

Pay: x402 or a scoped key

The hosted gateway routes to the cheapest offer, then higher trust, with failover before anything is charged. Response headers carry x-tokenos-peer , x-tokenos-session , x-tokenos-match-reason and, when a failover happened, x-tokenos-rematched-from . Prompts travel gateway → seller only; TokenOS stores aggregate counts, never prompts or completions.

Budgets: human-signed, server-enforced

A principal (wallet) signs a mandate once on /p2p/budgets and mints scoped tos_ keys under it. The agent only ever holds the key. Enforcement happens in the gateway on every request — nothing in a prompt, tool description or client flag can raise a cap.

Scoped-key budgets are enforced for credit-funded keys. Wallet-bound enforcement of x402 payers at the facilitator ( agent.payerWallet is recorded today) ships after the P2P money-path fixes are re-tested. TokenOS keeps the no-account x402 flow available under platform guardrails regardless — budgets are optional.

Errors an agent can act on

Every 4xx/5xx from /api/p2p/v1/* carries the same envelope: error.code (machine-readable), error.message (plain), error.next_action (what to do), error.docs (this page) — plus route-specific fields.

Where agents find this

What TokenOS does not do

Protocol details for running your own buyer or seller node: Buy inference , Sell inference , P2P protocol reference . Payments on TokenOS are for metered usage only.

This request (quoted $0.0410) would cross the budget's dailyUsd cap

Wait for the window to reset (\`resetsAt\`), lower max_tokens / pick a cheaper peer, or ask the principal to raise the cap.

No online peer lists that model. Pick one from GET /v1/offers → models[] (or use "capability" in /v1/match).

Peers exist but none accepted within the failover budget. Retry shortly or relax min_trust / pin.

x402 challenge: pay accepts[].amount to payTo and retry the identical body with PAYMENT-SIGNATURE.

The key’s wallet has no credits for a session hold. Fund at /p2p/buy or use x402.

The route needs a tos_ key, or the key is revoked / past expiry. Mint a new one or use an x402 route.

The quote would cross a cap. Body carries quoteUsd, remainingUsd, window, resetsAt.

model_not_allowed / capability_not_allowed / price_above_cap / trust_below_min / budget_expired / budget_revoked

The budget forbids this request; the principal must change the mandate.

The request waits in the principal’s Approvals Inbox. Poll approval.pollUrl; retry with x-tokenos-approval: <itemId>.

Denied, expired, or the single-use allowance was already consumed.

Per-address or per-payer guardrail. Honour Retry-After.

x402 (no account) · scoped key (budgeted)

, <>Session holds are sized to the remaining headroom so the sum of holds never exceeds a cap; unspent holds return when sessions close. Receipts are seller-signed settlements (<C>GET /api/p2p/budgets/{

No preferential ranking for the reference seller, and no undisclosed house traffic in public statistics.

No budget raised by anything an agent says — only the principal’s wallet signature changes a mandate.

No prompt or completion storage at the gateway; funnel instrumentation is aggregate counts per hour.

No paid or money-moving tools in MCP directories; MCP stays read-only, HTTP x402 is the only payment path.

Browse the full TokenOS documentation or jump to the API reference, credits & pricing or FAQ.

About TokenOS

TokenOS is the AI operating system for the autonomous Web3 economy. It combines an agentic IDE that turns a prompt into a deployed dApp, a marketplace of x402-paid AI agents, a peer-to-peer AI inference market where anyone can sell spare API quota or GPU time for USDC, MCP and A2A connectors for Claude, Cursor and ChatGPT, and the $TOS utility and governance token on Solana.

Builders pay with prepaid credits; sellers and agent creators are paid for work actually delivered; TokenOS indexes, verifies and settles. Nothing on this site is investment advice, and node payouts, agent payments and referral credits are fees for usage — not token distributions or returns.