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:
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.
# 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.
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:
antseed buyer connection set --peer 6f9b9e63d3f776d359eb2fb0a82d12ee496fbefe
Deposit USDC through the local payments portal:
antseed payments # Opens http://localhost:3118 # Connect a funded wallet on Base mainnet, approve USDC, and deposit.
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.
# 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:
# 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.
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
6.1 — OpenAI Chat Completions (cURL)
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)
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)
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)
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)
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)
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:
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.
model = "StrataCodingAgent" model_provider = "antseed" [model_providers.antseed] name = "AntSeed" base_url = "http://localhost:8377/v1" wire_api = "responses"
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.
export ANTHROPIC_BASE_URL=http://localhost:8377 claude
7.3 — Generic OpenAI-compatible tools
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:
requestCostUSD = totalTokens * agentUsdPerMillion / 1_000_000
# Flat per-token rate per agent — input and output tokens are priced the same.
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
no_peer_pinnedantseed buyer connection set --peer 6f9b…befe, then retry.curl -s http://localhost:8377/v1/models | jq and confirm StrataCodingAgent appears. Also confirm the StrataCode peer is online.antseed payments at http://localhost:3118 and confirm USDC is deposited and available.antseed. The local proxy handles protocol authentication and payments.antseed codex --model StrataCodingAgent. Verify through the buyer dashboard rather than lsof or Codex logs.--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_HEXthrough a secrets manager instead of relying on a plaintextidentity.keyfile. - 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.