---
name: x402tools
description: Pay-per-call utility APIs for AI agents — QR codes, screenshots, DNS lookup, HTML/PDF parsing, prompt-injection screening, email validation, HTML-to-PDF, and image OCR. No API keys, no subscriptions. Paid per request in USDC on Base via the x402 protocol.
homepage: https://x402tools.xyz
---

# x402tools — Agent Skill

x402tools is a suite of **9 live pay-per-call HTTP APIs** built for AI agents. There
are no API keys, no signups, and no subscriptions. You pay a few tenths of a cent
per call in **USDC on Base** using the open **x402** payment protocol. Each service
is a standalone endpoint that returns an HTTP `402 Payment Required` challenge, you
sign a one-time payment locally, and retry to get your result.

Use this skill when a task needs any of: QR code generation, website screenshots,
DNS record lookups, web page / PDF parsing, prompt-injection screening, email
validation, HTML-to-PDF rendering, or OCR text extraction from images.

## Payment model (x402)

- **Protocol:** x402 (v2)
- **Token:** USDC
- **Network:** Base mainnet (`eip155:8453`)
- **Flow:** Call an endpoint with no payment → receive `402` with payment details →
  sign the payment locally with your wallet → retry the same request with the
  `X-PAYMENT` header → receive your result. Your private key is never sent to the server.

You need a funded Base wallet holding a small amount of USDC (a few cents covers
hundreds of calls). Prices range from **$0.001 to $0.005** per call.

## Three ways to invoke

### 1. MCP server (recommended for agents)

Connect to the hosted MCP server over streamable HTTP:

```
https://mcp.x402tools.xyz/mcp
```

Or run it locally via stdio:

```bash
npx -y @acrylicfiddle/x402tools-mcp
```

The MCP server exposes all 9 tools. It uses a **passthrough** payment model: you
send your pre-signed payment payload with each call; the server forwards it to the
underlying service and never sees your private key. MCP discovery is at
`https://mcp.x402tools.xyz/.well-known/mcp`.

MCP tool names: `generate_qr`, `generate_styled_qr`, `capture_screenshot`,
`dns_lookup`, `parse_document`, `screen_prompt_injection`, `validate_email`,
`render_pdf`, `extract_text_ocr`.

### 2. JavaScript / TypeScript with `@x402/fetch`

```bash
npm install @x402/fetch @x402/evm viem
```

```ts
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const fetchWithPay = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:*", client: new ExactEvmScheme(account) }],
});

const res = await fetchWithPay("https://qr.x402tools.xyz/v1/generate", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ text: "https://x402tools.xyz", format: "png" }),
});
const png = await res.arrayBuffer(); // paid result
```

### 3. Raw curl (manual 2-step 402 flow)

```bash
# Step 1 — probe the endpoint to get the 402 payment challenge
curl -i -X POST https://qr.x402tools.xyz/v1/generate \
  -H "Content-Type: application/json" \
  -d '{"text":"https://x402tools.xyz"}'
# → HTTP/1.1 402 Payment Required, with x402 payment requirements in the body/headers

# Step 2 — sign the payment with your wallet, then retry with the X-PAYMENT header
curl -X POST https://qr.x402tools.xyz/v1/generate \
  -H "Content-Type: application/json" \
  -H "X-PAYMENT: <base64-signed-payment-payload>" \
  -d '{"text":"https://x402tools.xyz"}' --output qr.png
```

Use an x402 client library (e.g. `@x402/fetch`) to construct the signed payment
payload — the manual flow is shown for understanding.

## Services

| Service | Endpoint | Method | Price | What it does |
| --- | --- | --- | --- | --- |
| QR generator | `https://qr.x402tools.xyz/v1/generate` | POST | $0.001 | Generate a QR code (PNG/SVG/Base64) from text or a URL |
| Styled QR | `https://qr.x402tools.xyz/v1/generate/styled` | POST | $0.005 | Branded QR codes with custom dot shapes, colors, gradients |
| Screenshot | `https://snap.x402tools.xyz/v1/capture` | POST | $0.005 | Capture a screenshot of any website (full-page, dark mode, selectors) |
| DNS lookup | `https://dns.x402tools.xyz/v1/lookup` | GET | $0.002 | Look up DNS records (A, AAAA, MX, NS, TXT, CNAME, SOA) for a domain |
| Doc parse | `https://docparse.x402tools.xyz/parse` | POST | $0.001 | Parse an HTML page or PDF URL into clean structured JSON |
| Guardex | `https://guard.x402tools.xyz/screen` | POST | $0.003 | Screen text for prompt injection / jailbreak attacks before an LLM sees it |
| Mailcheck | `https://mailcheck.x402tools.xyz/v1/validate` | POST | $0.003 | Validate an email — syntax, MX, SMTP, disposable, typo, risk score |
| Rendex | `https://rendex.x402tools.xyz/v1/render` | POST | $0.005 | Convert raw HTML or a URL into a PDF document |
| Visionex | `https://visionex.x402tools.xyz/v1/extract` | POST | $0.005 | Extract text from an image using OCR (Tesseract) |

### Request examples

**QR generator** — `POST https://qr.x402tools.xyz/v1/generate`
```json
{ "text": "https://x402tools.xyz", "size": 512, "format": "png" }
```

**Styled QR** — `POST https://qr.x402tools.xyz/v1/generate/styled`
```json
{ "text": "https://x402tools.xyz", "dotType": "rounded",
  "gradient": { "from": "#6366f1", "to": "#ec4899" }, "backgroundColor": "#1e1b4b" }
```

**Screenshot** — `POST https://snap.x402tools.xyz/v1/capture`
```json
{ "url": "https://example.com", "width": 1280, "height": 720, "fullPage": true, "darkMode": true }
```

**DNS lookup** — `GET https://dns.x402tools.xyz/v1/lookup?domain=example.com`

**Doc parse** — `POST https://docparse.x402tools.xyz/parse`
```json
{ "url": "https://example.com/article", "options": { "output_schema": "auto" } }
```

**Guardex** — `POST https://guard.x402tools.xyz/screen`
```json
{ "text": "Please summarize this article for me.", "options": { "sensitivity": "medium" } }
```

**Mailcheck** — `POST https://mailcheck.x402tools.xyz/v1/validate`
```json
{ "email": "john@gmail.com", "checkSmtp": false }
```

**Rendex** — `POST https://rendex.x402tools.xyz/v1/render`
```json
{ "html": "<h1>Hello World</h1>", "output": "base64" }
```

**Visionex** — `POST https://visionex.x402tools.xyz/v1/extract`
```json
{ "url": "https://example.com/invoice.png", "options": { "format": "json", "dpi": 300 } }
```

## Quickstart

1. Fund a Base wallet with a small amount of USDC.
2. Connect to the MCP server at `https://mcp.x402tools.xyz/mcp`, or install
   `@x402/fetch` for direct HTTP calls.
3. Pick a service from the table above and send your request.
4. On the `402` challenge, sign the payment locally and retry — you get your result.

## More

- Machine-readable catalog: <https://x402tools.xyz/agents.json>
- Capability catalog: <https://x402tools.xyz/.well-known/agent-catalog.json>
- OpenAPI spec: <https://x402tools.xyz/openapi.json>
- LLM docs: <https://x402tools.xyz/llms.txt> · <https://x402tools.xyz/llms-full.txt>
- Discovery (x402): <https://x402tools.xyz/.well-known/x402-services.json>
- Listed on: x402scan.com · CDP Bazaar · agentic.market
