# Inferit > Inferit is the inference layer for AI agents: one integration to access models and pay per inference request. > Behind it is a marketplace: sellers run open-weight models and earn from requests, and each request goes to the > cheapest healthy seller. Prices are all-in: the seller's price plus a 5% marketplace commission. ## Settlement network - Network: Whitechain Sepolia (`whitechain-sepolia`), chain id 1874 - Escrow (MarketEscrow): 0x705dD9eCffa888FbcF2849eAE2D3b136eb78B7e0 - Token: 0x2E672dFE33EA977FD064E01aDe7d8c73B3Be7fBB (ITC, Inferit Test Credit, 6 decimals) - Explorer: https://explorer.testnet.whitechain.io (escrow: https://explorer.testnet.whitechain.io/address/0x705dD9eCffa888FbcF2849eAE2D3b136eb78B7e0) - ITC faucet, sponsored (no gas needed): 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 - ITC faucet, fallback: call `faucet()` on the token contract from your own wallet (costs gas; same 1,000 ITC per address per 24 h) - Gas faucet (native WBT, only for transactions you send yourself): https://faucet.testnet.whitechain.io - 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. ## Automatic model routing - Send `"model": "auto"` to POST https://api-production-c74b9.up.railway.app/v1/chat/completions and Inferit picks the model: among the models that have a healthy seller right now, it keeps the ones that fit the request (context window, tools, images, and any price or quality limit you set), scores each on a published quality ranking against its price for this exact request, and sends the request to the best value, at that model's cheapest healthy seller. If that seller fails before the first byte, the request moves to the next seller, then to the next model. It chooses from the request's size and features, never from what the prompt says. - Policies: `auto` (= `auto:balanced`, best value: a model that costs twice as much for the request must score 6 points higher to win), `auto:cheap` (lowest price; quality breaks ties), `auto:best` (highest quality score; price breaks ties). `inferit/auto` works too. Any other `auto:` id answers 400 invalid_auto_policy. - Hints, as body fields or headers (the stricter value wins): `max_price_per_m` / `x-inferit-max-price-per-m` (µ per 1M tokens, all-in, on this request's token mix; named models too), `min_context` / `x-inferit-min-context` (tokens) and `min_quality` / `x-inferit-min-quality` (0-100), auto only. Hints never reach a seller. - The response names the model that served it: `model` and the header `x-inferit-model`; `x-inferit-route` is `auto:` (or `direct` for a named model) and `x-inferit-auto-choice` is 1 for the first choice, 2 or more when a failover moved the request to another model. Usage rows carry `requestedModel`. - With x402, the 402 quote is priced for the model auto picks (named in `x-inferit-model`); the paid retry tries it first. - The quality table (source, date, method), the policies and today's candidates: GET https://api-production-c74b9.up.railway.app/v1/routing (ranking as of 2026-10-06); docs: https://inferit.cc/docs/routing. GET https://api-production-c74b9.up.railway.app/v1/models lists `auto`, `auto:cheap` and `auto:best` first. - Right now, for a reference request (3,000 input and 1,000 output tokens, no tools or images), auto picks meta-llama/llama-3.1-8b-instruct among 1 candidate (meta-llama/llama-3.1-8b-instruct). ## Live models - meta-llama/llama-3.1-8b-instruct: from 36750 µ / 58800 µ per 1M input / output tokens (0.036750 / 0.058800 ITC per 1M; all-in, 26.08% under list) Offers labelled demo sellers (canned, mock completions) take no paid traffic on this server: they are never routed and never counted in the public market figures (prices, seller counts, order books and GET /api/stats). ## Use it - Base URL: https://api-production-c74b9.up.railway.app/v1 (OpenAI-compatible). Authenticate with `Authorization: Bearer ik_...`. - Sellers see prompts in plain text: do not send personal data, secrets or other sensitive content. - Chat: POST https://api-production-c74b9.up.railway.app/v1/chat/completions (streaming supported). Name a model, or send `"model": "auto"`. - 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`, seller counts, 24 h uptime, time to first token and the largest context a healthy seller serves in `live`; models with a live offer first). A model is callable now when `live.healthy_sellers` is 1 or more. Add `?include=reference` for the reference rows too (`servable: false`: list prices of closed models no seller can list). Rows with `listed_by: "seller"` are open-weight models a seller listed (not the curated catalog): no list price (`pricing` null), priced by their live offers only, never chosen by model auto. - Sellers of one model: GET https://api-production-c74b9.up.railway.app/v1/models/{id}/endpoints (id URL-encoded): each offer's all-in price, context length, quantization, health, 24 h uptime and time to first token, with the seller's shortened wallet address. ## 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. It lists one requirement per network (`eip155:1874`, `stellar:testnet`), each quoted for itself: pay on either. - On Whitechain, 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. ITC 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). - On Stellar, one requirement: scheme `exact`, network `stellar:testnet`, asset CC4TCNMRHLXO2R35ZA4CIBLG5OPNOTUWY3QMHBJVH5EKPUKNBBMFHWVI (the ITC asset contract, 7 decimals: amount = the quote in dollars × 10,000,000), payTo GA75RM73CKP5FEXRU46DIRVZZE7IKXTDWQZLCWUQUYKNIWH4Y5H2Y6QY (Inferit's treasury account), extra {"areFeesSponsored":true}. The transfer must carry exactly the quoted amount. - Pay with the official client, unmodified: `wrapFetchWithPayment(fetch, client)` from @x402/fetch, with `client = new x402Client().register('stellar:*', new ExactStellarScheme(createEd25519Signer(secret, 'stellar:testnet')))` (ExactStellarScheme from @x402/stellar/exact/client, createEd25519Signer from @x402/stellar), and allow the asset: `client.setSpendControls({ allowedAssets: [{ network: 'stellar:testnet', asset: 'CC4TCNMRHLXO2R35ZA4CIBLG5OPNOTUWY3QMHBJVH5EKPUKNBBMFHWVI', maxAmountPerPayment: '50000000' }] })`. The paying account (G…) signs one transfer with its own key and needs a trustline to ITC; the server pays the network fee. The signature is valid until a ledger, not a time: it must stay valid at least 6 ledgers (about 30 s) past the current one, and at most maxTimeoutSeconds 120. - The payment goes to Inferit's treasury and is credited to your balance with Inferit; the request is then served and charged like any other, and what it does not use stays your balance. One payment is at most $5, a balance at most $25. The response carries PAYMENT-RESPONSE (transaction, network, payer) and x-inferit-x402-credited-micro. Transactions: https://stellar.expert/explorer/testnet. Discovery: https://api-production-c74b9.up.railway.app/.well-known/x402. - ITC to pay with: POST https://api-production-c74b9.up.railway.app/v1/faucet/stellar {"address":"G..."} sends 1000 ITC per address per 24 h. The G… account needs XLM from friendbot first (https://friendbot.stellar.org?addr=) and a trustline to ITC:GBJQ6XFHWPHFO4I4ZSVCLAOSBNT3WAFSSNYMJZC3ZA4CQBRRFQ2V6OJU (Operation.changeTrust({ asset: new Asset('ITC', 'GBJQ6XFHWPHFO4I4ZSVCLAOSBNT3WAFSSNYMJZC3ZA4CQBRRFQ2V6OJU') })). GET https://api-production-c74b9.up.railway.app/v1/faucet/stellar describes it. - 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). With a Stellar account (G...): POST https://api-production-c74b9.up.railway.app/v1/auth/stellar/challenge {"address":"G..."}, sign `message` as a SEP-53 signed message (Freighter, Hana and xBull do), then POST https://api-production-c74b9.up.railway.app/v1/auth/stellar/verify {"message","signature"} -> {"token"}. A key made with that session spends your Stellar balance with Inferit: what your x402 payments on Stellar did not use. ## Docs - The guide for agents (where to go, x402, API keys, limits, errors, the faucet, selling): https://inferit.cc/agents.md - Every website page as markdown (index): https://inferit.cc/llms.txt; all of it in one file: https://inferit.cc/llms-full.txt - API reference: https://inferit.cc/docs/api-reference.md ## 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-offer-kind (seller), x-inferit-model (the model that served the request), x-inferit-route (direct or auto:), x-inferit-auto-choice (auto only), x-inferit-rail, x-inferit-network. Money is integer micro-units (1e-6 of an ITC); prices are micro-units per 1M tokens. ## Errors OpenAI-shaped {"error":{"message","type","code"}}: 400 invalid_request, 400 invalid_auto_policy, 401 invalid_api_key, 402 insufficient_funds, 404 model_not_found, 404 model_not_servable (a reference row: no seller can list it; do not retry), 429 rate_limit_exceeded (with retry-after), 503 no_available_offers (with retry-after), 503 no_eligible_model (model auto: no model can serve this request now; error.reasons counts why). The full table: https://inferit.cc/agents.md. 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.