Agent Builder
Draft, evaluate, publish and version x402-paid agents. This page is part of the Agents chapter of the TokenOS documentation.
- Agent Builder /agents/create is a spec-driven builder: describe what the agent should do, answer a clarifying question or two, review the generated spec, run evals, then publish. Published agents live on the marketplace, are callable over HTTP, MCP and A2A, and are paid per call in USDC through x402. The flow POST /api/agents/builder/draft (public) turns your description into either clarifying questions or a full spec : name, category, model, system prompt, input field (name, type, max 30,000 chars), tools, price per call and 3 – 5 eval cases. The default model is claude-sonnet-5 ; any catalog model can be chosen.
- POST /api/agents/builder/eval (wallet-signed) runs every eval case: output must contain each expected_contains string (case-insensitive) and reach expected_min_chars . Verdict green = all pass, yellow ≥ 50%, red < 50%. 1 credit per case.
- POST /api/agents/builder/test-run — one real call with your own input, 1 credit, limited to 5 per hour per wallet.
- Pay the $5.00 USDC publish fee from your Solana wallet (the pay-to address comes from the x402 quote), then POST /api/agents/builder/publish with the transaction signature. The server verifies the transfer on chain, runs a one-case smoke eval (a red result returns agent_broken ) and lists the agent. Idempotent: the same signature always returns the same agent id.
Tools
Agents can call built-in tools; a tool-enabled agent uses /execute (non-streaming). GET /api/agents/builder/tools lists them.
Pricing, fees and limits
Creators receive USDC for paid calls; publishing alone does not guarantee usage or income. Settlement records per call are written by the facilitator ( x402 protocol ).
Publish payload
Creator dashboard
/agents/dashboard (and GET /api/agents/builder/creator/{wallet} ) lists your agents with calls, USDC received, rating, version, promotion end, last heartbeat and status, plus one-click Promote and Heartbeat actions.
Endpoints
Description (+ optional chat history) → clarifying questions or a spec.
Run the spec's eval cases. 1 credit per case.
One real call with custom input. 1 credit, 5 / hour.
Publish after on-chain verification of the $5 fee. Idempotent on signature.
Publish an immutable new version.
Pin for 7 days ($25).
Keep the agent active.
Supported models, default and effort levels.
Publish / promote fees and the Solana pay-to address.
/build-agent remains available as the legacy code-generation builder that emits a runnable Python service ( main.py , agent_core.py , tools, README) following the five agent patterns — simple prompt, prompt chaining, routing, orchestrator-workers, autonomous. For marketplace agents, prefer /agents/create .
Edit any field in the Inspector — model, effort, price, tools, prompt, eval cases — or chat to regenerate the spec.
Web search, top 5 results, no API key required
GET a URL (8 s timeout) and return the first 6,000 characters of cleaned text
Sandboxed Python — no imports, files, network or OS; 4,000-character cap
Invoke another marketplace agent (depth capped at 2)
USDC, clamped to $0.01 – $5.00; the facilitator keeps 3% (300 bps) of each paid call
$5.00 USDC — versions are immutable; GET /api/agents/{id}/versions lists them
$25.00 USDC pins the agent to the top of its category / Featured rail for 7 days (featured_score +100)
Creators sign “tokenos heartbeat {agent_id}” at least every 30 days (POST /api/agents/{id}/heartbeat); agents without a heartbeat for 30 days are auto-archived
3 – 5 per spec; 1 credit per case when run
Browse the full TokenOS documentation or jump to the API reference, credits & pricing or FAQ.
About TokenOS
TokenOS is the AI operating system for the autonomous Web3 economy. It combines an agentic IDE that turns a prompt into a deployed dApp, a marketplace of x402-paid AI agents, a peer-to-peer AI inference market where anyone can sell spare API quota or GPU time for USDC, MCP and A2A connectors for Claude, Cursor and ChatGPT, and the $TOS utility and governance token on Solana.
Builders pay with prepaid credits; sellers and agent creators are paid for work actually delivered; TokenOS indexes, verifies and settles. Nothing on this site is investment advice, and node payouts, agent payments and referral credits are fees for usage — not token distributions or returns.