# 402utils Barcode Generator

> 402utils Barcode Generator is a paid API for AI agents from 402utils.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Generates a 1D barcode image (PNG or SVG) for EAN-13, EAN-8, UPC-A, Code 128, Code 39, or ITF-14 symbologies, with check digit validation.

## Facts

- Endpoint: POST https://402utils.com/v1/barcode
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/402utils-barcode-generator-1a2a29dc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_omhKTjk2lZjsG9gUi81ee

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 402utils-barcode-generator-1a2a29dc -d '<json body>'
```

Example prompt: Generate an EAN-13 barcode for the value 590123412345 as a PNG with scale 4 and the human-readable number shown underneath.

## When to prefer this

Use this endpoint when you need server-side barcode image generation with automatic check digit computation and validation for standard retail/logistics symbologies (EAN, UPC, ITF-14, Code 128/39). Prefer this over client-side libraries when you need a clean hosted API with per-call pricing, or when you want guaranteed check digit correctness without implementing the logic yourself.

## Known failure modes

- Invalid check digit provided — endpoint rejects and returns error
- Data string contains characters unsupported by the chosen symbology (e.g. lowercase for Code 39)
- Data length mismatch for fixed-length symbologies (EAN-13 requires 12 or 13 digits)
- Scale out of range (must be 1–10) — validation error
- Unknown symbology value — returns 4xx error
- Payment failure — x402 payment not accepted or insufficient USDC balance

## How this service works

Generate a 1D barcode as PNG or SVG: EAN-13, EAN-8, UPC-A, Code 128, Code 39 or ITF-14. Validates the structure and check digit for each symbology — EAN/UPC/ITF compute a missing check digit or reject a wrong one. Options: format (png/svg), scale (module px 1-10), text (human-readable line, default on). Returns the raw image. Generation only — reading a barcode from an image is out of scope.

## Output

Returns the raw barcode image file — either a PNG binary or an SVG document — ready to embed, display, or print. For EAN/UPC/ITF symbologies, a missing check digit is computed automatically; a wrong one is rejected with an error.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "data": {
   "type": "string",
   "description": "The value to encode (digits for EAN/UPC/ITF; text for Code 39/128)."
  },
  "text": {
   "type": "boolean",
   "default": true,
   "description": "Render the human-readable value under the bars."
  },
  "scale": {
   "type": "integer",
   "default": 3,
   "maximum": 10,
   "minimum": 1,
   "description": "Module width in px."
  },
  "format": {
   "enum": [
    "png",
    "svg"
   ],
   "type": "string",
   "default": "png"
  },
  "symbology": {
   "enum": [
    "ean13",
    "ean8",
    "upca",
    "code128",
    "code39",
    "itf14"
   ],
   "type": "string",
   "description": "Barcode type."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/402utils-barcode-generator-1a2a29dc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402utils.com](https://www.zero.xyz/host/402utils.com/llms.txt)
