Skip to content

01 — Start

Markdown

Quickstart

In the app it is three steps. Below them is the same path by hand, in eight steps, with the API call or contract call behind each one. Building an agent? It needs only an EVM private key and free API credits from Inferit's sponsored faucet: no browser wallet, no account, no API key and no WBT. See Agents.

In the app: three steps

  1. Top up. Open the Buy workspace and connect a browser wallet. It gives you free API credits and walks you through the deposit and your ceiling; the deposit is a transaction, so it links the Whitechain faucet for the gas it needs (step 3).
  2. Create a key. In the same workspace, with a spending limit if you like. It is shown once.
  3. Call the API. Point any OpenAI-compatible client at the API with your key, and name a model with a live seller (step 7).

No browser wallet here? On a phone, open the Buy workspace in your wallet app's browser. Building an agent? You don't need a wallet app: a private key in your code gets free API credits and an API key. See the agent quickstart, or get an API key from code.

Before you start

You need a browser wallet such as MetaMask or Rabby, and two tokens with two different jobs.

TokenWhat it is forWhere it comes from
ITC (API credits)Paying for inference. 1 credit counts as $1 in prices, and every request is charged its exact cost, down to $0.000001.Inferit's faucet: 1,000 free API credits per address per 24 h. Sponsored, so the claim needs no gas (step 2).
WBT (Whitechain's gas token)Gas for on-chain transactions you send yourself: the approve and the deposit, withdrawals, seller registration. Never for inference.The Whitechain faucet (step 3).

An agent pays per request with x402 instead: it signs with its own key, with no account, no API key and no WBT, because the facilitator pays the gas. Its payment (at least $0.01) is credited to its own escrow balance, and each request is charged its exact cost against it. The machine-readable guide is /agents.md.

1. Add Whitechain Sepolia

Whitechain Sepolia is an OP Stack L2. Add the network and the ITC token to your wallet by hand, or connect the wallet in the app:

Network name
Whitechain Sepolia
Chain ID
1874
RPC URL
https://rpc.testnet.whitechain.io
Currency symbol (gas)
WBT
Block explorer
https://explorer.testnet.whitechain.io
ITC token (6 decimals)
0x2E672dFE33EA977FD064E01aDe7d8c73B3Be7fBB
Open the Buy workspace

2. Get ITC to pay with

API credits (ITC) are what you pay for inference with. Inferit's faucet gives 1,000 free API credits per address per 24 h. It is sponsored: Inferit pays the gas, so the claim needs no WBT.

App: Buy workspace · API: POST /v1/faucet

bash
curl -s -X POST https://api-production-c74b9.up.railway.app/v1/faucet \
  -H 'content-type: application/json' \
  -d '{"address":"0xYourAddress"}'

ITC has 6 decimals, so one base unit is a millionth of a credit ($0.000001). A second claim for the same address within 24 h gets 429 faucet_cooldown.

3. Get WBT for gas

WBT is Whitechain's native gas token. Your wallet spends it on the two transactions in step 4, and later on a withdrawal. Get WBT from the Whitechain faucet. Checked 2026-10-06: it asks for a GitHub account at least 30 days old and gives 0.5 WBT per 24 h. Keep at least 0.002 WBT for the approve and the deposit; the app blocks deposits below that.

4. Deposit and set a ceiling

Two transactions from your wallet: approve on the ITC token, then depositAndSetCap on the escrow contract (MarketEscrow).

App: Buy workspace · Contract: depositAndSetCap(amount, cap, expiry)

amount
The ITC you deposit. It stays yours until it is settled or withdrawn.
cap
Your ceiling: the most the operator may ever settle from you, counted cumulatively. The app suggests your deposit, at most 25 ITC.
expiry
When that permission ends; 7 days by default. After it, nothing more can be settled from you.

Escrow activity on Whitechain is public chain data. Fund from a dedicated wallet if you do not want your spending linked to your main address.

5. Sign in

Sign a one-time challenge message (EIP-4361) with the same wallet. It is an off-chain text signature: no transaction, no gas, no tokens move. The session lasts 24 h and covers both workspaces, Buy and Sell.

App: Buy workspace · API: POST /v1/auth/evm/challenge, /verify

6. Create an API key

Keys start with ik_ and are shown exactly once, so store yours in your environment. A key can carry a spend limit in dollars and a minimum discount.

App: Buy workspace · API: POST /v1/keys

bash
export INFERIT_API_KEY='ik_...'

7. Call the API

Any OpenAI-compatible client works: change the base URL and the key, and name a model with a live offer, such as qwen/qwen-2.5-14b-instruct in the examples below (models with live offers). You can also send "model": "auto" and let Inferit pick the model (automatic routing).

Guides: LangChain, Vercel AI SDK, LiteLLM, CrewAI.

bash
curl https://api-production-c74b9.up.railway.app/v1/chat/completions \
  -H "Authorization: Bearer $INFERIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen/qwen-2.5-14b-instruct",
    "messages": [{"role": "user", "content": "Write a haiku about spare GPUs."}]
  }'

Streaming is a byte-faithful relay of the seller's server-sent events:

bash
curl -N https://api-production-c74b9.up.railway.app/v1/chat/completions \
  -H "Authorization: Bearer $INFERIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen/qwen-2.5-14b-instruct",
    "stream": true,
    "messages": [{"role": "user", "content": "Count to five."}]
  }'
stream.mjs
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api-production-c74b9.up.railway.app/v1',
  apiKey: process.env.INFERIT_API_KEY,
});

const stream = await client.chat.completions.create({
  model: 'qwen/qwen-2.5-14b-instruct',
  messages: [{ role: 'user', content: 'Explain a spending cap in one sentence.' }],
  stream: true,
});
for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
}

The x-inferit-model header names the model that answered, and x-inferit-buyer-cost-micro says what the request cost you, in millionths of a dollar. The other response headers are in the API reference.

8. See it settle

The API meters each request to the millionth of a dollar and settles usage in batches: one settle transaction on the escrow pays every seller line in it. The default is $0.10 of unsettled usage or 1 h, whichever comes first; the cadence the hosted API runs is in GET /metrics (settlement.cadence).

The Buy workspace lists your requests and their costs. Each settlement is a transaction you can open on the explorer, first as pending finality, then finalized once its L1 block is final (see Finality). The API records token counts and costs, never prompts or completions; the seller that serves a request sees it.

Routing controls

The router sends each request to the cheapest healthy seller on Inferit. To accept only offers below the list price by a minimum discount:

bash
# Only route to offers at least 30% below the list price
curl https://api-production-c74b9.up.railway.app/min30/v1/chat/completions \
  -H "Authorization: Bearer $INFERIT_API_KEY" ...

# The same as a header
# (the strictest of path, header and key setting wins)
curl https://api-production-c74b9.up.railway.app/v1/chat/completions \
  -H "x-min-discount: 30" ...

Contracts

Read live from the chain. Every parameter, with the calls and the checks the contract performs, is on Whitechain escrow.

Next