Skip to main content
MarketplaceHow it works

How the Marketplace Works

Surplus Intelligence is a decentralized exchange for LLM inference. Each model has its own order book where sellers compete on price.

The Flow

One request, end to end
  1. Your requestOpenAI-shaped, unchanged
  2. Authenticate & fundKey or 402 challenge, then a hold
  3. Order bookCheapest healthy seller wins
  4. Response streamsMetered as it goes
Everything up to the seller happens before your first token - the budget is single-digit milliseconds. Settlement deliberately sits after the response, not inside it.

The order book is held in memory and reloaded every 30 seconds, so choosing a seller costs no database round-trip. If the chosen seller fails, the router falls through to the next one down the book and you see the count in x-si-marketplace-attempts.

What the order book looks like for one model
api.example-askipped - backing off$0.24
bedrock-mantleserved this request$0.29
openrouter.ai$0.34
Cheapest first - but an offer that is backing off after a failure is skipped, so the price you get is the cheapest seller that can actually serve you.

Key Concepts

Order Book

Each model has a sorted list of sellers, cheapest first. The order book reloads from DynamoDB every 30 seconds and lives in memory for fast routing.

Routing

The router tries the cheapest seller first. If it fails (5xx, timeout, auth error), it immediately falls through to the next cheapest. The buyer never sees the failure - it's transparent.

Settlement

Charging runs after your response, not inside it. Once the stream ends the usage is recorded and the cost is drawn from your balance. Keeping it off the request path is what stops settlement from becoming request latency.

The exception is x402, which is captured up front because the payment proof travels with the request.

Health

Sellers are passively monitored - no health check pings burning your quota. One failure marks the offer unhealthy with a category-specific backoff. After the backoff expires, the next successful request recovers it.

Sections

Security and Privacy

See Security & Privacy for current seller key storage, prompt/response logging, deletion behavior, seller spend protections, quality-scoring limits, and settlement admin trust assumptions.