Kvasir developer API

Pay-per-inference in KVR over an OpenAI-compatible surface: discover a model, quote, pay on-chain from your own wallet, redeem. Solana devnet.

For AI agents

If you are an agent acting for a user, everything you need is below as plain text — how to install a node and join the network (Linux headless, or the Windows/macOS desktop app), the wallet, and how to call the paid API. The same text is at /llms.txt; the API walkthrough is at /llms-api.txt.

# Kvasir

> Kvasir is a decentralized AI inference network (DePIN) in devnet preview. It runs open models that are larger than any single machine serving them: the source-available **p4** engine cuts a model into layer windows, and each device — GPU, CPU or phone — holds only its own window and hands a hidden state to the next. Step-3.7-Flash, 198B parameters, serves this way at 6.7–6.8 tokens a second. Contributors earn the **KVR** devnet token for measured compute.

Key facts (accurate as of 2026-09-21):

- **Kvasir** = the network/product brand (self-custody wallet + settlement gateway + node-reward network). **p4** = the source-available engine it runs on (Business Source License 1.1), on the `p4` branch of the repository below. **linkcpp** = the previous engine, superseded by p4 in mid-2026; results attributed to it are labelled as such. **KVR** = the token (on-chain name "Kvasir", 6 decimals, Solana **devnet** only).
- **Ring topology:** every device stores the same model and loads only its contiguous layer window, opening one link to its predecessor and one to its successor. Hidden-state boundaries circulate around the ring; the last node returns the token. There is no central master on the data path; placement comes from a plan an operator loads.
- **Rewards** are for measured compute. Roles: **compute node** (per contribution unit ≈ 1k tokens × layer share × performance tier S/A/B/C = ×1.5/×1.25/×1.0/×0.7), **gateway host** and **bridge host** (hourly uptime; the gateway also gets an inference bonus). Roles stack; rewards are paid in KVR to each node owner's wallet.
- **Contributors:** a device joins by proving a wallet, not by being let in. `POST /api/auth/challenge {"wallet"}` returns a nonce and a message; signing it and posting to `/api/auth/node-token` returns a 30-day bearer token scoped to participation and nothing else. With that token `GET /api/expert-demand` says which layers are short. No stake and no minimum balance are needed; a bridge may still admit only wallets its operator has listed (see step 4 below). A headless Linux node does all of this for you; Windows and macOS use the desktop app. Step by step for an agent: section "Join the network as a node" below.
- **Developers:** OpenAI- and Anthropic-compatible gateway (`/v1/chat/completions`, `/v1/models`, `/anthropic/v1/messages`, `/anthropic/v1/models`). The Anthropic surface is non-streaming for now and says so if asked to stream; `/v1/responses` is not implemented, and an unimplemented API path answers a JSON 404 naming what does exist. Two ways to pay: pay-per-call (sign an on-chain KVR payment per request, no API key) or prepaid credits with an API key that an AI agent can self-issue from a wallet secret — see [llms-full.txt](https://kvasir-ai.net/llms-full.txt) and https://kvasir-ai.net/docs/api.
- **Compliance:** KVR is a devnet utility / contribution token — not a tradable mainnet asset, price, or investment, and nothing on the site is a promise of financial return. Wallet keys stay on the user's device; on devnet, staked KVR and prepaid credits are held by the gateway treasury until an on-chain staking program ships.
- **Serving today:** Step-3.7-Flash, a 198B MoE (45 layers, 288 experts per layer, top-8, Q4_K_XL), placed as 2 stages across two NVIDIA GB10 machines.
- **Also measured:** a 122B model (Qwen3.5-122B-A10B) served end to end across 3 physical machines — a GB10 and two Mac M4 Pros — with a phone holding part of it; cosine similarity ≥ 0.9999 across ROCm, CUDA and a phone CPU. GLM-5.2 (744B MoE) was verified on **linkcpp**, the previous engine, and that report is not published yet. Kimi K3 (2.8T MoE) on p4 is the next gate.
- **Live as of 2026-09-21:** the settlement gateway is ported to p4 and answering at `gate.kvasir-ai.net`. A paid request crosses the gateway, the bridge and the GB10 ring and is billed on the tokens it actually used. `/v1/models` answers **401** without a key — that is the gateway working, not an outage. Measured on the serving ring on 2026-10-01: Step-3.7-Flash (198B MoE) across two stages at **6.7–6.8 tok/s** single stream, **67–71 ms** to first token.
- **Retired:** `hub.kvasir-ai.net`. The control plane behind it was deleted, the bridge (`p4bridge`) took over its role, and a device now reaches it through the gateway. The DNS record was removed on 2026-09-21, so the host no longer resolves at all. If you hold a cached reference to it, drop it.
- **In flight right now:** hardening the ring through recovery gates after an interrupted 64-request run; turning the desktop client into a node that supervises a p4 agent; and carrying expert-grain sharding onto p4 — the market and the relays that let a phone join are live, the shard download and the engine-side dispatch are not. NPU support is in progress.
- **Terms & privacy:** https://kvasir-ai.net/legal
- **Name origin:** in Norse myth, Kvasir was formed from the pooled essence of all the gods and was the wisest being; his blood became the Mead of Poetry, sharing wisdom with all.
- **Languages:** the homepage is available in English, 한국어, 中文, Español, 日本語, Français, Deutsch, Nederlands and Bahasa Indonesia.

## Join the network as a node — instructions for an agent

You are setting up a Kvasir node on a user's machine, the wallet it earns into, and starting it. Pick the path by OS first: **Linux + NVIDIA → steps 1–8 (headless)**; **Windows / macOS → the desktop app section**, then steps 4 and 8.

Every step below is a shell command or
one HTTP request. There is no stake and no minimum balance — a wallet holding
zero KVR can register a node and earn.

Joining may be restricted. A bridge can be configured to admit only wallets its
operator has listed, and where it is, a wallet that is not on the list is
refused at the token step with a valid signature — the refusal is about who the
wallet is, not about how it signed. Nothing in this document gets you onto that
list; ask the operator. Where no list is configured, any wallet that proves a
key may join. Do not assume which case you are in: do step 4 anyway, and treat
a refused token with a good signature as "not listed yet", not as a bug.

Base URL for anything over the network: https://gate.kvasir-ai.net

The user's part, and it is only this: **how much GPU memory to lend**, sending
one message to the bot that approves machines, and keeping a backup of the key.
The installer refuses to guess the first — a default would either waste the
card or take the machine down.

### Before you start: do not

- **Do not print the node key**, `cat` it, echo it, or copy it into the
  conversation. `~/.config/kvasir/node-key.json` is a 64-byte Solana secret in
  a JSON array. Rewards are paid to it and anyone who reads it can spend them.
  Anything you print is in your transcript.
- **Do not put a funded wallet's secret on a server.** The installer generates
  a key for exactly this reason. If the user wants rewards in a wallet they
  already hold, do not move the secret here — see "Earning into a wallet you
  do not put on the box" below.
- **Do not start the node before the budget is set.** The unit ships with
  `REPLACE_ME` on purpose, and systemd will fail the unit rather than guess.
- The wallet **address** is public and safe to show — show it, the user needs
  it to watch earnings. The node token from `/api/auth/node-token` is safe for
  you to hold: it authorises participation and nothing else, and it cannot
  load or unload a model.

### Windows and macOS: the desktop app

There is no headless node for Windows or macOS. The node there is the Kvasir
Wallet desktop app, which holds the wallet and supervises a p4 agent.

1. Download the installer for the machine (these links are stable; each points
   at the current build):
   - Windows x64: https://kvasir-ai.net/download/Kvasir-Wallet-win-x64.exe
   - macOS (Apple silicon and Intel): https://kvasir-ai.net/download/Kvasir-Wallet-mac-universal.dmg
   - Linux desktop x64: https://kvasir-ai.net/download/Kvasir-Wallet-linux-x64.tar.gz
   - Android: https://kvasir-ai.net/download/Kvasir-Wallet-android-arm64.apk (see https://kvasir-ai.net/install)
   Download with the shell (`curl -fL -o <file> <url>`, or
   `Invoke-WebRequest -Uri <url> -OutFile <file>` in PowerShell). Running the
   installer and answering any OS security prompt is the user's click, not yours.
2. The user opens the app and creates (or imports) the wallet **in the app**.
   The key never leaves the app; do not ask for it, and do not look for it on
   disk. Ask only for the wallet **address** the app shows — it is public.
3. On the node screen the user sets how much memory to lend and starts the node.
   The same profile fields as step 4 below are shown there; do step 4 with them.
4. Confirm with step 8 (`/api/node/status/<ADDRESS>`). `totals.nodes ≥ 1`
   means the network sees the node. A node can be registered and online while
   holding no ring stage or expert yet — what it is given depends on the market.

### 1. Check the machine

This headless path is Linux only. On **Windows or macOS** use the desktop
path in "Windows and macOS: the desktop app" below instead and skip steps 2–7.

    uname -s -m        # Linux and x86_64 (aarch64 builds are not published yet)
    nvidia-smi --query-gpu=name,compute_cap,driver_version --format=csv,noheader
    ldd --version | head -1

What it needs:

| requirement | why it fails otherwise |
| --- | --- |
| NVIDIA GPU, compute capability 7.5+ | GTX 16xx / RTX 20xx and newer; older cards have no build |
| driver supporting CUDA 13 (R580+) | the worker carries its own CUDA, but not a driver |
| glibc 2.27+ | Ubuntu 18.04, Debian 10, RHEL 8 and later |
| ~1 GB, plus ~9.5 MB per expert held | the node, its runtime, and the weights it agrees to carry |

Stop and tell the user if any of these is missing. None of them can be worked
around from here.

### 2. Install

    curl -fsSL https://pub-3fa7c08233cd497dbd39f89a9093c965.r2.dev/node/install.sh | sh

Run it as the user, not as root, unless they asked for a system service. As a
user it installs under `~/.local/share/kvasir-node` with a user unit; as root
it goes to `/opt` with a system unit. On a shared box the user install is the
better neighbour.

What it does, and you should know it did: works out the architecture, uses the
machine's Node if it is version 20 or newer and otherwise unpacks a private
one, reads `latest.json`, downloads the release and **checks its SHA-256
before unpacking**, creates `~/.config/kvasir/node-key.json` if there is none,
and writes a systemd unit. It does not start anything.

It prints the wallet address. Keep it — every later check is addressed to it.

### 3. The key

The installer made one if there was none. Confirm it exists and is not
readable by anyone else, without reading it:

    ls -l ~/.config/kvasir/node-key.json     # expect -rw------- (600)
    ~/.local/share/kvasir-node/kvasir-node address --key ~/.config/kvasir/node-key.json

The second prints the address only. Tell the user, in these terms: this file
is the account rewards are paid into, it is the only copy, and if the machine
dies without a backup the earnings are gone. Ask them to back it up somewhere
that is not this machine.

If a key was already there, the installer kept it and said so. Never overwrite
one.

### 4. Ask the operator to let this machine in

A bridge can be configured to admit only wallets its operator has listed. Where
it is, this node's token request is refused however correctly it signs, and
nothing you run on this machine changes that — the list is the operator's.

Send two things to **@kvasir_watch_bot** on Telegram: the machine's profile and
the owner's wallet address. One without the other cannot be acted on. The
address is what gets listed; the profile is what the decision is made on.

The profile is the machine's resource inventory in the shape the network
already uses for it — what the desktop app shows on its node screen, and what a
node reports about itself once it is in:

| field | what it is |
| --- | --- |
| `os` · `arch` | linux / macos / windows, and the CPU architecture |
| `cpu` | brand and core count |
| `ramBytes` | total system memory |
| `backend` | what the hardware says it is: cuda, rocm, metal, vulkan or cpu |
| `gpus[]` | each accelerator, its name and its memory |
| budget | how much of that memory this machine will lend — the number from step 5 |

On the desktop app, read it off the node screen. On a headless server the same
facts come from the machine directly:

    NODE=~/.local/share/kvasir-node/kvasir-node
    KEY=~/.config/kvasir/node-key.json
    . /etc/os-release 2>/dev/null
    printf 'kvasir join request\n  wallet   %s\n  host     %s\n  os       %s / %s\n  cpu      %s (%s cores)\n  ram      %s\n  backend  %s\n  gpus     %s\n  lending  %s\n' \
      "$("$NODE" address --key "$KEY")" \
      "$(hostname)" \
      "${PRETTY_NAME:-$(uname -sr)}" "$(uname -m)" \
      "$(awk -F: '/model name/{print $2; exit}' /proc/cpuinfo 2>/dev/null | sed 's/^ *//')" \
      "$(nproc)" \
      "$(free -h 2>/dev/null | awk '/^Mem:/{print $2}')" \
      "$(command -v nvidia-smi >/dev/null && echo cuda || echo cpu)" \
      "$(nvidia-smi --query-gpu=name,memory.total,compute_cap,driver_version --format=csv,noheader 2>/dev/null | paste -sd'; ' -)" \
      "<GiB you will set in step 5>"

Nothing in that block is secret. The wallet address is public and is the point
of sending it.

You cannot send it yourself — the bot takes a message from a person, and a
headless server holds no Telegram credentials. Print the block and ask the user
to send it to @kvasir_watch_bot. That is the second and last thing they do.

Then wait. Step 7 will not succeed before the wallet is on the list, and the
failure there is not a bug to debug — it is this step, unfinished.

### 5. The budget — the user's decision

Edit the unit and replace `REPLACE_ME` with a number of GiB:

    ${EDITOR:-vi} ~/.config/systemd/user/kvasir-node.service
    # ExecStart=... run --key ... --budget 8

Ask the user for the number. Frame it as: how much of this card may the node
take, leaving room for whatever else runs on it. The node turns the budget
into a count of experts it can hold and says the number when it starts.

### 6. The worker

The compute binary is a separate download because it is large and specific to
the GPU. It carries its own CUDA libraries — there is no toolkit to install
and nothing to add to a library path.

    ~/.local/share/kvasir-node/kvasir-node worker --install

### 7. Start it

    systemctl --user daemon-reload
    systemctl --user enable --now kvasir-node
    systemctl --user status kvasir-node

On start the node registers under the wallet, asks the network which experts
are scarce, downloads only those weights, and begins answering for them. What
it is given depends on what the network is short of at that moment — it is a
market, not an assignment.

For a user unit to survive logout, enable lingering once:

    loginctl enable-linger "$USER"

### 8. Confirm — headless, both of these

    systemctl --user is-active kvasir-node

Needs `active`.

    curl -fsS https://gate.kvasir-ai.net/api/node/status/<ADDRESS>

Answers `{owner, totals:{nodes, online, contributedUnits, effectiveUnits,
pending, claimedTotal, lifetimeRewards}, nodes:[]}`. Needs `totals.nodes` to
be at least 1 — that is the network agreeing this node exists. `online` turns
1 once it is answering. `contributedUnits` stays 0 until it has actually
carried work, which is normal for a node that just started.

Give the user this URL. It is how they watch it earn, and it needs no key.

### Earning into a wallet you do not put on the box

The node signs with the key it holds, so rewards accrue to that key's address.
To end up in a wallet the user already has, do not copy that wallet's secret
onto the server. Let the node keep its own key and have the user move the
balance out, or claim to their wallet from the app — the desktop and mobile
wallets do this without the server key ever leaving the server.

### What a node token is, if you write your own client

The installer does this for you. A client that is not the installer proves a
wallet and gets a participation token:

    curl -fsS -X POST https://gate.kvasir-ai.net/api/auth/challenge \
      -H 'Content-Type: application/json' -d '{"wallet":"<ADDRESS>"}'
    # sign message verbatim, base64
    curl -fsS -X POST https://gate.kvasir-ai.net/api/auth/node-token \
      -H 'Content-Type: application/json' \
      -d '{"wallet":"<ADDRESS>","nonce":"<NONCE>","signature":"<BASE64>"}'
    # then, with Authorization: Bearer <node_token>
    curl -fsS -H "Authorization: Bearer <TOKEN>" https://gate.kvasir-ai.net/api/expert-demand

The token lasts 30 days and authorises participation only — the coverage
market, a shard download, and opening a relay. Holding it grants nothing over
a model. A challenge is single use and expires in five minutes.

A machine behind NAT cannot be dialled and so cannot join on its own; the
relay gives it an address it has not got, and the node holds one outbound
connection to it. Bytes through a relay are not a measure of contribution and
are never credited as one.

Honest scope: registering, reading the market and opening a relay work today.
Expert-grain sharding is still being carried onto p4 — the shard download and
the engine-side dispatch are not finished, so a client you write yourself can
get as far as the market and no further. The installer's node uses the path
that is built.

### What it earns

`units += (tokens / 1k) × (node_layers / total_layers)`, then multiplied by a
performance tier from measured decode throughput: S ≥ 90 tok/s ×1.5, A ≥ 60
×1.25, B ≥ 30 ×1.0, C < 30 ×0.7. Expert work is credited in full with no tier
multiplier — the tiers apply to nodes that generate tokens, which an expert
node does not.

Infrastructure roles (gateway host, bridge host) also accrue hourly uptime.
They are assigned by the network, not bought, and a node cannot grant them to
itself.

KVR is a Solana **devnet** utility token. It is not tradable, not a price, and
not a return. Say that to the user rather than letting "earn" imply otherwise.

### Errors

| what you see | what to do |
| --- | --- |
| `this installs a Linux node` | macOS or Windows — send them to the desktop app |
| `no build for <arch>` or `the index has no build for linux-arm64` | only linux-x64 is published today; stop |
| `checksum mismatch` | the download was corrupted or tampered with; do not unpack, retry once, then stop |
| `the index has no build for linux-<arch> yet` | nothing published for that architecture; tell the user |
| `no sha256sum or shasum to verify the download with` | install coreutils; do not skip the check |
| unit fails with `REPLACE_ME` | the budget was never set; go back to step 5 |
| `keygen needs --out` / `address needs --key` | a path argument is missing, not a key problem |
| node token refused with a good signature | the wallet is not on the operator's list yet — step 4, and wait for it |
| `totals.nodes` stays 0 after start | the node is not reaching the gateway; check egress and `systemctl --user status` |
| worker download fails | the GPU has no published build; report the `compute_cap` you found |

### Related

- Spend on inference instead of earning: https://kvasir-ai.net/llms-api.txt
- The guide a person reads: https://kvasir-ai.net/run-node

## Use the inference API instead — instructions for an agent

Spending KVR on inference (wallet, prepaid API key an agent can self-issue,
first call, errors) is a separate path: https://kvasir-ai.net/llms-api.txt

## Links

- [Homepage](https://kvasir-ai.net/): the full marketing site (all sections).
- [Source on GitHub](https://github.com/louisevandan/kvasir-net): the source-available engine (BSL 1.1); the `p4` branch holds the distributed inference engine.
- [Release notes](https://kvasir-ai.net/releases): what shipped, when, and the evidence for it.
- [Gateway](https://gate.kvasir-ai.net): OpenAI/Anthropic-compatible inference gateway (devnet), live. `/v1/models` answers 401 without a key — that is the gateway working, not an outage.
- [Agent instructions — use the inference API](https://kvasir-ai.net/llms-api.txt): for an agent doing it on someone's behalf — wallet, API key, first call, errors.
- Agent instructions — run a node: this file, section "Join the network as a node" (https://kvasir-ai.net/llms-node.txt redirects here).
- [Run a node](https://kvasir-ai.net/run-node): how a device joins — desktop app, mobile, or a headless Linux server installed with one command.
- [Installing the mobile builds](https://kvasir-ai.net/install): how to install the Android package and how to build and sign the iOS app for your own device.
- [Terms & privacy](https://kvasir-ai.net/legal)
- [Full text for LLMs](https://kvasir-ai.net/llms-full.txt): the complete site content as plain text.