Documentation

StrataCode AntSeed connection guide

How to connect to the StrataCode seller on AntSeed. AntSeed is peer-to-peer: you run a local buyer proxy, pin the StrataCode peer, deposit USDC on Base, then send OpenAI- or Anthropic-compatible requests to localhost.

AntSeed 0.1.125 Network Base mainnet Asset USDC Agents StrataCodingAgent · -Fast

01 What you're connecting to

AntSeed buyers connect to a local buyer proxy that listens on http://localhost:8377. The proxy handles peer discovery, peer pinning, routing, encrypted peer-to-peer transport, payment channels, and settlement. The buyer sends normal API calls to the local proxy, and the proxy forwards them to the pinned seller peer.

For StrataCode, buyers should pin this exact seller peer ID and request one of these service/model names:

Seller display name
StrataCode
Seller peer ID
6f9b9e63d3f776d359eb2fb0a82d12ee496fbefe
Service / model names
StrataCodingAgent, StrataCodingAgent-Fast
Categories
chat, coding, json, reasoning, tools

02 Requirements

  • Node.js 20+ installed.
  • AntSeed CLI installed globally.
  • A buyer identity key, preferably supplied through ANTSEED_IDENTITY_HEX.
  • USDC on Base mainnet deposited into AntSeed for payment.
  • The StrataCode peer pinned in the local buyer proxy.
bash · install the CLI
# Install AntSeed CLI
npm install -g @antseed/cli

# Confirm installed version
antseed --version
# Expected for this guide: 0.1.125

03 Quick start

The shortest path for a buyer who already has a private key available and wants to connect to StrataCode.

bash · start the buyer proxy
export ANTSEED_IDENTITY_HEX=<your-64-char-private-key-hex>

# Start the local buyer proxy
antseed buyer start
# Proxy should listen on http://localhost:8377

In another terminal, pin StrataCode:

bash · pin the peer
antseed buyer connection set --peer 6f9b9e63d3f776d359eb2fb0a82d12ee496fbefe

Deposit USDC through the local payments portal:

bash · deposit usdc
antseed payments
# Opens http://localhost:3118
# Connect a funded wallet on Base mainnet, approve USDC, and deposit.
API keys

AntSeed does not require a real OpenAI or Anthropic API key for the local proxy. Some tools require a placeholder API key field; use any placeholder such as antseed.

04 Pin StrataCode as the seller peer

AntSeed buyer requests will return no_peer_pinned until a seller peer is selected. Pin StrataCode once, then requests will route to that peer after proxy restart unless you clear the connection.

bash · browse, inspect, pin, clear
# Browse peers and services
antseed network browse

# Inspect StrataCode in detail
antseed network peer 6f9b9e63d3f776d359eb2fb0a82d12ee496fbefe

# Pin StrataCode
antseed buyer connection set --peer 6f9b9e63d3f776d359eb2fb0a82d12ee496fbefe

# Clear the pinned peer if needed
antseed buyer connection clear

Per-request pinning is also available. This is useful when a buyer runs one proxy but wants a specific request to use StrataCode:

per-request pinning
# Header-based pinning
x-antseed-pin-peer: 6f9b9e63d3f776d359eb2fb0a82d12ee496fbefe

# Model-prefix pinning
6f9b9e63d3f776d359eb2fb0a82d12ee496fbefe@StrataCodingAgent

05 Verify model availability

After the buyer proxy is running and StrataCode is pinned, list available models from the local proxy.

bash · list models
curl -s http://localhost:8377/v1/models | jq
# Expected to include:
# StrataCodingAgent
# StrataCodingAgent-Fast

If the model does not appear, check that the buyer proxy is running, the StrataCode peer is online, the peer ID is correct, and your buyer state is not using a stale data directory.

06 API examples

OpenAI-compatible base URL
http://localhost:8377/v1
Anthropic-style base URL
http://localhost:8377

6.1 — OpenAI Chat Completions (cURL)

bash
curl http://localhost:8377/v1/chat/completions \
  -H "content-type: application/json" \
  -H "x-antseed-pin-peer: 6f9b9e63d3f776d359eb2fb0a82d12ee496fbefe" \
  -d '{
    "model": "StrataCodingAgent",
    "messages": [
      {"role": "system", "content": "You are a helpful coding assistant."},
      {"role": "user", "content": "Write a Python function that reverses a linked list."}
    ],
    "temperature": 0.2
  }'

6.2 — OpenAI Responses API (cURL)

bash
curl http://localhost:8377/v1/responses \
  -H "content-type: application/json" \
  -H "x-antseed-pin-peer: 6f9b9e63d3f776d359eb2fb0a82d12ee496fbefe" \
  -d '{
    "model": "StrataCodingAgent",
    "input": "Explain what a payment channel is in simple terms."
  }'

6.3 — Anthropic Messages API (cURL)

bash
curl http://localhost:8377/v1/messages \
  -H "content-type: application/json" \
  -H "x-antseed-pin-peer: 6f9b9e63d3f776d359eb2fb0a82d12ee496fbefe" \
  -d '{
    "model": "StrataCodingAgent",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Generate a JSON schema for a todo item."}
    ]
  }'

6.4 — Python (OpenAI SDK style)

