# Bourse > Nasdaq for AI models. Bourse is an on-chain exchange where every listed AI model becomes a tradeable asset on Solana. We call the primitive "LLM derivatives" — model tokens whose value derives from the real inference demand the model captures. An OpenAI-compatible inference router sits on top so developers and AI agents can consume inference; the router's fee flow drives a buyback-and-burn on the listed model's token. The protocol supports Token-2022 transfer-fee mints so creators who want a continuous on-trade fee can opt in at listing time; standard SPL is the default. Settled in USDC on Solana. The mental model: every AI model listing is its own asset, tradeable 24/7, with built-in programmatic demand (agents need inference) and a built-in flywheel (usage → fees → buyback → burn → supply down → price pressure up). ## Two ways to consume inference Bourse exposes two billing rails. Same multi-provider router, same OpenAI-compatible request shape, different auth + payment models. ### Rail 1 — API key + credits (traditional dev experience) - [POST /api/v1/chat/completions](https://usebourse.xyz/api/v1/chat/completions): OpenAI-compatible chat completions. Requires `Authorization: Bearer ` (keys start with `bs_live_`). Streaming supported. Pre-flight credit hold, multi-provider failover, settlement on actual token usage. Response headers include `X-Bourse-Model-Id` with the `provider/model` identifier. Top up credits with a card (Privy MoonPay onramp converts to USDC into your embedded wallet) or USDC directly on Solana mainnet via Solana Pay reference flow. Best for production apps. Example (TypeScript): ```ts import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://usebourse.xyz/api/v1", apiKey: "bs_live_...", // Create at /dashboard/keys }); const stream = await client.chat.completions.create({ model: "deepseek-chat", // or "kimi-k2.6", "google/gemma-3-27b-it", etc. messages: [{ role: "user", content: "Hello" }], stream: true, }); ``` ### Rail 2 — x402 pay-per-call (no account, agent-first) - [POST /api/x402/v1/chat/completions](https://usebourse.xyz/api/x402/v1/chat/completions): Same multi-provider router, but billed per call in USDC on Solana mainnet via the x402 protocol. First call returns HTTP 402 with payment terms; client signs + retries with `X-PAYMENT` header; PayAI facilitator settles on-chain in the same request. **No account, no key, no prepaid balance. Live on Solana mainnet today.** Best for AI agents and ephemeral scripts. The 402 challenge envelope advertises the `payTo` recipient dynamically: tokenized models route the fee directly into the model's on-chain revenue vault (which feeds buyback-and-burn on the model's token); non-tokenized models route to the protocol treasury. Example (TypeScript, with `@x402/fetch`): ```ts import { x402Client, wrapFetchWithPayment } from "@x402/fetch"; import { registerExactSvmScheme } from "@x402/svm/exact/client"; import { createKeyPairSignerFromBytes } from "@solana/kit"; const signer = await createKeyPairSignerFromBytes(/* mainnet keypair bytes */); const client = new x402Client(); registerExactSvmScheme(client, { signer }); const fetchWithPay = wrapFetchWithPayment(globalThis.fetch, client); const res = await fetchWithPay( "https://usebourse.xyz/api/x402/v1/chat/completions", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ model: "deepseek-chat", messages: [{ role: "user", content: "Hello, agent." }], }), }, ); ``` Bourse's chat-completion endpoint is wire-compatible with the **Solana Foundation × Google Cloud pay.sh marketplace** (launched 2026-05-06). The 402 envelope, USDC mainnet asset, and dynamic payTo all match the pay.sh registry probe expectations. PayAI is a pay.sh launch partner, so Bourse's existing facilitator integration carries over. OpenAPI 3.1 spec live at [/api/x402/openapi.json](https://usebourse.xyz/api/x402/openapi.json). ## Models — current state **Funded paid mainnet supply (added 2026-05-10):** - `deepseek-chat` — DeepSeek V3 Direct, $0.27/$1.10 per 1M tokens - `kimi-k2.6` — Moonshot AI Kimi K2.6, ~$0.60/$2.50 per 1M tokens - `moonshot-v1-32k` — Moonshot v1 32K context, ~$0.30/$0.60 per 1M tokens **Free-tier supply (Cerebras):** - `llama-3.3-70b`, `llama3.1-8b` — low-latency, free quota **HuggingFace router (varies by model):** - `deepseek-ai/DeepSeek-R1`, `Qwen/Qwen3-235B-A22B`, `google/gemma-3-27b-it` **Tokenized on Bourse's Quasar protocol:** `google/gemma-3-27b-it` (Track A, devnet primitives pending mainnet program redeploy post-audit). `GET /api/models` returns the live OpenAI-compatible model list with per-provider qualified IDs. ## Docs - [/docs](https://usebourse.xyz/docs): Pick-your-rail overview. Four doors in, organized by audience — consumers (api-key + credits, x402 pay-per-call) and producers (creators listing a tokenized model, builders deploying tokenized agents). - [/docs/quickstart](https://usebourse.xyz/docs/quickstart): Rail 1 quickstart. Generate key, top up credits, make first call. cURL + TypeScript + Python examples. Status code reference. How billing works (pre-flight hold → settle → refund overage). - [/docs/x402](https://usebourse.xyz/docs/x402): Rail 2 deep-dive. The 402-then-retry flow explained. **Live on-page demo** — server-funded wallet runs a real paid call (defaulting to Gemma 3 27B for reliability) so you can see the response + USDC delta + tx in under 5 seconds. Code examples in TypeScript (using `@x402/fetch`), curl, and Python notes. - [/docs/creators](https://usebourse.xyz/docs/creators): For model creators — list a model and tokenize it. Two distribution tracks: Track A (Bourse-native Token-2022 with transfer-fee mint, devnet today) or Track B (external SPL via pump.fun's bonding curve via ClawPump on mainnet today). Detailed pump.fun rail walkthrough: approval → bonding curve → graduation to Raydium / PumpSwap → inference flow into the revenue vault → buyback-and-burn. - [/docs/agents](https://usebourse.xyz/docs/agents): For agent builders. Bourse exposes inference as a permissionless x402-paid service — any agent platform whose agents can sign Solana transactions can use it as a skill. ClawPump is v1's canonical reference integration (tokenized agents on pump.fun pay Bourse per inference, driving buyback on their own token). Same wire works for pay.sh marketplace consumers and any independent x402 client. No exclusivity. ## Public pages - [Landing](https://usebourse.xyz/): Nasdaq for AI models. Hero, pricing index, how-it-works, supported models. - [Market](https://usebourse.xyz/market): Live LLM derivatives market — approved model tokens with vault balances, token supply, inference volume, 30-day revenue chart, and preview cards for catalog models. - [Creators](https://usebourse.xyz/creators): Model-creator landing page explaining tokenization + buyback-and-burn mechanics. - [Apply to list a model](https://usebourse.xyz/creators/apply): Public application form for creators. ## Architecture Bourse is two halves: 1. **Product layer** (this app) — Next.js 16, Privy auth (with embedded Solana wallets + MoonPay card onramp), Neon Postgres, dual-rail credit ledger + on-chain settlement. Raydium SDK for devnet swaps, Jupiter API for mainnet swaps. Source: https://github.com/tobySolutions/bourse. 2. **Protocol layer** — Rust/Quasar Solana program (`quasar-ai-compute-market`) deployed to devnet at program ID `FAKZeAsRzau1uJrrzf4hMrKRuoPXs7ip1u8exgNd6Zkv`. Fifteen instructions covering the full lifecycle: register → offer → order → settle → buyback → burn. Supports Token-2022 mints with transfer fee extension. Mainnet redeploy gated on audit. ## Value flow 1. Model creator lists a model → on-chain token minted with fixed supply → tradeable on Raydium (Track A) or pump.fun via ClawPump (Track B). 2. User funds credits with a card (Privy → MoonPay → USDC into embedded wallet → Solana Pay reference deposit) or sends USDC directly on Solana mainnet → off-chain credits ledger. Or skip this entirely and use the x402 rail per call (no account). 3. User (or AI agent) sends inference request → Bourse routes to the cheapest available provider offer (Cerebras free-tier, DeepSeek paid, Moonshot Kimi paid, Chutes SN64, HuggingFace, etc.) with automatic failover → response streams back. 4. On settle: gross charge is split into provider payout + creator fee (`modelFeeBps`) + protocol fee (1%, governance-adjustable). Creator fee flows to an on-chain USDC revenue vault tied to the model's token. 5. Buyback crank: withdraws USDC from the revenue vault → swaps for that specific model's token on Raydium (devnet) or Jupiter (mainnet) → burns the tokens. Supply shrinks, deflationary pressure. 6. Token-2022 transfer fee: opt-in per listing. When a creator picks the Token-2022 track, the 1% transfer fee is withheld on every trade of that model's token (enforced at the Solana runtime level) and the protocol can harvest accumulated fees. Listings on the standard SPL track do not have this fee. ## Why this exists AI models are the most valuable asset class in technology, but nobody owns them outright — they're trained, released, forked, and consumed by millions with no financial layer tracking demand. Bourse turns that demand into tradeable claims. Every inference call is a micro-bet on the model that served it. Every buyback is supply pressure derived from real usage. The result: LLM derivatives — a new financial instrument class where you can express a view on which AI models win, built on the inference flow that actually proves it. ## Status - **x402 inference rail** — live on Solana mainnet, settled per call in USDC via PayAI facilitator - **Funded paid supply** — DeepSeek V3 Direct + Moonshot Kimi K2.6 + Moonshot v1 32K served direct from upstream APIs (mainnet supply, 2026-05-10) - **Card → USDC onramp** — Privy MoonPay funds embedded Solana wallets, then Solana Pay reference flow deposits to credits ledger; no Stripe relationship needed - **Track A tokenization** — Quasar program live on Solana devnet, on-chain primitives pending mainnet redeploy post-audit - **Track B tokenization** — pump.fun mints via ClawPump, live on mainnet; first proof-of-concept mint shipped 2026-04-29 - **Pay.sh listing** — wire-compatible with Solana Foundation × Google Cloud `pay.sh` marketplace; PR-ready listing artifact in [paysh-listing/providers/bourse/inference/PAY.md](https://github.com/tobySolutions/bourse/blob/main/paysh-listing/providers/bourse/inference/PAY.md) ## Optional - [Protocol repo (private)](https://github.com/tobySolutions/relay-router-protocol): Rust/Quasar Solana program source. - [Worklog](https://github.com/tobySolutions/bourse/blob/main/WORKLOG.md): Append-only session log of product engineering decisions.