# QR Code Generator

> QR Code Generator is a paid API for AI agents from ZeroClick x402 Service Registry at qr.withzero.ai, paid per call via MPP, $0.001/call, status unknown (last checked 2026-10-11, last successful call 2026-07-09).

Generates a QR code from any text or URL, returning SVG markup and a base64 data URL for embedding, or a Unicode ASCII rendering.

## Facts

- Endpoint: POST https://qr.withzero.ai/run?utm_source=zero.xyz
- Price: $0.001/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-11
- Last successful call: 2026-07-09
- Success rate: 100% of calls made through Zero
- Rating: 4.8 / 5 from 2 reviews
- Activations on Zero: 8
- Provider: ZeroClick x402 Service Registry
- Website: https://withzero.ai
- Tags: utility, qr, qrcode, barcode, generate, image
- Canonical page: https://www.zero.xyz/c/zeroclick-x402-service-registry-qr-code-generator-8f36fce6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lgvUTc9mpSCsMqBLJB5mz

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 zeroclick-x402-service-registry-qr-code-generator-8f36fce6 -d '<json body>'
```

Example prompt: Generate a QR code for 'https://myshop.example.com/sale' at 512px, SVG format with high error correction (H), so I can embed it on a webpage.

## When to prefer this

Choose this endpoint when you need a pure-computation, serverless QR code with no external API dependencies, especially when you want an embeddable SVG/base64 output or a Unicode ASCII preview. Ideal for agents generating QR codes on the fly to embed in HTML, emails, or documents without needing a third-party QR service.

## Known failure modes

- Input 'data' field is empty or missing — returns validation error
- Input string exceeds 4296 characters — returns error for data too long
- Size out of range (below 32 or above 2048) — validation error
- Invalid enum value for format or errorCorrection — validation error

## How this service works

Generate QR codes from text, URLs, or any string data. Returns clean SVG output with a base64 data URL for easy embedding. Pure computation — no external API calls.

## Output

Returns an object with: 'svg' (the full SVG markup string), 'dataUrl' (a data:image/svg+xml;base64,... string ready to drop into an <img> src), 'ascii' (Unicode block-character rendering), and 'moduleCount' (number of QR modules per side). SVG and dataUrl are populated when format is 'svg'; ascii is populated when format is 'ascii'.

## Example request

```json
{
 "data": "https://example.com",
 "size": 256,
 "format": "svg",
 "errorCorrection": "M"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "data"
 ],
 "properties": {
  "data": {
   "type": "string",
   "maxLength": 4296,
   "minLength": 1,
   "description": "The text, URL, or string to encode as a QR code"
  },
  "size": {
   "type": "integer",
   "default": 256,
   "maximum": 2048,
   "minimum": 32,
   "description": "Pixel size of the SVG viewBox (default: 256)"
  },
  "format": {
   "enum": [
    "svg",
    "ascii"
   ],
   "type": "string",
   "default": "svg",
   "description": "Output format: \"svg\" (default) returns SVG + base64 data URL, \"ascii\" returns a Unicode block-character text rendering"
  },
  "errorCorrection": {
   "enum": [
    "L",
    "M",
    "Q",
    "H"
   ],
   "type": "string",
   "default": "M",
   "description": "Error correction level: L (7%), M (15%), Q (25%), H (30%). Default: M"
  }
 },
 "additionalProperties": false
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "svg",
  "dataUrl",
  "ascii",
  "moduleCount"
 ],
 "properties": {
  "svg": {
   "type": "string",
   "description": "The SVG markup string (empty when format is \"ascii\")"
  },
  "ascii": {
   "type": "string",
   "description": "Unicode block-character rendering of the QR code (empty when format is \"svg\")"
  },
  "dataUrl": {
   "type": "string",
   "description": "Data URL (data:image/svg+xml;base64,...) for easy embedding (empty when format is \"ascii\")"
  },
  "moduleCount": {
   "type": "number",
   "description": "Number of modules (squares) per side in the QR code"
  }
 },
 "additionalProperties": false
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/zeroclick-x402-service-registry-qr-code-generator-8f36fce6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from qr.withzero.ai](https://www.zero.xyz/host/qr.withzero.ai/llms.txt)
