# 402utils QR Code Generator

> 402utils QR Code Generator is a paid API for AI agents from 402utils.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Generates a QR code as PNG or SVG from any text or URL, with configurable size, error-correction level, and colors.

## Facts

- Endpoint: POST https://402utils.com/v1/qr
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/402utils-qr-code-generator-2bb57c38
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qNcgEkA2-n2wGtTKNJIcI

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability 402utils-qr-code-generator-2bb57c38 -d '<json body>'
```

Example prompt: Generate a 512px PNG QR code for https://myshop.example.com using high error-correction (H level), with a dark blue foreground (#003366) on a white background.

## When to prefer this

Use this endpoint when you need to programmatically generate a QR code image (PNG or SVG) from a URL or text string, especially when you need fine-grained control over error-correction level, image size, and custom colors. It is a simple, stateless, pay-per-call endpoint with no logo overlay support — ideal for automation pipelines that need reliable, scannable QR codes without dependencies on a hosted dashboard.

## Known failure modes

- Input data exceeds 2 KB limit — returns an error about data length
- Invalid hex color format for fg/bg — returns a validation error
- Requested size outside 128–1024px range — returns a validation error
- Invalid ecLevel value (not L/M/Q/H) — returns a validation error
- Payment not provided or insufficient — returns HTTP 402

## How this service works

Generate a QR code as PNG or SVG from any text or URL. Pick the size, error-correction level (L/M/Q/H) and foreground/background colours; a 4-module quiet zone is always included so it scans reliably. Returns the raw image bytes. No logo overlay (compositing is out of scope).

## Output

Raw image bytes of the generated QR code in the requested format (PNG or SVG), ready for display or embedding. The image always includes a 4-module quiet zone for reliable scanning.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "bg": {
   "type": "string",
   "description": "Background hex colour (default #ffffff)."
  },
  "fg": {
   "type": "string",
   "description": "Foreground hex colour (default #000000)."
  },
  "data": {
   "type": "string",
   "description": "Text or URL to encode (max 2 KB)."
  },
  "size": {
   "type": "integer",
   "default": 512,
   "maximum": 1024,
   "minimum": 128,
   "description": "Output size in px."
  },
  "format": {
   "enum": [
    "png",
    "svg"
   ],
   "type": "string",
   "default": "png"
  },
  "ecLevel": {
   "enum": [
    "L",
    "M",
    "Q",
    "H"
   ],
   "type": "string",
   "default": "M",
   "description": "Error-correction level."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": "<binary image/png stream>"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/402utils-qr-code-generator-2bb57c38/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402utils.com](https://www.zero.xyz/host/402utils.com/llms.txt)
