# agent402.tools QR Code Generator

> agent402.tools QR Code Generator is a paid API for AI agents from agent402.tools, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-10).

Generates a QR code PNG image from any text or URL string, with configurable image size.

## Facts

- Endpoint: GET https://agent402.tools/api/qr?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-qr-code-generator-7c1f6650
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_iKiNUcUEqXciSQQTLmDRH

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 agent402-tools-qr-code-generator-7c1f6650
```

Example prompt: Can you generate a QR code PNG for https://myshop.example.com — make it 512 pixels wide so it's high enough resolution to print on a flyer?

## When to prefer this

Use this endpoint when you need to programmatically generate a QR code PNG from arbitrary text or a URL, especially in automated agent workflows where paying per-call via x402 USDC micropayment is acceptable. Prefer this over client-side QR libraries when you need a hosted, server-side PNG output with no dependency management.

## Known failure modes

- text parameter missing — returns error; text is required
- text exceeds 2KB limit — QR capacity exceeded, returns error
- size parameter out of range (below 128 or above 1024) — returns validation error
- invalid or non-encodable content — returns error
- service unavailable or payment failure — HTTP 402 or 5xx error

## How this service works

Generate a QR code PNG from any text or URL.

## Output

A PNG image binary of the QR code encoding the supplied text or URL, rendered at the requested pixel size (128–1024px, default 256px). The agent receives raw image bytes that can be saved as a .png file or embedded directly.

## 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": [
      "text"
     ],
     "properties": {
      "size": {
       "type": "string",
       "description": "Image width px (128-1024, default 256)"
      },
      "text": {
       "type": "string",
       "description": "Content to encode (max 2KB)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "contentType",
      "body"
     ],
     "properties": {
      "body": {
       "type": "string"
      },
      "contentType": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "body": "(binary PNG image)",
  "contentType": "image/png"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-qr-code-generator-7c1f6650/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
