# EVM Unit Conversion API (pastable-x402)

> EVM Unit Conversion API (pastable-x402) is a paid API for AI agents from pastable-x402.pages.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-14).

Converts Ethereum unit amounts between wei, gwei, and ether denominations

## Facts

- Endpoint: GET https://pastable-x402.pages.dev/evm/units
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/evm-unit-conversion-api-pastable-x402-b59c2d02
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gVgkY-3gWYC1x1RvUFrG6

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 evm-unit-conversion-api-pastable-x402-b59c2d02
```

Example prompt: Convert 1.5 ether to wei for me — I need the exact wei value to pass into a smart contract call.

## When to prefer this

Use this endpoint when an AI agent needs precise, programmatic EVM unit conversion (wei/gwei/ether) without implementing the conversion logic itself. Especially useful in smart contract interaction workflows where exact wei values are required, or when displaying human-readable ETH amounts from raw on-chain data. Prefer this over manual calculation to avoid floating-point precision errors common in ETH unit math.

## Known failure modes

- Missing required query parameters (amount, from, to) returns an error
- Invalid unit string (not wei, gwei, or ether) causes a bad request
- Malformed amount string (non-numeric) may return a conversion error
- Payment failure via x402 protocol on Base mainnet prevents the call
- Very large or very small numbers may hit precision limits

## How this service works

Pay-per-call utility APIs for agents: EVM helpers (checksum, unit conversion, keccak), data transforms (CSV to JSON, JSON diff, URL canonicalisation), text tools (hashing, JWT decode), and Bazaar market intelligence. x402 on Base mainnet.

## Output

A JSON object containing the original input amount, the source unit, the target unit, and the converted result as a string — e.g. {"input":"1","from":"ether","to":"wei","result":"1000000000000000000","wei":"1000000000000000000"}

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "amount",
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "wei|gwei|ether"
      },
      "from": {
       "type": "string",
       "description": "wei|gwei|ether"
      },
      "amount": {
       "type": "string",
       "description": "string"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "to": "wei",
  "wei": "1000000000000000000",
  "from": "ether",
  "input": "1",
  "result": "1000000000000000000"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/evm-unit-conversion-api-pastable-x402-b59c2d02/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pastable-x402.pages.dev](https://www.zero.xyz/host/pastable-x402.pages.dev/llms.txt)
