# XFuel [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/XFuel-Lab/xfuel-protocol  
**GitHub Stars:** 1  
**npm Downloads (last month):** 1753048  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/xfuel

## Description
Submit AI inference to XFuel, pay per task (USDC via x402 or TFUEL), fetch/verify ZK proofs.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "xfuel": {
    "command": "npx",
    "args": ["-y","hardhat"]
  }
}
```

## Documentation & README

# Chit402

Chit402 is the book. This agent spent Y on this job. You hold hub, model, and amount.

`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. Register is fail-closed: a collected HMAC-valid receipt plus an AAWP official or smart-account `agentWallet`.

To learn more about the protocol design, read the [whitepaper](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/WHITEPAPER.md). For live endpoints and what is real vs mock today, see [runtime state](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/docs/RUNTIME_STATE.md). Full documentation hub: [docs/](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/docs/README.md).

**Live app:** https://chit402.com  
**Public API:** https://api.chit402.com

## Table of Contents

- [Setup](#setup)
- [Using the API](#using-the-api)
- [Agent toolkit](#agent-toolkit)
- [Documentation](#documentation)
- [Security](#security)

## Setup

### Prerequisites

Install **Node.js 20+** and **npm 10+**. A Rust toolchain is required if you build CosmWasm, SP1, or zkLLM crates.

### Build and test

Clone the repository, install dependencies, compile contracts, and run the test suite:

```bash
git clone https://github.com/XFuel-Lab/chit402.git
cd chit402
npm install
npx hardhat compile
npx hardhat test
```

### Agent gateway

The agent-facing API (settlement, payments, proving, receipts) runs from `services/gateway`:

```bash
cd services/gateway
npm install
npm run m2m-server
```

The gateway listens on `http://localhost:3002` by default. Env examples live under `services/gateway/`. Production layout is documented in [runtime state](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/docs/RUNTIME_STATE.md).

### Website

```bash
cd apps/web
npm install
npm run dev
```

## Try the paid door

No account. No API key. A wallet that can pay the 402 is enough. Register is only to hold the book after a collected receipt.

```bash
curl.exe -sS -D - -X POST https://api.chit402.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{}'
```

Unauthenticated `/v1` returns HTTP 402 with payment requirements (USDC on Base or Solana). The receipt prices the next call. Working copy: [docs/DESIGN_PARTNER_ONBOARDING.md](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/docs/DESIGN_PARTNER_ONBOARDING.md).

```
npm install chit402-sdk
npx chit402-mcp
```

`flagship-demo.ts` is the **paid** `/task-request` path (402 without a payer). Do not start there.

- TypeScript SDK — [packages/sdk](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/packages/sdk/README.md)
- MCP server — [packages/mcp](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/packages/mcp/README.md)
- Agent playbook — [packages/agent-skills](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/packages/agent-skills/AGENT_PLAYBOOK.md)

**Windows note:** if you use raw HTTP, call `curl.exe` — PowerShell’s `curl` is not real curl.

API reference: [M2M API](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/docs/M2M_API.md) · Chat completions: [docs here](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/docs/CHAT_COMPLETIONS_GATEWAY.md) · Payments: [x402 adapter](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/docs/X402_ADAPTER.md).

## Documentation

| Doc | Description |
|-----|-------------|
| [WHITEPAPER.md](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/WHITEPAPER.md) | Protocol design |
| [docs/README.md](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/docs/README.md) | Documentation hub |
| [docs/RUNTIME_STATE.md](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/docs/RUNTIME_STATE.md) | As-deployed state |
| [docs/POSITIONING.md](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/docs/POSITIONING.md) | Messaging |
| [docs/DEPLOYMENT.md](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/docs/DEPLOYMENT.md) | Deployment |
| [docs/TESTING.md](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/docs/TESTING.md) | Tests |
| [AGENTS.md](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/AGENTS.md) | Agent / LLM index |
| [CONTRIBUTING.md](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/CONTRIBUTING.md) | Contributing |

## Security

Responsible disclosure (safe harbour; no cash bounty until the first audit): [docs/bug-bounty.md](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/docs/bug-bounty.md).  
Reporting policy: [SECURITY.md](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/SECURITY.md).

---

Apache-2.0 — see [LICENSE](https://github.com/XFuel-Lab/xfuel-protocol/blob/HEAD/LICENSE).

