# Inferit > Inferit is a two-sided marketplace for LLM inference. Buyers call one OpenAI-compatible API; sellers list > open-weight models they host. Every request is routed to the cheapest healthy offer and settled in batches through > a bounded-custody escrow on Whitechain. Prices are all-in (seller price plus a 5% platform fee). ## Testnet demo This deployment runs on Whitechain Sepolia (chain id 1874), a test network. Buyers fund the escrow with Inferit Test Credit (ITC), a faucet-only test token with no monetary value: it is not a stablecoin, cannot be redeemed and is not money. Prices are quoted in test dollar units (1 ITC = 1 unit). Some offers may be demo sellers that return canned (mock) completions; they say so in their replies. Do not send sensitive data. Every API response carries `x-inferit-network: whitechain-sepolia` and `x-inferit-testnet: 1`. ## Settlement network - Network: Whitechain Sepolia (`whitechain-sepolia`), chain id 1874, testnet - Escrow (MarketEscrow): 0x705dD9eCffa888FbcF2849eAE2D3b136eb78B7e0 - Token: 0x2E672dFE33EA977FD064E01aDe7d8c73B3Be7fBB (ITC, 6 decimals, faucet-only, no value) - Explorer: https://explorer.testnet.whitechain.io (escrow: https://explorer.testnet.whitechain.io/address/0x705dD9eCffa888FbcF2849eAE2D3b136eb78B7e0) - Gas faucet (native WBT): https://faucet.testnet.whitechain.io - Test token faucet: call `faucet()` on the token contract (1,000 ITC per address per 24 h) - Settlement is final only once the batch is finalized on-chain (OP Stack): usage rows report `finality` 'pending' until then. GET https://api-production-c74b9.up.railway.app/v1/rails has the live rail details and health. ## Live models - qwen/qwen-2.5-14b-instruct: from 0.084000 / 0.168000 per 1M input / output tokens (all-in, 16% under list) ## Use it - Base URL: https://api-production-c74b9.up.railway.app/v1 (OpenAI-compatible). Authenticate with `Authorization: Bearer ik_...`. - Chat: POST https://api-production-c74b9.up.railway.app/v1/chat/completions (streaming supported). - Minimum discount vs list price: POST https://api-production-c74b9.up.railway.app/min{N}/v1/chat/completions, or header `x-min-discount: N`. - Models and prices: GET https://api-production-c74b9.up.railway.app/v1/models (list price in `pricing`, best live price in `best_price`). ## Agents: pay per request with x402 (no account, no API key, no native gas) - POST https://api-production-c74b9.up.railway.app/v1/chat/completions (or /min{N}/v1/chat/completions) with NO Authorization header answers 402 Payment Required, x402 v2: header PAYMENT-REQUIRED (base64 JSON) and the same PaymentRequired JSON as the body. One requirement: scheme `exact`, network `eip155:1874`, asset 0x2E672dFE33EA977FD064E01aDe7d8c73B3Be7fBB (6 decimals), payTo 0x705dD9eCffa888FbcF2849eAE2D3b136eb78B7e0 (the escrow, not Inferit), amount = this request's worst-case all-in cost (at least 10000 base units = 0.010000 ITC), maxTimeoutSeconds 120, extra {"name":"Inferit Test Credit","version":"1"} (the token's EIP-712 domain; EIP-3009 TransferWithAuthorization). - Pay with the official client, unmodified: `wrapFetchWithPayment(fetch, client)` from @x402/fetch, with `client = new x402Client().register('eip155:*', new ExactEvmScheme(account))` (ExactEvmScheme from @x402/evm/exact/client, account from viem). Recent x402Client versions (with spend controls, e.g. 2.28) only pay assets they know by default, so allow this one (older 2.x clients need nothing): `client.setSpendControls({ allowedAssets: [{ network: 'eip155:1874', asset: '0x2E672dFE33EA977FD064E01aDe7d8c73B3Be7fBB', maxAmountPerPayment: '1000000' }] })`. - The paid retry carries PAYMENT-SIGNATURE. The server verifies it, deposits it INTO the escrow as YOUR balance (MarketEscrow depositWithAuthorization: bounded custody), then serves and charges the request like any other (streaming supported). The response carries PAYMENT-RESPONSE (base64 SettleResponse: transaction, network, payer) and x-inferit-buyer-cost-micro. Usage is settled on-chain in batches (LineSettled), like API-key usage. - What the request does not use stays your escrow balance: spend it later with an API key (next section) or withdraw it from the escrow (requestWithdraw, then executeWithdraw after the delay; needs native gas). If a paid request fails after the payment was credited, the error says so and the credit is still yours. - The server pays the gas of every payment. Test tokens without gas: POST https://api-production-c74b9.up.railway.app/v1/faucet {"address":"0x..."} mints 1,000 ITC to that address (once per 24 h per address; the server pays the gas). - Machine-readable: GET https://api-production-c74b9.up.railway.app/.well-known/x402. ## Agents: API key (sign in with the wallet, no gas) 1. POST https://api-production-c74b9.up.railway.app/v1/auth/evm/challenge {"address":"0x..."} -> {"message", "nonce", "expiresAt"} 2. Sign `message` with the wallet (EIP-191 personal_sign), then POST https://api-production-c74b9.up.railway.app/v1/auth/evm/verify {"message","signature"} -> {"token"} (a session token, ise_...). 3. POST https://api-production-c74b9.up.railway.app/v1/keys with Authorization: Bearer , body {"name":"my-agent"} -> {"key":"ik_..."} (shown once; optional spendLimitMicro and minDiscountPct). 4. Call the API with Authorization: Bearer ik_... It spends your escrow balance on the whitechain-sepolia rail: x402 payments credit it, or deposit yourself with depositAndSetCap on the escrow (needs native gas). ## Marketplace data (aggregated, no seller identities) - GET https://api-production-c74b9.up.railway.app/api/marketplace - GET https://api-production-c74b9.up.railway.app/api/markets/{model} - GET https://api-production-c74b9.up.railway.app/api/stats - GET https://api-production-c74b9.up.railway.app/v1/rails - GET https://api-production-c74b9.up.railway.app/health, GET https://api-production-c74b9.up.railway.app/metrics (settlement backlog, finality lag, operator gas runway) ## Response headers x-request-id, x-inferit-attempts, x-inferit-buyer-cost-micro (an HTTP trailer on streams), x-inferit-offer (opaque), x-inferit-rail, x-inferit-network, x-inferit-testnet (1 on any network but mainnet). Money is integer micro-units (1e-6 of a dollar unit; on testnets, of an ITC); prices are micro-units per 1M tokens. ## Errors OpenAI-shaped {"error":{"message","type","code"}}: 402 insufficient_funds, 404 model_not_found, 503 no_available_offers (with retry-after). Without credentials, 402 is the x402 challenge (body = the x402 PaymentRequired JSON); a refused payment answers 402 again with the reason in `error`; 503 x402_settlement_pending / x402_unavailable say whether anything was charged.