{
  "markdown": "# Chit402\n\nChit402 is the book. This agent spent Y on this job. You hold hub, model, and amount.\n\n`POST /v1/chat/completions` returns a signed receipt: hub, model, amount, verify_url. Cost-plus, quoted, receipted — pay USDC on Base or Solana. `GET|POST /v1/agents/:agent_id/book` is possession-gated last-N collected spend. Signed receipt is table stakes (HMAC); SP1 settlement proof is on demand. The product is the collected row — sidecar + ingest if you already pay a provider; without a collected USDC `payment.ref` the receipt is client-attested only. Demo key `chit402-demo` skips payment (rate-limited). Register is fail-closed: a collected HMAC-valid receipt plus an AAWP official or smart-account `agentWallet`.\n\nTo learn more about the protocol design, read the [whitepaper](WHITEPAPER.md). For live endpoints and what is real vs mock today, see [runtime state](docs/RUNTIME_STATE.md). Full documentation hub: [docs/](docs/README.md).\n\n**Live app:** https://chit402.com  \n**Public API:** https://api.chit402.com\n\n## Table of Contents\n\n- [Setup](#setup)\n- [Using the API](#using-the-api)\n- [Agent toolkit](#agent-toolkit)\n- [Documentation](#documentation)\n- [Security](#security)\n\n## Setup\n\n### Prerequisites\n\nInstall **Node.js 20+** and **npm 10+**. A Rust toolchain is required if you build CosmWasm, SP1, or zkLLM crates.\n\n### Build and test\n\nClone the repository, install dependencies, compile contracts, and run the test suite:\n\n```bash\ngit clone https://github.com/XFuel-Lab/chit402.git\ncd chit402\nnpm install\nnpx hardhat compile\nnpx hardhat test\n```\n\n### Agent gateway\n\nThe agent-facing API (routing, payments, proving, receipts) runs from `services/gateway`:\n\n```bash\ncd services/gateway\nnpm install\nnpm run m2m-server\n```\n\nThe gateway listens on `http://localhost:3002` by default. Env examples live under `services/gateway/`. Production layout is documented in [runtime state](docs/RUNTIME_STATE.md).\n\n### Website\n\n```bash\ncd apps/web\nnpm install\nnpm run dev\n```\n\n## Try the demo\n\nNo account. No API key. A wallet that can pay the 402 is enough. Register is only to hold the book after a collected receipt.\n\n```bash\ncurl.exe -sS -D - -X POST https://api.chit402.com/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -d '{}'\n```\n\nUnauthenticated `/v1` returns HTTP 402 with payment requirements (USDC on Base or Solana). The receipt prices the next call. Demo key `chit402-demo` skips payment (rate-limited). Working copy: [docs/DESIGN_PARTNER_ONBOARDING.md](docs/DESIGN_PARTNER_ONBOARDING.md).\n\n```\nnpm install chit402-sdk\nnpx chit402-mcp\n```\n\n`flagship-demo.ts` is the **paid** `/task-request` path (402 without a payer). Do not start there.\n\n- TypeScript SDK — [packages/sdk](packages/sdk/README.md)\n- MCP server — [packages/mcp](packages/mcp/README.md)\n- Agent playbook — [packages/agent-skills](packages/agent-skills/AGENT_PLAYBOOK.md)\n\n**Windows note:** if you use raw HTTP, call `curl.exe` — PowerShell’s `curl` is not real curl.\n\nAPI reference: [M2M API](docs/M2M_API.md) · Chat completions: [docs here](docs/CHAT_COMPLETIONS_GATEWAY.md) · Payments: [x402 adapter](docs/X402_ADAPTER.md).\n\n## Documentation\n\n| Doc | Description |\n|-----|-------------|\n| [WHITEPAPER.md](WHITEPAPER.md) | Protocol design |\n| [docs/README.md](docs/README.md) | Documentation hub |\n| [docs/RUNTIME_STATE.md](docs/RUNTIME_STATE.md) | As-deployed state |\n| [docs/POSITIONING.md](docs/POSITIONING.md) | Messaging |\n| [docs/DEPLOYMENT.md](docs/DEPLOYMENT.md) | Deployment |\n| [docs/TESTING.md](docs/TESTING.md) | Tests |\n| [AGENTS.md](AGENTS.md) | Agent / LLM index |\n| [CONTRIBUTING.md](CONTRIBUTING.md) | Contributing |\n\n## Security\n\nResponsible disclosure (safe harbour; no cash bounty until the first audit): [docs/bug-bounty.md](docs/bug-bounty.md).  \nReporting policy: [SECURITY.md](SECURITY.md).\n\n---\n\nApache-2.0 — see [LICENSE](LICENSE).\n",
  "bytes": 3861,
  "sha": "7242b080dbf967c5ebb874df7e1a6c33182bc6c0763f0e4bda0429ca538bda9b",
  "repo_slug": "xfuel-lab/xfuel-protocol",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_xfuel_lab_xfuel_mcp_54111332/readme"
}