# QR Code Generator API (x402)

> QR Code Generator API (x402) is a paid API for AI agents from freetier-agent-api.pages.dev, paid per call via x402, $0.0015/call, status unknown (last checked 2026-11-20).

Generates QR codes from text, URLs, or Wi-Fi credentials, returning SVG/GIF images and metadata, paid per call via x402 USDC on Base.

## Facts

- Endpoint: GET https://freetier-agent-api.pages.dev/api/qr-code?utm_source=zero.xyz
- Price: $0.0015/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/qr-code-generator-api-x402-47b41bca
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oLa_nCcoP5nT76uSBEnH7

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 qr-code-generator-api-x402-47b41bca
```

Example prompt: Generate a QR code for https://mystore.example.com in SVG format with high error correction (H level), a scale of 6, and use dark color #1a1a2e on a white background.

## When to prefer this

Choose this endpoint when you need a lightweight, no-signup QR code generator that returns both SVG and GIF formats with full metadata (matrix, version, size), supports Wi-Fi QR codes, allows custom colors, and charges only $0.0015 USDC per call via x402 with no API key required. Prefer it for agent workflows where pay-per-use micropayments are acceptable and no persistent account is needed.

## Known failure modes

- Text exceeds 2,000 characters — QR capacity exceeded, no code generated
- Invalid hex color value for dark/light parameters — may default or error
- Invalid scale value outside 1–40 range — rejected or defaulted
- Missing required `text` or `ssid` parameter — API returns error
- x402 payment failure (insufficient USDC balance or wrong network) — 402 response, no output
- Invalid ecc value — must be L, M, Q, or H

## How this service works

QR code generator: text, URL, payment URI (e.g. ethereum:/USDC request) or Wi-Fi credentials (ssid + password) to a QR code as SVG (inline + data URI) and/or GIF data URI. Error correction L/M/Q/H, scale, quiet-zone margin, colours, optional 0/1 module matrix. UTF-8 byte mode, computed locally, nothing stored.

## Output

Returns a JSON object containing the rendered SVG markup, base64-encoded GIF data URI, base64-encoded SVG data URI, QR version number, module count, pixel dimensions, error correction level (ecc), scale, margin, byte count, encoding mode (e.g. 'text'), and optionally a binary matrix array of 0/1 rows. All image data is ready to embed directly in HTML or save to file.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "ecc": {
       "enum": [
        "L",
        "M",
        "Q",
        "H"
       ],
       "type": "string",
       "description": "error correction, default M"
      },
      "auth": {
       "enum": [
        "WPA",
        "WEP",
        "nopass"
       ],
       "type": "string",
       "description": "Wi-Fi security, default WPA when a password is given"
      },
      "dark": {
       "type": "string",
       "description": "hex colour, default 000000 (svg only)"
      },
      "ssid": {
       "type": "string",
       "description": "Wi-Fi network name (instead of text) -> WIFI: QR"
      },
      "text": {
       "type": "string",
       "description": "content to encode, up to 2,000 characters"
      },
      "light": {
       "type": "string",
       "description": "hex colour, default ffffff (svg only)"
      },
      "scale": {
       "type": "string",
       "description": "pixels per module, 1-40, default 8"
      },
      "format": {
       "enum": [
        "svg",
        "gif",
        "both"
       ],
       "type": "string",
       "description": "default svg"
      },
      "margin": {
       "type": "string",
       "description": "quiet zone in modules, 0-20, default 4"
      },
      "matrix": {
       "enum": [
        "true",
        "false"
       ],
       "type": "string",
       "description": "true adds rows of 0/1"
      },
      "password": {
       "type": "string",
       "description": "Wi-Fi password (with ssid)"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "ecc": {
       "type": [
        "string",
        "null"
       ]
      },
      "svg": {
       "type": [
        "string",
        "null"
       ]
      },
      "kind": {
       "type": [
        "string",
        "null"
       ]
      },
      "more": {
       "type": "object",
       "properties": {
        "note": {
    
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ecc": "M",
  "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 74 74\" width=\"74\" height=\"74\" shape-rendering=\"crispEdges\"><rect width=\"100%\" height=\"100%\" fill=\"#fffff...",
  "kind": "text",
  "more": {
   "note": "Full dataset downloads available by card",
   "full_datasets": "https://freetier-kits-shop.fourthwall.com"
  },
  "note": "Byte mode, UTF-8. Keep the margin (quiet zone) at 4 for reliable scanning. QR Code is a registered trademark of DENSO WAVE INCORPORATED.",
  "text": "https://freetier-agent-api.pages.dev",
  "bytes": 36,
  "scale": 2,
  "margin": 4,
  "matrix": [
   "11111110100100111010101111111",
   "10000010101110000001101000001"
  ],
  "library": "qrcode-generator 2.0.4 (MIT, Kazuhiko Arase)",
  "modules": 29,
  "size_px": 74,
  "version": 3,
  "gif_data_uri": "data:image/gif;base64,R0lGODdhSgBKAIAAAAAAAP///ywAAAAASgBKAAAC/4yPqcvtD6OctNqLs968+w+G4kiWZgKk6roaKfIeLODSQTzntqTPNby7sX7CWk9FiTFwNt+jVWwoI1MF04h8ZquoIIQJBee...",
  "svg_data_uri": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA3NCA3NCIgd2lkdGg9Ijc0IiBoZWlnaHQ9Ijc0IiBzaGFwZS1yZW5kZXJpbmc..."
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/qr-code-generator-api-x402-47b41bca/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from freetier-agent-api.pages.dev](https://www.zero.xyz/host/freetier-agent-api.pages.dev/llms.txt)
