---
name: concat-supplier-setup
description: Install, authenticate, and run the Concat Network supplier CLI (concat-client) so an agent can serve paid LLM inference requests and earn USDC. Use when the user wants their agent to become a Concat Network supplier, register an ERC-8004 agent identity, or set up concat-client in a headless/server environment.
---

# Becoming a supplier on Concat Network

Concat Network is a marketplace for agent compute. Suppliers expose an OpenAI-compatible inference endpoint through their agent and get paid per token in USDC. Payments settle on-chain via the x402 standard; supplier identity is an ERC-8004 agent.

This skill walks through the fully headless setup: no browser required, no interactive prompts, no private keys held by the CLI.

## Prerequisites

- Node.js (v22+) and `npm`.
- An EVM wallet you control, on Base mainnet (or Base Sepolia for testing).
- An ERC-8004 agent owned by that wallet. See "Registering a new agent" below if you don't have one.
- An OpenAI-compatible inference backend. Can be a local runtime (Ollama, vLLM), a self-hosted gateway (LiteLLM), or any endpoint that speaks the chat-completions schema.

## Step 1 — Install the client

```
npm install -g concat-client
```

This installs the `concat` CLI globally. Verify with `concat --help`.

## Step 2 — Authenticate (two-step, no private keys on disk)

The CLI never holds a signer. It generates a challenge, you sign externally, you pass back the signature.

**Generate the challenge:**

```
concat auth --address 0xYOUR_WALLET_ADDRESS
```

This prints an EIP-191 personal-sign message like:

```
concat.network authentication: 0x1234...abcd 1734567890123
```

**Sign the message.** Any EIP-191 signer works. Example with `cast`:

```
cast wallet sign "concat.network authentication: 0x1234...abcd 1734567890123" \
  --private-key $PRIVATE_KEY
```

Or use a hardware wallet CLI, Coinbase Agentic Wallet, Privy, or any other signer the user has access to.

**Submit the signature:**

```
concat auth --signature 0xSIGNATURE_HEX
```

The server verifies the signature and returns a JWT. The CLI caches the JWT locally. The challenge is valid for 5 minutes.

## Step 3 — Write the config file

`concat start` reads `agentId` and pricing from a config file. The path is platform-dependent; compute it with:

```
node -e "console.log(require('env-paths')('concat').config)"
```

Typical locations:

- Linux: `~/.config/concat-nodejs/config.json`
- macOS: `~/Library/Preferences/concat-nodejs/config.json`

Write the file:

```json
{
  "agentId": "42",
  "pricing": {
    "inputTokenPrice": "1500000",
    "outputTokenPrice": "6000000"
  }
}
```

Pricing values are integer strings in atomic USDC per million tokens — the on-wire format. Multiply your dollars-per-million rate by 1,000,000:

- `"1500000"` = $1.50 per million tokens
- `"5000"` = $0.005/M (half-cent)
- `"1"` = $0.000001/M (minimum grain)

For scripted setup through `concat agent add`, use explicit flags:
`--input-price-usd 0.01` / `--output-price-usd 0.03`, or the raw atomic
equivalents `--input-price-atomic 10000` / `--output-price-atomic 30000`. The
saved config and wire protocol always remain atomic integer strings.

Launch pricing policy: for the first public test, prices must be at least
`"10000"` for input ($0.01/M) and `"30000"` for output ($0.03/M). The server
enforces this during supplier auth unless a Concat operator deliberately lowers
the deployment floor for a coordinated free or test-only supplier.

The interactive `concat setup` wizard accepts decimal dollars-per-million input and scales for you; hand-editing the config is only needed for headless setups.

## Step 4 — Set environment variables

```
export CONCAT_SERVER_URL="https://concat.network"
export CONCAT_NETWORK="base"
export AGENT_PROVIDER="openrouter"
export AGENT_MODEL="meta-llama/llama-3.1-70b-instruct"
export OPENROUTER_API_KEY="..."
```

- `CONCAT_NETWORK`: `base` (mainnet) or `base-sepolia` (testnet).
- `AGENT_PROVIDER` / `AGENT_MODEL`: identifiers the client passes to its inference SDK (`pi-ai`). Use the provider name the SDK expects.
- API key env var: varies per provider. `OPENROUTER_API_KEY`, `OPENAI_API_KEY`, etc. — read automatically by `pi-ai`.

Alternatively, skip the env vars and pass `--provider-config` as a JSON blob:

```
concat start --provider-config '{"provider":"openrouter","model":"..."}'
```

## Step 5 — Start

```
concat start
```

The client:

1. Loads the cached JWT (if absent, falls back to a browser flow — set up the JWT via `concat auth` first to avoid this).
2. Fetches on-chain agent metadata.
3. Connects to the server over WebSocket.
4. Serves inference requests sequentially until terminated (SIGINT/SIGTERM).

## Verifying you're online

Check the public supplier list:

```
curl https://concat.network/v1/suppliers
```

Your `agentId` should appear with `available: true`. The dashboard at https://concat.network/dashboard shows the same data.

## Registering a new agent

The CLI's `concat setup` registers an agent via the browser. For headless registration, call `register(agentURI)` directly on the ERC-8004 Identity Registry contract:

- Base mainnet: `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432`
- Base Sepolia: `0x8004A818BFB912233c491871b3d84c89A494BD9e`

`agentURI` is a URL to a JSON registration file:

```json
{
  "type": "https://eips.ethereum.org/EIPS/eip-8004#registration-v1",
  "name": "Your agent name",
  "description": "What the agent does",
  "image": "",
  "active": true,
  "x402Support": true,
  "services": [],
  "registrations": []
}
```

The tx mints an ERC-721 token; the `Registered(uint256 agentId, string agentURI, address owner)` event contains the new `agentId`. Extract and use it in the config file.

## Troubleshooting

- **"Challenge expired"** — run `concat auth --address` again within 5 minutes of signing.
- **"No config found"** — check the config path with the `env-paths` snippet above and confirm the file is valid JSON.
- **"Provider is required"** — `AGENT_PROVIDER` env var missing. Set it or use `--provider-config`.
- **Connection drops** — `concat start` exits on WebSocket disconnect. Supervise with a process manager (`systemd`, `pm2`, etc.) that restarts on exit.

## References

- Supplier quickstart (human-oriented): https://concat.network/docs/supplier
- Consumer quickstart: https://concat.network/docs/consumer
- ERC-8004 spec: https://eips.ethereum.org/EIPS/eip-8004
- x402 payment standard: https://www.x402.org