python
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8377/v1",
    api_key="antseed",  # placeholder; AntSeed authenticates locally
    default_headers={
        "x-antseed-pin-peer": "6f9b9e63d3f776d359eb2fb0a82d12ee496fbefe"
    },
)

response = client.chat.completions.create(
    model="StrataCodingAgent",
    messages=[
        {"role": "system", "content": "You are a concise coding assistant."},
        {"role": "user", "content": "Write a TypeScript debounce function."},
    ],
    temperature=0.2,
)
print(response.choices[0].message.content)

6.5 — JavaScript / TypeScript (fetch)

javascript
const res = await fetch("http://localhost:8377/v1/chat/completions", {
  method: "POST",
  headers: {
    "content-type": "application/json",
    "x-antseed-pin-peer": "6f9b9e63d3f776d359eb2fb0a82d12ee496fbefe"
  },
  body: JSON.stringify({
    model: "StrataCodingAgent",
    messages: [
      { role: "system", content: "You are a helpful coding assistant." },
      { role: "user", content: "Return valid JSON with three project ideas." }
    ],
    temperature: 0.2
  })
});
const data = await res.json();
console.log(data);

6.6 — JavaScript / TypeScript (OpenAI SDK style)

javascript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "http://localhost:8377/v1",
  apiKey: "antseed",  // placeholder
  defaultHeaders: {
    "x-antseed-pin-peer": "6f9b9e63d3f776d359eb2fb0a82d12ee496fbefe"
  }
});

const completion = await client.chat.completions.create({
  model: "StrataCodingAgent",
  messages: [
    { role: "user", content: "Write a short unit test example in Jest." }
  ]
});
console.log(completion.choices[0].message.content);

07 Coding-agent setup

7.1 — Codex CLI

For recent Codex versions, AntSeed recommends the antseed codex wrapper because recent Codex builds may ignore OPENAI_BASE_URL. Use the wrapper with the StrataCode service model:

bash · recommended wrapper
antseed codex --model StrataCodingAgent

Manual Codex profile option: create a user-level profile file at ~/.codex/antseed.config.toml. If your buyer proxy uses a non-default port, adjust base_url.

~/.codex/antseed.config.toml
model = "StrataCodingAgent"
model_provider = "antseed"

[model_providers.antseed]
name = "AntSeed"
base_url = "http://localhost:8377/v1"
wire_api = "responses"
bash · run with the profile
codex --profile antseed --model StrataCodingAgent

7.2 — Claude Code / Anthropic-compatible clients

For Anthropic-compatible clients, point the base URL at the local proxy without /v1.

bash
export ANTHROPIC_BASE_URL=http://localhost:8377
claude

7.3 — Generic OpenAI-compatible tools

env
OPENAI_BASE_URL=http://localhost:8377/v1
OPENAI_API_KEY=antseed
MODEL=StrataCodingAgent
PINNED_PEER=6f9b9e63d3f776d359eb2fb0a82d12ee496fbefe

08 Payments and pricing

AntSeed uses USDC on Base mainnet. Buyers pre-deposit USDC, sessions reserve budget, requests are metered by token usage, and providers are paid through on-chain settlement. The cost formula is:

cost formula
requestCostUSD = totalTokens * agentUsdPerMillion / 1_000_000
# Flat per-token rate per agent — input and output tokens are priced the same.
Agent
Price — notes
StrataCodingAgent
10.50 USD / 1M — flagship coding agent
StrataCodingAgent-Fast
10.00 USD / 1M — faster, lower-latency variant
Payment asset
USDC on Base mainnet — 6-decimal USDC settlement
Worked example · 12,000 tokens

StrataCodingAgent     = 12,000 × 10.50 / 1,000,000 = $0.12600 USDC
StrataCodingAgent-Fast = 12,000 × 10.00 / 1,000,000 = $0.12000 USDC

09 Troubleshooting

Symptom
Fix
no_peer_pinned
Run antseed buyer connection set --peer 6f9b…befe, then retry.
Model not found
Run curl -s http://localhost:8377/v1/models | jq and confirm StrataCodingAgent appears. Also confirm the StrataCode peer is online.
Payment or 402 errors
Open antseed payments at http://localhost:3118 and confirm USDC is deposited and available.
Tool asks for an API key
Use a placeholder such as antseed. The local proxy handles protocol authentication and payments.
Codex still uses OpenAI
Use antseed codex --model StrataCodingAgent. Verify through the buyer dashboard rather than lsof or Codex logs.
Stale buyer state
Use a separate data directory with --data-dir or ANTSEED_DATA_DIR for each independent buyer process.

10 Security & privacy notes

  • The buyer identity key should be backed up. Losing it can mean losing access to the node identity and related on-chain funds.
  • For production, provide ANTSEED_IDENTITY_HEX through a secrets manager instead of relying on a plaintext identity.key file.
  • AntSeed transport is peer-to-peer, but standard providers process the prompt to answer it. Do not send secrets unless you trust the provider and the route.
  • Funding wallets and node identities can be separated by depositing on behalf of the buyer identity through the payments portal.
  • Use a dedicated buyer data directory for separate test environments or concurrent buyer processes.

11 Reference links