# Quickstart

> Add Whitechain Sepolia, get ITC to pay with and WBT for gas, deposit with a ceiling, sign in, create an API key, call the API and see the request settle on chain: the eight steps, with the API call behind each one.

From zero to a settled request on Whitechain Sepolia, in eight steps. The controls for each step are in the app's [Buy workspace](https://inferit.app/buy); this page is the reference behind them. Building an agent? It needs only an EVM private key and test ITC from Inferit's sponsored faucet: no browser wallet, no account, no API key and no WBT. See [Agents](https://inferit.cc/agents.md).

## Before you start

You need a browser wallet such as MetaMask or Rabby, and two test tokens with two different jobs. Testnet demo: test tokens, no monetary value.

| Token | What it is for | Where it comes from |
| --- | --- | --- |
| **ITC** (Inferit Test Credit) | Paying for inference. Every request is charged in µ: 1 µ = 0.000001 ITC. | Inferit's ITC faucet: 1,000 ITC per address per 24 h, free. Sponsored, so the claim needs no gas ([step 2](https://inferit.cc/docs/quickstart.md#itc)). |
| **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](https://faucet.testnet.whitechain.io) ([step 3](https://inferit.cc/docs/quickstart.md#wbt)). |

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 10 000 µ = 0.01 ITC) is credited to its own escrow balance, and each request is charged its exact µ cost against it. The machine-readable guide is [`/agents.md`](https://inferit.cc/agents.md).

## 1. Add Whitechain Sepolia

Whitechain Sepolia is an OP Stack L2 testnet. 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](https://inferit.app/buy)

## 2. Get ITC to pay with

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

**App:** [Buy workspace](https://inferit.app/buy) · **API:** [`POST /v1/faucet`](https://inferit.cc/docs/api-reference.md#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 one µ. 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 test WBT from the [Whitechain faucet](https://faucet.testnet.whitechain.io). 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](https://inferit.app/buy) · **Contract:** [`depositAndSetCap(amount, cap, expiry)`](https://inferit.cc/docs/payments/whitechain.md#deposit)

- **`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](https://inferit.app/buy) · **API:** [`POST /v1/auth/evm/challenge, /verify`](https://inferit.cc/docs/api-reference.md#auth-routes)

## 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 µ and a minimum discount.

**App:** [Buy workspace](https://inferit.app/buy) · **API:** [`POST /v1/keys`](https://inferit.cc/docs/api-reference.md#keys)

```bash
export INFERIT_API_KEY='ik_...'
```

## 7. Call the API

Any OpenAI-compatible client works: change the base URL and the key. The examples use a model with a live offer (the hosted demo serves `qwen/qwen-2.5-14b-instruct`, also reachable as `qwen2.5:14b-instruct`).

```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_

```typescript
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-buyer-cost-micro` header says what the request cost you, in µ. The other response headers are in the [API reference](https://inferit.cc/docs/api-reference.md#headers).

## 8. See it settle

The API meters each request in µ and settles usage in batches: one `settle` transaction on the escrow pays every seller line in it. The default is 0.10 ITC of unsettled usage or 1 h, whichever comes first; the hosted testnet settles within about 3 minutes.

The Buy workspace lists your requests and their costs. Each settlement is a transaction you can open on the [explorer](https://explorer.testnet.whitechain.io), first as _pending finality_, then _finalized_ once its L1 block is final (see [Finality](https://inferit.cc/docs/payments/whitechain.md#finality)). Market-wide totals are on [On-chain metrics](https://inferit.app/analytics). 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](https://inferit.cc/docs/payments/whitechain.md#live).

Whitechain Sepolia, chain id 1874, as deployed on 2026-10-04 (the page reads the live values from the contract):

| Contract or role | Address |
| --- | --- |
| MarketEscrow v0.3 | [0x705dD9eCffa888FbcF2849eAE2D3b136eb78B7e0](https://explorer.testnet.whitechain.io/address/0x705dD9eCffa888FbcF2849eAE2D3b136eb78B7e0) |
| ITC (Inferit Test Credit, TestCredit v2, 6 decimals) | [0x2E672dFE33EA977FD064E01aDe7d8c73B3Be7fBB](https://explorer.testnet.whitechain.io/address/0x2E672dFE33EA977FD064E01aDe7d8c73B3Be7fBB) |

## Next

-   [API reference](https://inferit.cc/docs/api-reference.md): every endpoint, error and header.
-   [Agents](https://inferit.cc/agents.md): pay per request with x402, no account and no API key.
-   [OpenCode](https://inferit.cc/docs/guides/opencode.md) and [Cursor](https://inferit.cc/docs/guides/cursor.md): use Inferit from a coding tool.
-   [Selling inference](https://inferit.cc/docs/sellers.md): list your own endpoint at your own price.

---

Canonical page: https://inferit.cc/docs/quickstart
All pages as markdown: https://inferit.cc/llms.txt
Testnet demo: test tokens, no monetary value.
