<!-- TokenOS docs · P2P AI · Markdown mirror of https://tokenos.ai/docs/p2p-ai · HTML: https://tokenos.ai/docs/p2p-ai · index: https://tokenos.ai/llms.txt -->

# P2P AI — peer-to-peer inference market

P2P AI lets anyone sell AI inference and anyone buy it, directly between two nodes. A seller runs a small Node.js program in front of an API key or a local model and sets a price per million tokens. A buyer runs a local OpenAI-compatible endpoint that routes every request to the cheapest trusted seller. TokenOS is never in the request path: it holds the buyer's credits, caps each session with a signed voucher, verifies signed receipts and pays sellers in USDC on Solana.

> **Tip — No GPU required**
> The most common seller is **not** a GPU operator. If you hold an OpenAI, Anthropic or Google API key — spare quota, startup credits, a committed-use or enterprise tier you don't fully use — you can be a provider in ten minutes. Your node forwards requests to the vendor with your key; the key never leaves your machine. See [Sell inference without a GPU](https://tokenos.ai/docs/p2p-sell).

**Who sells**

Developers with spare vendor quota, teams with discounted API tiers, anyone running Ollama / vLLM / LM Studio on a GPU or a Mac. One `seller.json` can list several upstreams, each with its own price.

**Who buys**

Anyone with an OpenAI SDK. The buyer node exposes `http://127.0.0.1:8377/v1`; change one base URL and every request is routed to the best offer, with per-session budgets and spend limits per key.

**What TokenOS does**

Indexes signed seller announcements, holds credits and signs session vouchers, verifies buyer SpendingAuths and seller receipts, settles, refunds unspent holds, scores trust and pays USDC. Protocol fee 4%, taken from the seller side.

**What it never does**

See prompts or completions, hold API keys, relay traffic, or pay token rewards. Everything a seller receives is payment for metered usage; running a node does not guarantee traffic or income.

### P2P AI vs DeAI Compute

TokenOS has two ways to supply AI capacity. They are different products for different people.

|  | P2P AI | DeAI Compute |
| --- | --- | --- |
| What you supply | Inference you already have access to: a vendor API key or a model on your own machine | A dedicated GPU node (H100 → GB300X) provisioned for a 30-day term |
| Hardware | None required — any laptop or VPS that can run Node.js ≥ 20 | Data-centre GPUs, provisioned through compute.tokenos.ai |
| Pricing | You set USD per million input/output tokens per model | Live daily service rate per tier, re-priced by the A²E market |
| Who pays you | Buyers, per metered token, via credits → USDC on Solana | The network, as service fees for compute delivered |
| Where | [tokenos.ai/p2p](https://tokenos.ai/p2p) | [compute.tokenos.ai](https://compute.tokenos.ai) |
| Time to first request | Minutes | ~24 hours of provisioning |

### How a session works

- **Discover** — sellers announce signed metadata (models, prices, endpoint) on the public BitTorrent DHT and to the TokenOS indexer every 5 minutes; peers stay listed for 20 minutes after their last announce.
- **Reserve** — the buyer node asks TokenOS to hold credits for a session (first session with a new seller is capped at 10 credits); TokenOS returns a signed voucher.
- **Connect** — buyer and seller open an encrypted direct connection (X25519 handshake signed by both identities, ChaCha20-Poly1305 frames). Prompts travel only on this link.
- **Meter & authorise** — both nodes count tokens; after every response the buyer signs a cumulative SpendingAuth and the seller signs a receipt.
- **Settle** — the seller settles at 10 minutes idle or 80% of the budget; TokenOS charges the hold, credits the seller in USD net of the 4% fee and refunds unspent credits to the buyer.
- **Pay out** — sellers request USDC payouts (minimum 1 USDC) from the provider console or the CLI; the treasury signer pays on request.

### Key numbers

- **1 credit** — $0.10 of provider usage. Buyers purchase credits with USDC or $TOS.
- **Protocol fee** — 4% of each settlement, deducted from the seller side.
- **First-session cap** — 10 credits with any seller the buyer has not used before.
- **Settlement points** — 10 minutes idle, or 80% of the session budget consumed.
- **Ghost grace** — A buyer can request close; after 15 minutes the unspent hold is withdrawn and the session counts as a ghost against the seller.
- **Trust score** — 0–100 = settlement history 50 · network usage 30 · verified identity 20. New peers are unscored (“new”); wash-flagged peers score 0.
- **Visibility window** — Peers stay in the catalog for 20 minutes after their last announce; nodes re-announce every 5 minutes.
- **Payout minimum** — 1 USDC, on request, to the peer-id wallet or a wallet you name.

### Where to go next

- [Sell inference without a GPU](https://tokenos.ai/docs/p2p-sell) — the ten-minute seller setup, pricing and what to expect.
- [Buy inference](https://tokenos.ai/docs/p2p-buy) — keys, spend limits, the buyer node and SDK setup.
- [Node operations & uptime](https://tokenos.ai/docs/p2p-uptime) — the checklist that keeps a seller online and trusted.
- [Protocol reference](https://tokenos.ai/p2p/docs) — seller.json fields, wire format, session flow and the public API.
- [Live market](https://tokenos.ai/p2p) — catalog with savings vs official prices, leaderboard, providers and the settlement explorer.

Payments on P2P AI are for metered usage only. There are no token rewards, and running a node does not guarantee traffic or income.

---

*P2P AI · TokenOS documentation. Canonical page: https://tokenos.ai/docs/p2p-ai. All docs as Markdown: https://tokenos.ai/llms.txt. Payments on TokenOS are for metered usage only; nothing on this page is investment advice or a promise of income.*
