> ## Documentation Index
> Fetch the complete documentation index at: https://clawmind.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> The small set of ClawMind endpoints you need to run an analysis, poll results, and verify 0G receipts.

# API Reference

ClawMind's API has one main flow:

```text theme={null}
POST /api/analyze -> GET /api/status?taskId=... -> GET /api/verify
```

Use `https://clawmind-puce.vercel.app` for the production app. Use `http://localhost:3000` when self-hosting locally.

<Note>
  Use `/stats` for the public telemetry dashboard. Use `/api/judge` when you need the same live evidence as JSON.
</Note>

***

## Main Flow

### 1. Start an analysis

```bash theme={null}
curl -X POST https://clawmind-puce.vercel.app/api/analyze \
  -H "Content-Type: application/json" \
  -d '{"task":"Review a self-custodial trading agent with private key storage and no withdrawal guards."}'
```

Response:

```json theme={null}
{
  "taskId": "YOUR_TASK_ID",
  "status": "running",
  "source": "web"
}
```

The pipeline runs in the background. Save `taskId`.

### 2. Poll the result

```bash theme={null}
curl "https://clawmind-puce.vercel.app/api/status?taskId=YOUR_TASK_ID"
```

When complete, the response contains:

| Field                   | Meaning                                                       |
| ----------------------- | ------------------------------------------------------------- |
| `result.report`         | Final score, recommendation, risks, evidence, and next steps. |
| `result.receipt`        | 0G Storage hash and `0g://` report URI.                       |
| `result.onChainReceipt` | 0G Chain transaction, registry mode, and signature status.    |

### 3. Verify the latest on-chain proof

```bash theme={null}
curl https://clawmind-puce.vercel.app/api/verify
```

Expected production signals:

```json theme={null}
{
  "verified": true,
  "onChain": {
    "registryMode": "SIGNED_OPERATOR",
    "signatureVerified": true
  }
}
```

***

## Endpoint Cheatsheet

| Endpoint                                 | Use it for                                            |
| ---------------------------------------- | ----------------------------------------------------- |
| `POST /api/analyze`                      | Start the 8-step analysis pipeline.                   |
| `GET /api/status?taskId=...`             | Poll progress and fetch the completed report.         |
| `GET /api/status`                        | Check app infrastructure status.                      |
| `GET /api/judge`                         | Get one public proof payload for demos and judges.    |
| `GET /api/verify`                        | Check the latest on-chain anchor.                     |
| `POST /api/report/retrieve`              | Retrieve a stored report by `0g://` URI or root hash. |
| `GET /api/openclaw/manifest`             | Get the OpenClaw YAML manifest.                       |
| `GET /api/openclaw/manifest?format=json` | Get parsed manifest plus live 0G evidence.            |

***

## Report Retrieval

Use this when you already have a report URI or root hash.

```bash theme={null}
curl -X POST https://clawmind-puce.vercel.app/api/report/retrieve \
  -H "Content-Type: application/json" \
  -d '{"storageUriOrRootHash":"0g://YOUR_ROOT_HASH"}'
```

The request body must contain `storageUriOrRootHash`.

***

## Judge Proof

For hackathon review or quick inspection:

```bash theme={null}
curl https://clawmind-puce.vercel.app/api/judge
```

This returns contract address, 0G Compute/Storage status, latest analysis, memory stats, critic metrics, and MCP usage in one response.

The same telemetry is rendered in the public dashboard at `https://clawmind-puce.vercel.app/stats`.

***

## MCP

The MCP server is separate from the main app:

```text theme={null}
https://clawmind-mcp.vercel.app/mcp
```

Clients must send:

```text theme={null}
X-MCP-Client-Id: demo-client
```

Available tools:

| Tool                   | Purpose                                          |
| ---------------------- | ------------------------------------------------ |
| `analyze_web3_project` | Runs the same ClawMind pipeline through the API. |
| `get_recent_analyses`  | Reads recent signed analyses from `/api/judge`.  |

<Note>
  Prefer `/mcp` for Streamable HTTP clients such as Claude Desktop and Cursor. `/sse` is available for older clients when Redis is configured on the MCP deployment. Full machine-readable schema lives in `api-reference/openapi.json`.
</Note>
