# Code 128 Barcode SVG Generator

> Code 128 Barcode SVG Generator is a paid API for AI agents from barcode-qr.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-11-02).

Encodes ASCII text as a Code 128 barcode SVG with automatic subset A/B/C switching and mod-103 checksum computation.

## Facts

- Endpoint: GET https://barcode-qr.x402tookit.com/code128-svg?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/code-128-barcode-svg-generator-bc8195b9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vK68JJ3ScesuAfjoRKA7z

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 code-128-barcode-svg-generator-bc8195b9
```

Example prompt: Generate a Code 128 barcode SVG for the text 'SN-20481-XZ' with a scale of 3 pixels per module and a bar height of 60 modules.

## When to prefer this

Choose this endpoint when you need a standards-compliant Code 128 linear barcode SVG with automatic subset optimization (A/B/C switching) and a verified mod-103 checksum, especially for retail, logistics, or inventory use cases where Code 128 is the required symbology. Prefer this over QR code endpoints when a traditional 1D barcode is required, and over EAN/UPC endpoints when the data is not a numeric GTIN.

## Known failure modes

- Text longer than 80 characters returns an error or truncated result
- Non-ASCII characters in the input cause encoding failure
- Scale outside 1–8 or height outside 10–200 returns a validation error
- Empty text parameter results in an error response
- Network or payment failure (402) if USDC balance is insufficient

## How this service works

Encode ASCII text as a Code 128 barcode SVG with automatic subset A/B/C switching and the mod-103 checksum.

## Output

Returns a JSON object containing the SVG string of the rendered Code 128 barcode, the computed mod-103 checksum value, the sequence of subsets (A/B/C) used, the total number of modules, the number of symbols, an array of symbol values, the SVG file size in bytes, quiet zone module count, a summary string, and metadata such as the source and timestamp. May also include a verdict, degraded flag, disclaimer, and reasons array if any encoding decisions were noteworthy.

## 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": {
      "text": {
       "type": "string",
       "description": "ASCII text to encode, up to 80 characters"
      },
      "scale": {
       "type": "integer",
       "description": "Pixels per module, 1 to 8 (default 2)"
      },
      "height": {
       "type": "integer",
       "description": "Bar height in modules, 10 to 200 (default 40)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "svg": {
       "type": [
        "null",
        "string"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "modules": {
       "type": [
        "null",
        "number"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "subsets": {
       "type": [
        "null",
        "string"
       ]
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "symbols": {
       "type": [
        "null",
        "number"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "checksum": {
       "type": [
        "null",
        "number"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "svgBytes": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "symbolValues": {
       "type": [
        "array",
        "null"
       ],
       "items"
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/code-128-barcode-svg-generator-bc8195b9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from barcode-qr.x402tookit.com](https://www.zero.xyz/host/barcode-qr.x402tookit.com/llms.txt)
