# QR Code Generator (SVG)

> QR Code Generator (SVG) is a paid API for AI agents from x402-gateway.blackwoodstate8.workers.dev, paid per call via x402, $0.004/call, status unknown (last checked 2026-10-22).

Generates a QR code as SVG markup and data URL from a text string or URL, with configurable error correction and border settings

## Facts

- Endpoint: POST https://x402-gateway.blackwoodstate8.workers.dev/v1/qr-code?utm_source=zero.xyz
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/qr-code-generator-svg-110561d8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gajA3Fe51da2toSdOT5v_

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-svg-110561d8 -d '<json body>'
```

Example prompt: Generate a QR code SVG for https://example.com with high error correction (H) and a border of 3 modules.

## When to prefer this

Choose this endpoint when you need a QR code returned as an SVG (not PNG or other raster format) and do not require logos, color customization, or decoding of existing QR codes. It is ideal for programmatic embedding in web pages, PDFs, or print assets where vector format is preferred.

## Known failure modes

- Text exceeds 2000 characters — request rejected with validation error
- Invalid error correction level enum value — rejected
- pixelSize or border out of allowed range — rejected
- Empty or missing text field — rejected
- Payment not authorized or insufficient USDC balance — payment failure

## How this service works

Use when you need a qr code generator for a URL, text, Wi-Fi or payment link as an SVG image. Do not use for reading or decoding an existing QR code, logos, colored codes or PNG output. Returns JSON with a QR code for your text or URL as SVG markup and an SVG data URL, with error correction level and border options, generated by the uqr library for 0.004 USDC per call. Typical response time 500 ms (p95). Category: Media.

## Output

Returns a JSON object containing the full SVG markup of the QR code, an SVG data URL suitable for embedding in HTML or CSS, the QR version number, the number of modules, the error correction level used, and the byte size of the encoded data.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "ecc": {
       "enum": [
        "L",
        "M",
        "Q",
        "H"
       ],
       "type": "string",
       "description": "Error correction level: L 7%, M 15% (default), Q 25%, H 30%"
      },
      "text": {
       "type": "string",
       "maxLength": 2000,
       "minLength": 1,
       "description": "Text or URL to encode, e.g. https://example.com (up to 2000 characters)"
      },
      "border": {
       "type": "integer",
       "maximum": 10,
       "minimum": 0,
       "description": "Quiet zone around the code, in modules (default 2)"
      },
      "pixelSize": {
       "type": "integer",
       "maximum": 20,
       "minimum": 1,
       "description": "SVG units per module (default 10)"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "svg",
      "dataUrl",
      "version",
      "modules",
      "ecc",
      "bytes"
     ],
     "properties": {
      "ecc": {
       "type": "string"
      },
      "svg": {
       "type": "string"
      },
      "next": {
       "type": "object",
       "required": [
        "service",
        "tool",
        "method",
        "url",
        "useWhen",
        "sample"
       ],
       "properties": {
        "url": {
         "type": "string",
         "description": "Paid route of the next call"
        },
        "tool": {
         "type": "string",
         "description": "MCP tool name of the same call"
        },
        "method": {
         "enum": [
          "GET",
          "POST"
         ],
         "type": "string"
        },
        "sample": {
         "type": "string",
         "description": "Free fixed sample of the whole family"
        },
        "service": {
  
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ecc": "M",
  "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 370 370\"><r...(10900 characters)",
  "bytes": 10900,
  "dataUrl": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcm...(14562 characters)",
  "modules": 37,
  "version": 4
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/qr-code-generator-svg-110561d8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-gateway.blackwoodstate8.workers.dev](https://www.zero.xyz/host/x402-gateway.blackwoodstate8.workers.dev/llms.txt)
