# Pad Hex to Fixed Byte Width

> Pad Hex to Fixed Byte Width is a paid API for AI agents from twin.unykorn.org, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-01).

Pads a hex string to a specified fixed byte width, with configurable direction, useful for EVM data encoding tasks.

## Facts

- Endpoint: POST https://twin.unykorn.org/eth-pad-hex?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pad-hex-to-fixed-byte-width-37960266
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_jWb71ntgJXC353bemRqEu

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 pad-hex-to-fixed-byte-width-37960266 -d '<json body>'
```

Example prompt: Pad the hex value 0x1a2b to 32 bytes with left padding so I can use it in an Ethereum ABI-encoded calldata field.

## When to prefer this

Choose this endpoint when you need a reliable, pay-per-call utility to pad hex strings to exact byte widths for EVM/Ethereum data encoding, especially within an agent workflow that already uses the UnyKorn/Genesis402 x402 operator network for other blockchain utility calls. Prefer it over hand-rolling padding logic when you want a consistent, auditable result with a payment receipt.

## Known failure modes

- Invalid hex string (not matching ^0x[0-9a-fA-F]*$) returns a validation error
- Size value less than 0 is rejected
- Unrecognized direction value may cause an error or default behavior
- Payment failure (x402) results in 402 response before processing
- Network or server errors return non-200 HTTP status

## How this service works

Pad hex to a fixed byte width — Genesis402 / UnyKorn Operator Network

## Output

Returns a JSON object with ok:true, the type field 'eth-pad-hex', the padded hex result, a payment receipt including transaction hash, USD amount, and a receipt ID, plus an ISO8601 timestamp of when it was generated.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "params": {
   "type": "object",
   "properties": {
    "hex": {
     "type": "string",
     "pattern": "^0x[0-9a-fA-F]*$"
    },
    "size": {
     "type": "integer",
     "minimum": 0
    },
    "direction": {
     "type": "string"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "type": "eth-pad-hex",
  "receipt": {
   "tx_hash": "0x<64hex>",
   "amount_usd": 0.001,
   "receipt_id": "g402-<16hex>"
  },
  "generated_at": "<iso8601>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pad-hex-to-fixed-byte-width-37960266/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twin.unykorn.org](https://www.zero.xyz/host/twin.unykorn.org/llms.txt)
