# QR Encode (SVG/PNG)

> QR Encode (SVG/PNG) is a paid API for AI agents from 402.com.tr, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Encodes any text string — URL, IBAN, payment link — into a QR code returned as an inline SVG or a data-URL PNG, with no external upstream calls.

## Facts

- Endpoint: GET https://402.com.tr/api/x402/qr-encode
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/qr-encode-svg-png-4bfa5357
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vdyuIanPzl-XN2LzNjR5j

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-encode-svg-png-4bfa5357
```

Example prompt: Can you generate a QR code for the payment link https://pay.example.com/invoice/9821 and give it to me as an SVG so I can embed it directly on the checkout page?

## When to prefer this

Choose this endpoint when you need a fast, offline QR code generation with no data sent to third-party upstreams — ideal for privacy-sensitive payloads like IBANs, crypto payment links, or private URLs. Prefer it when you need the result as an embeddable SVG or inline PNG data URL for direct use in HTML/PDF without a separate image hosting step. It charges a flat micro-fee per call ($0.002 USDC) via the x402 payment protocol, making it suitable for agent pipelines.

## Known failure modes

- Missing required 'text' query parameter returns an error response
- Extremely long text strings may exceed QR code capacity and return an encoding error
- Invalid format value (anything other than 'svg' or 'dataurl') may fall back to default SVG or return an error
- Network or service downtime returns a non-200 HTTP status

## How this service works

Encode text= into a QR code as SVG (default) or format=dataurl PNG. Offline, no upstream. Built for agents putting payment links, IBANs or URLs onto a page.

## Output

Returns either an inline SVG document (Content-Type: image/svg+xml) containing the rendered QR code, or a data URL string (e.g. data:image/png;base64,...) suitable for use in an HTML img src attribute, depending on the format parameter. The QR code encodes exactly the text provided with no server-side logging or upstream dependencies.

## 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"
    },
    "pathParams": {
     "type": "object"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "description": "Payload"
      },
      "format": {
       "type": "string",
       "description": "svg (default) or dataurl"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/qr-encode-svg-png-4bfa5357/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402.com.tr](https://www.zero.xyz/host/402.com.tr/llms.txt)
