# Quickstart

> Three steps in the app, or eight by hand: add Whitechain Sepolia, get free API credits to pay with and WBT for gas, deposit with a ceiling, sign in, create an API key, call the API with a model that has a live seller and see the request settle on chain.

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](https://inferit.cc/agents).

## In the app: three steps

1.  **Top up.** Open the [Buy workspace](https://inferit.app/buy) 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](https://inferit.cc/docs/quickstart.md#wbt)).
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](https://inferit.cc/docs/quickstart.md#call)).

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](https://inferit.cc/agents#quickstart), or [get an API key from code](https://inferit.cc/agents#api-key).

## Before you start

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

| Token | What it is for | Where 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](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 $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`](https://inferit.cc/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](https://inferit.app/buy)

## 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](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 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](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 dollars 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, and name a model with a live offer, such as `qwen/qwen-2.5-14b-instruct` in the examples below ([models with live offers](https://inferit.app/models)). You can also send `"model": "auto"` and let Inferit pick the model ([automatic routing](https://inferit.cc/docs/routing.md)).

Guides: [LangChain](https://inferit.cc/docs/guides/langchain.md), [Vercel AI SDK](https://inferit.cc/docs/guides/vercel-ai-sdk.md), [LiteLLM](https://inferit.cc/docs/guides/litellm.md), [CrewAI](https://inferit.cc/docs/guides/crewai.md).

```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-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](https://inferit.cc/docs/api-reference.md#headers).

## 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](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)). 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 (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): 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
