Use the local buyer proxy (no gateway)
The local buyer proxy is the part of Antseed that finds sellers and pays them. It serves an OpenAI- and Anthropic-compatible API on http://localhost:8377, bound to 127.0.0.1 only, with no API keys, budgets or usage logs.
Use the gateway instead. It puts API keys, spend limits, routing policies and logs in front of the same buyer. See Gateway API.
Start the buyer
The desktop app runs the buyer for you while its router is on. Without the desktop app:
npm install -g @antseed/cli
antseed buyer start
antseed buyer start works without a config file, using built-in defaults (port 8377). Free models work right away. For paid models, run antseed buyer deposit to get a funding address for USDC on Base.
Base URLs:
- OpenAI-compatible clients:
http://localhost:8377/v1 - Anthropic clients:
http://localhost:8377(they add/v1/messagesthemselves)
The proxy does not check API keys. If a client insists on one, use any non-empty placeholder such as antseed.
curl http://localhost:8377/v1/chat/completions \
-H 'content-type: application/json' \
-d '{
"model": "<peerId>@deepseek-v4-flash",
"messages": [{"role": "user", "content": "Hello"}]
}'
Endpoints
| Endpoint | Format |
|---|---|
POST /v1/chat/completions | OpenAI Chat Completions |
POST /v1/responses | OpenAI Responses (Codex) |
POST /v1/messages | Anthropic Messages (Claude Code) |
POST /v1/messages/count_tokens | Anthropic token counting, answered locally, never routed or billed |
POST /v1/images/generations | OpenAI image generation |
POST /v1/images/edits | OpenAI image editing (multipart) |
POST /v1/systemone | Typed questions to decision models; see the decisions skill |
POST /api/v1/video/queue, POST /api/v1/video/retrieve | Venice-format video jobs |
POST /fal/v1/video/queue, POST /fal/v1/video/retrieve | fal-format video jobs, with the fal endpoint id as model |
GET /v1/models, GET /v1/models/<id> | Network-wide model catalog, answered locally and free. Filter with ?type=text, images, videos or decisions |
Your tool's format does not need to match the seller's. The proxy translates between Anthropic Messages, OpenAI Chat Completions and OpenAI Responses when needed. Image endpoints are never translated: the seller must serve openai-images.
For video and image pricing, see Media billing. For how /v1/models ranks offers, see Routing and catalog.
Video jobs
# Queue a job; the response includes a queue_id
curl http://localhost:8377/api/v1/video/queue \
-H 'content-type: application/json' \
-d '{"model": "<peerId>@<video-model>", "prompt": "A tiny ant carrying a seed", "duration": "5s"}'
# Poll until the response is video/mp4 instead of a JSON status
curl http://localhost:8377/api/v1/video/retrieve \
-H 'content-type: application/json' \
-d '{"model": "<peerId>@<video-model>", "queue_id": "<queue_id>"}' -o result.out
Retrieve requests always go to the seller that accepted the job. You pay once, when the finished MP4 is delivered, and the buyer refuses videos priced above $5.00.
Choose the model and seller
The model field controls routing:
| Value | Routing |
|---|---|
<peerId>@deepseek-v4-flash | Pins this request to one seller. No failover. |
deepseek-v4-flash | Automatic routing: the buyer picks the cheapest seller of that model that passes your minimum trust score, and fails over after retryable errors. See Routing and catalog. |
antseed | Follows the model or seller picked in the desktop app. Returns no_default_route when the app has no selection. |
The peer id is 40 hex characters, with or without 0x. The prefix is stripped before the request reaches the seller.
You can also pin outside the model field:
| Mechanism | Scope |
|---|---|
Header x-antseed-pin-peer: <peerId> | One request. Use it for multipart /v1/images/edits, where the model prefix is not rewritten. |
antseed buyer connection set --peer <peerId> | Every request until antseed buyer connection clear. Survives a buyer restart. |
When several apply, the header wins, then the model prefix, then the session pin.
antseed network browse # peers, services and prices
antseed network browse --service deepseek # filter by service
antseed network peer <peerId> # one peer in detail
curl -s http://localhost:8377/v1/models | jq '.data[].id'
Tools
-
Desktop app: connect Claude Code, Codex, OpenCode and others from Connected apps. See Desktop app.
-
CLI wrappers:
antseed claude,antseed codexandantseed opencodelaunch the tool against the running buyer and pass your other flags through:Terminalantseed claude --model <peerId>@kimi-k2.6
antseed codex --model <peerId>@deepseek-v4-flash
antseed opencode --model <peerId>@gpt-oss-120b -
antseed appsconnects local tools by editing their config files. -
Manual: set the base URL above and a placeholder key, for example
ANTHROPIC_BASE_URL=http://localhost:8377andANTHROPIC_API_KEY=antseedfor Claude Code.
Tool-specific guides are in the Integrations directory. For Hermes and OpenClaw, see Connect agents.
Response headers
Non-streaming responses carry telemetry headers:
| Header | Value |
|---|---|
x-antseed-request-id | Request id |
x-antseed-peer-id | Seller that served the request |
x-antseed-provider, x-antseed-service | Seller's provider plugin and service id |
x-antseed-input-tokens, x-antseed-cached-input-tokens, x-antseed-output-tokens, x-antseed-total-tokens | Token counts |
x-antseed-token-source | Where the counts came from |
x-antseed-estimated-cost-usd | Estimated cost |
x-antseed-input-usd-per-million, x-antseed-output-usd-per-million, x-antseed-cached-input-usd-per-million | Seller's advertised prices |
x-antseed-latency-ms | Latency |
x-antseed-peer-reputation | Seller's reputation score |
Streaming responses carry only the request id, seller identity and price headers, because token counts are not known when headers are sent. For authoritative per-channel totals, run antseed buyer metering.
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | missing_routing_target | The request has no model and no pin. |
| 400 | no_default_route | model: "antseed" was sent but the desktop app has no model selected. |
| 402 | insufficient_deposits | Not enough USDC deposited. Run antseed buyer deposit. |
| 413 | upload_body_too_large | The request is larger than the seller's upload limit. |
| 502 | model_not_found | No seller your routing preferences allow offers this model. |
Diagnostics
The proxy serves a local control plane under /_antseed/ that the desktop app uses:
curl -s http://localhost:8377/_antseed/status # DHT node count, peer count, uptime
curl -s http://localhost:8377/_antseed/peers # cached peers with pricing and reputation
curl -s -X POST http://localhost:8377/_antseed/peers/refresh
curl -s http://localhost:8377/_antseed/channels # your open payment channels
For Prometheus metrics, see Metrics.
Run more than one buyer
Each buyer needs its own data directory. To pay from several wallets with one buyer, add buyer identities and pick one per request with the x-antseed-buyer-identity header; see Gateway API. Data directories, routing preferences and price caps are covered in Buyer configuration.