# PDF LZW Decode with EarlyChange (Bounded Stream)

> PDF LZW Decode with EarlyChange (Bounded Stream) is a paid API for AI agents from detect.halowerk.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-11-01).

Decodes a bounded PDF LZW-compressed byte stream with explicit EarlyChange control and validates or reconstructs the decoded output against an optional claim.

## Facts

- Endpoint: POST https://detect.halowerk.com/v1/F-TD2000-DOCUMENTS-03/pdf-lzwdecode-earlychange-clear-kwkwk-dictionary-reconstruction?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pdf-lzw-decode-with-earlychange-bounded-stream-db7778e5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BpNZzODT3AheCm4UVD6Vx

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 pdf-lzw-decode-with-earlychange-bounded-stream-db7778e5 -d '<json body>'
```

Example prompt: Can you decode this bounded PDF LZW byte stream for me — here are the raw bytes [0x80, 0x0B, ...] with early_change set to 1, and check whether the decoded output matches my claimed 42 consumed bits and decoded sequence [0x41, 0x42, 0x43]?

## When to prefer this

Choose this endpoint when you need to decode a small, bounded PDF LZW byte stream (up to 4096 bytes) with explicit control over the EarlyChange parameter, especially for validating edge cases like KwKwK dictionary reconstruction or verifying your own decoder's output against a reference. Prefer this over generic LZW tools when working specifically with PDF-spec LZW streams where EarlyChange semantics matter.

## Known failure modes

- Input bytes too short (minimum 2 bytes required) or exceeds 4096-byte limit
- Invalid early_change value (must be 0 or 1)
- Claim mismatch: provided decoded or consumed_bits does not match actual decoding result
- Malformed LZW stream causing decoding failure (e.g. missing clear code, corrupt codes)
- Payment not included or insufficient USDC balance (x402 payment required)

## How this service works

Decode a bounded PDF LZW byte stream with explicit EarlyChange.

## Output

Returns the decoded byte sequence from the LZW-compressed PDF stream, the number of consumed bits, and validation of any provided claim (decoded bytes and consumed_bits). Surfaces dictionary reconstruction details relevant to KwKwK and EarlyChange edge cases.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "artifact": {
   "type": "object",
   "required": [
    "pdfLzw"
   ],
   "properties": {
    "pdfLzw": {
     "type": "object",
     "required": [
      "data",
      "claim"
     ],
     "properties": {
      "data": {
       "type": "object",
       "required": [
        "bytes",
        "early_change"
       ],
       "properties": {
        "bytes": {
         "type": "array",
         "items": {
          "type": "integer",
          "maximum": 255,
          "minimum": 0
         },
         "maxItems": 4096,
         "minItems": 2
        },
        "early_change": {
         "enum": [
          0,
          1
         ]
        }
       },
       "additionalProperties": false
      },
      "claim": {
       "anyOf": [
        {
         "type": "null"
        },
        {
         "type": "object",
         "required": [
          "consumed_bits",
          "decoded"
         ],
         "properties": {
          "decoded": {
           "type": "array",
           "items": {
            "type": "integer"
           },
           "maxItems": 4096
          },
          "consumed_bits": {
           "type": "integer"
          }
         },
         "additionalProperties": false
        }
       ]
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pdf-lzw-decode-with-earlychange-bounded-stream-db7778e5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from detect.halowerk.com](https://www.zero.xyz/host/detect.halowerk.com/llms.txt)
