# pack.openverbs.com JSON Encoder (MessagePack/CBOR)

> pack.openverbs.com JSON Encoder (MessagePack/CBOR) is a paid API for AI agents from pack.openverbs.com, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-14).

Serializes any JSON value into a compact MessagePack or CBOR binary byte stream, returned as a base64, base64url, or hex string with byte length.

## Facts

- Endpoint: POST https://pack.openverbs.com/v1/encode
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pack-openverbs-com-json-encoder-messagepack-cbor-8f067075
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MiBJwjr_9tzvCeG_B9ohF

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 pack-openverbs-com-json-encoder-messagepack-cbor-8f067075 -d '<json body>'
```

Example prompt: Serialize this JSON object {"user":"alice","score":42} into MessagePack format and give me the result as a base64 string.

## When to prefer this

Choose this endpoint when you need to convert a JSON value into a compact binary wire format (MessagePack or CBOR) with a text-safe envelope (base64/hex), particularly for IoT payloads, WebAuthn, caching, or any protocol that benefits from smaller byte footprint than JSON. Prefer over manual encoding libraries when operating in an agentic context where calling a remote API is simpler than bundling native codec dependencies.

## Known failure modes

- Invalid or missing 'data' field — returns validation error
- Unsupported format value (not 'msgpack' or 'cbor') — returns enum validation error
- Unsupported outputEncoding value — returns enum validation error
- Payment not provided or invalid (x402 protocol error) — returns 402 Payment Required
- Malformed JSON body — returns parse error

## How this service works

Serialize a JSON value into a compact MessagePack or CBOR byte stream, returned as a base64 (default), base64url or hex string, along with the byte length.

## Output

Returns the binary-encoded byte stream as a base64, base64url, or hex string (default base64), along with the byte length of the encoded output. The format used (msgpack or cbor) is also reflected in the response.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "format": {
       "type": "string",
       "enum": [
        "msgpack",
        "cbor"
       ],
       "description": "Binary format, one of msgpack, cbor."
      },
      "data": {
       "description": "Any JSON value (object, array, string, number, boolean or null)."
      },
      "outputEncoding": {
       "type": "string",
       "enum": [
        "base64",
        "base64url",
        "hex"
       ],
       "description": "Envelope encoding of the bytes (base64, base64url, hex). Default base64."
      }
     },
     "required": [
      "format",
      "data"
     ],
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pack-openverbs-com-json-encoder-messagepack-cbor-8f067075/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pack.openverbs.com](https://www.zero.xyz/host/pack.openverbs.com/llms.txt)
