# 2s Barcode Generator

> 2s Barcode Generator is a paid API for AI agents from 2s.io, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Generates QR codes and barcodes from structured data including text, URLs, emails, SMS, phone numbers, WiFi credentials, vCards, and geolocation

## Facts

- Endpoint: POST https://2s.io/api/barcode/generate
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-barcode-generator-ee77f60b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pUzldYHm5TAaDwULrQft9

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 2s-barcode-generator-ee77f60b -d '<json body>'
```

Example prompt: Can you generate a QR code for my WiFi network called 'CornerCafe' with WPA security and password 'Coffee2024!' — I want to print it out so guests can scan it to connect?

## When to prefer this

Choose this endpoint when you need a pay-per-call, no-signup barcode/QR code generation service that supports a wide variety of encoded data types (URL, text, email, SMS, phone, WiFi, vCard, geolocation) and can be called programmatically by an AI agent using USDC micropayments on Base or Solana. Prefer over subscription-based alternatives when usage is infrequent or automated.

## Known failure modes

- Invalid input type enum value returns validation error
- Text or URL exceeding maxLength (2000 chars) rejected
- Malformed email or URI format rejected
- Missing required fields for the selected data type (e.g. missing 'ssid' for wifi type) returns 400
- Payment failure via x402 protocol returns 402 Payment Required
- Empty or null data payload rejected

## How this service works

The (most) everything API: 575+ pay-per-call endpoints for AI agents — ground-truth data, a full AI gateway, and agent infrastructure (storage, queues, watchers). USDC via x402, no signup, no API keys, and upto billing: pay actual usage, not the quote.

## Output

Returns a JSON response containing the generated barcode or QR code, likely as an image (base64-encoded data or image URL), encoding the structured input data (URL, text, vCard, WiFi, etc.) in machine-readable barcode format.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "data": {
   "anyOf": [
    {
     "type": "object",
     "required": [
      "type",
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "maxLength": 2000,
       "minLength": 1
      },
      "type": {
       "enum": [
        "text"
       ],
       "type": "string"
      }
     },
     "additionalProperties": false
    },
    {
     "type": "object",
     "required": [
      "type",
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "maxLength": 2000
      },
      "type": {
       "enum": [
        "url"
       ],
       "type": "string"
      }
     },
     "additionalProperties": false
    },
    {
     "type": "object",
     "required": [
      "type",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string"
      },
      "body": {
       "type": "string",
       "maxLength": 1000
      },
      "type": {
       "enum": [
        "email"
       ],
       "type": "string"
      },
      "subject": {
       "type": "string",
       "maxLength": 200
      }
     },
     "additionalProperties": false
    },
    {
     "type": "object",
     "required": [
      "type",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string",
       "maxLength": 50,
       "minLength": 1
      },
      "body": {
       "type": "string",
       "maxLength": 1000
      },
      "type": {
       "enum": [
        "sms"
       ],
       "type": "string"
      }
     },
     "additionalProperties": false
    },
    {
     "type": "object",
     "required": [
      "type",
      "number"
     ],
     "properties": {
      "type": {
       "enum": [
        "phone"
       ],
       "type": "string"
      },
      "number": {
       "type": "string",
       "maxLength": 50,
       "minLength": 1
      }
     },
     "additionalProperties": false
    },
    {
     "type": "object",
     "required": [
      "type",
      "ssid"
     ],
     "properties": {
      "ssid": {
       "type": "string",
       "maxLength": 100,
       "minLength": 1
      },
      "type": {
       "enum": [
        "wifi"
       ],
       "type": "string"
      },
      "hidden": {
       "type": "boolean"
      },
      "password": {
       "type": "string",
       "maxLength": 200
      },
      "security": {
       "enum": [
        "WPA",
        "WEP",
        "none"
       ],
       "type": "string"
      }
     },
     "additionalProperties"
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-barcode-generator-ee77f60b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
