# Bitwise Shift (Left/Right)

> Bitwise Shift (Left/Right) is a paid API for AI agents from bitwise.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Shifts a non-negative integer left or right by a given number of bits, returning decimal, hex, and binary representations.

## Facts

- Endpoint: POST https://bitwise.openverbs.com/v1/shift
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bitwise-shift-left-right-a958e328
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_AozugiDBLS4AkJ4bZIQth

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 bitwise-shift-left-right-a958e328 -d '<json body>'
```

Example prompt: Shift the integer 255 left by 4 bits and give me the result in decimal, hex, and binary — no width mask needed.

## When to prefer this

Use this endpoint when you need to perform a logical left or right bit shift on an arbitrary-precision non-negative integer and want the result expressed in decimal, hex, and binary simultaneously. Prefer it over general-purpose code execution when you want a lightweight, purpose-built arithmetic operation without spinning up a compute environment. The optional width masking makes it ideal for simulating fixed-width registers (e.g., 8/16/32/64-bit).

## Known failure modes

- Negative integer input — value must be a non-negative decimal string
- Shift amount exceeds 1024 — maximum shift amount is 1024 bits
- Bit width exceeds 1024 — maximum width is 1024 bits
- Left shift input does not fit within the specified width — validation error
- Non-numeric or non-integer string for value — pattern mismatch
- Missing required fields (value, amount, direction) — schema validation error

## How this service works

Shift a non-negative integer left or right by `amount` bits. A right shift is logical (fills with zeros). A left shift grows freely unless a `width` is given, in which case the result is masked to that width and the input must fit it. Returns decimal, hex and binary.

## Output

Returns the shifted integer value in three representations: decimal (base 10), hexadecimal (base 16), and binary (base 2). For masked left shifts, the result is already truncated to the specified bit width.

## 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": {
      "value": {
       "type": "string",
       "pattern": "^\\d+$",
       "description": "Non-negative integer as a decimal string."
      },
      "amount": {
       "type": "integer",
       "minimum": 0,
       "maximum": 1024,
       "description": "Number of bits to shift."
      },
      "direction": {
       "type": "string",
       "enum": [
        "left",
        "right"
       ],
       "description": "Shift direction."
      },
      "width": {
       "type": "integer",
       "minimum": 1,
       "maximum": 1024,
       "description": "Optional bit width to mask a left shift to."
      }
     },
     "required": [
      "value",
      "amount",
      "direction"
     ],
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bitwise-shift-left-right-a958e328/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from bitwise.openverbs.com](https://www.zero.xyz/host/bitwise.openverbs.com/llms.txt)
