agentsvc.io

services / qr-code

utilityoperational · 13 ms

QR Code Generator

Generate a QR code for any text or URL. Returns image_base64 (base64 PNG — decode to get raw bytes). Params: text (required), size in px (64-1024, default 256), error_correction (L/M/Q/H, default M). H = highest redundancy, survives up to 30% damage.

Run free trial ↗3 free calls per day with the example input. Paid: $0.002 USDC, no limit.

Call it

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/qr-code", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"text":"https://agentsvc.io","size":256}),
});
const { data, payment } = await res.json();  // payment.transaction = on-chain receipt

Input

FieldTypeDescription
text *stringThe text or URL to encode in the QR code
sizeinteger = 256Output image size in pixels (width and height). Min: 64, Max: 1024.
error_correctionL | M | Q | H = "M"Error correction level: L=7%, M=15%, Q=25%, H=30% data recovery. Higher = bigger QR code.

Output

FieldTypeDescription
image_base64stringBase64-encoded PNG image of the QR code (decode to get raw bytes)
widthintegerImage width in pixels
heightintegerImage height in pixels
textstringThe text that was encoded
generated_atstringISO 8601 timestamp of generation

Example response (data)

{
  "image_base64": "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAA...",
  "width": 256,
  "height": 256,
  "text": "https://agentsvc.io",
  "generated_at": "2026-04-07T12:00:00.000Z"
}