Quorix Protocol
Developer documentation
Lock in a vendor’s rate and call volume as an on-chain USDC forward, then route normal API traffic through the Quorix gateway. This guide covers forwards, the gateway, the SDK and how usage settles on-chain.
Introduction
Quorix is a derivatives layer for API access on Solana. Instead of paying a vendor at whatever rate the spot market gives you, you take a forward position: you fix a vendor’s per-call rate and the call volume you expect to burn over a term, and you post $QUORIX as margin against those USDC-denominated terms.
From there the workflow is deliberately boring. You mint a Quorix API key, swap your baseURL to the gateway, and keep writing normal requests. The gateway meters every call, debits it from the balance you locked, and at expiry reconciles what you actually used and settles it on-chain in USDC.
Payment rail
USDC. Every forward is priced and settled in USDC — no volatility between you and your API bill.
$QUORIX
Collateral and incentive. It backs your position as margin; it is never the means of payment for API access.
Quick Start
Four steps get you from zero to a metered request against a locked rate.
- 1
Open a forward
Pick a vendor and tier in the marketplace, choose the call volume you expect to consume, and post $QUORIX margin. The position is written on-chain and bound to your wallet the moment it opens.
- 2
Generate an API key
From the dashboard, mint a key in the form
qx_live_…. The key is scoped to your open forwards. - 3
Swap your baseURL
Point your client at
https://api.quorixprotocol.xyz/v1. For most OpenAI-compatible SDKs this is a one-line change. - 4
Send your first request
Make a normal call. The gateway meters it and draws it down from your locked balance in real time.
import { Quorix } from "@quorix/sdk"; const qx = new Quorix({ apiKey: process.env.QUORIX_API_KEY, // qx_live_...}); // Open a forward, then send a normal request — Quorix meters// each call against the volume you locked on-chain.const res = await qx.chat.completions.create({ model: "gpt-4o-mini", messages: [{ role: "user", content: "Ping the gateway." }],}); console.log(res.choices[0].message.content);Forwards
A forward is an on-chain agreement that fixes the price and quantity of a vendor’s API access for a fixed period. It is the core primitive of the protocol — everything else meters against it.
Rate
The per-call price you lock, denominated in USDC. It does not move for the life of the term, regardless of spot.
Volume
The number of calls you reserve. The gateway draws these down as you consume; unused volume is reconciled at settlement.
Term
The window the forward covers. At expiry the position is reconciled and settled on-chain.
Margin
The $QUORIX you post as collateral, locked for the term and released when the position redeems.
Because the position lives on Solana, the rate, the reserved volume, the posted margin and the expiry are all verifiable on-chain — not entries in a vendor’s private ledger. When you open a forward you are buying certainty: the price you agreed is the price you pay, no matter what happens to demand.
The Gateway
The gateway is the single endpoint your application talks to. It authenticates your key, meters each request, debits the metered cost from your locked balance, and forwards the call to the underlying vendor — all before your response comes back.
Swapping to it is a one-line change on any OpenAI-compatible client: keep your request bodies exactly as they are and change only the base URL.
// Point any OpenAI-compatible client at the gateway.import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.QUORIX_API_KEY, // qx_live_... baseURL: "https://api.quorixprotocol.xyz/v1", // <- the only change});curl https://api.quorixprotocol.xyz/v1/chat/completions \ -H "Authorization: Bearer $QUORIX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o-mini", "messages": [{ "role": "user", "content": "Hello from Quorix" }] }'Each request that succeeds upstream is debited from the forward it belongs to. Requests that fail at the vendor are not charged against your volume, and once a forward’s volume is exhausted the gateway returns a 402 rather than billing you at an unlocked rate.
TypeScript SDK
The SDK wraps the gateway with a typed client, handles auth, and gives you helpers for reading your locked balance and forwards alongside the usual completion calls.
Install
npm install @quorix/sdk# or: pnpm add @quorix/sdkCreate a client & send a request
import { Quorix } from "@quorix/sdk"; const qx = new Quorix({ apiKey: process.env.QUORIX_API_KEY, // baseURL defaults to https://api.quorixprotocol.xyz/v1}); // Inspect what you have locked before you spend it.const balance = await qx.balance.get();console.log(balance.remainingCalls, balance.expiresAt); // Then just make requests — usage is debited automatically.const res = await qx.chat.completions.create({ model: "claude-3-5-sonnet", messages: [{ role: "user", content: "Summarise this ticket." }],});API Reference
All endpoints are served from the gateway base URL https://api.quorixprotocol.xyz/v1 and authenticated with your qx_live_… key via a bearer token.
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/chat/completions | Vendor pass-through. Same request/response shape as the underlying model API — the gateway meters the call and debits your locked balance before forwarding. |
| POST | /v1/embeddings | Pass-through for embedding models, metered per request against the same forward. |
| GET | /v1/balance | Returns the active forward for the key: locked rate, remaining call volume, posted margin and term expiry. |
| GET | /v1/forwards | Lists every forward bound to your wallet with status (open, expiring, settled) and on-chain position addresses. |
| GET | /v1/usage | Time-series of metered calls and drawn-down volume for the current term, for reconciliation and dashboards. |
Example: GET /v1/balance
{ "vendor": "openai", "model": "gpt-4o-mini", "lockedCalls": 1000000, "remainingCalls": 812403, "lockedRateUsdc": 0.00042, "marginQrx": 4200, "term": { "opensAt": 1720000000, "expiresAt": 1722678400 }}Settlement
Settlement happens at the end of the term. The gateway’s metered usage is the source of truth: it is reconciled against the volume you locked, and the net position is settled on-chain in USDC.
Over the term, every metered call is drawn down from your locked volume and recorded.
At expiry, total metered usage is reconciled against the volume reserved in the forward.
The net amount owed is settled on-chain in USDC — you never pay above the rate you locked.
Your posted $QUORIX margin is released back to your wallet once the position closes cleanly.
Because reconciliation is deterministic and on-chain, both sides can verify the outcome: buyers see they were charged the locked rate for exactly what they used, and providers see the delivered volume they were paid for.
Margin & Slashing
Two collateral roles keep the market honest. Buyers post $QUORIX margin to open a forward; liquidity providers post $QUORIX as SLA collateral to sell capacity into it.
Buyer margin
$QUORIX locked against the forward's notional for the term. It secures the position and is released when the forward redeems.
Provider SLA collateral
Providers back their delivery promise with staked $QUORIX. If they under-deliver against the SLA, that collateral is slashed to cover the shortfall.
Slashing is what makes a forward more than a promise: if a provider fails to deliver the capacity they sold, their collateral absorbs the cost so the buyer is made whole. This is the incentive that binds on-chain guarantees to real API delivery.
Provider staking ships in Stage 2. In the MVP, buyer margin, buyback-and-burn and the fee discount are live. Provider staking — SLA collateral, USDC yield on delivered capacity and the slashing mechanism — is the next stage of the protocol.
FAQ
Short answers to the questions we hear most.
