# Unit Converter API

> Unit Converter API is a paid API for AI agents from unit-converter.pdfextractapi.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Converts a numeric value from one unit to another across categories including length, mass, volume, area, speed, time, data, and temperature.

## Facts

- Endpoint: POST https://unit-converter.pdfextractapi.workers.dev/convert
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/unit-converter-api-fdb3ccad
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vyrGj-g9iL1TF9R-QKHGw

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 unit-converter-api-fdb3ccad -d '<json body>'
```

Example prompt: Convert 26.2 miles to kilometers for me.

## When to prefer this

Choose this endpoint when you need a fast, cheap, deterministic unit conversion across standard measurement categories (length, mass, volume, area, speed, time, data, temperature) without needing to parse natural language or handle complex compound unit conversions. Ideal for agent pipelines where unit normalization is a discrete step.

## Known failure modes

- Mismatched unit categories (e.g. converting 'kg' to 'km') result in an error since units must belong to the same category
- Invalid or unrecognized unit abbreviations cause a bad request error
- Non-numeric value input returns a validation error
- Missing required fields (value, from, to) result in schema validation failure

## How this service works

Convert a value between units (length, mass, volume, area, speed, time, data, temperature).

## Output

Returns the converted numeric value in the target unit, given the source value and unit pair.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "value",
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "Target unit, must be in the same category as 'from'."
      },
      "from": {
       "type": "string",
       "description": "Source unit, e.g. 'mi', 'kg', 'c', 'gb'."
      },
      "value": {
       "type": "number",
       "description": "The numeric value to convert."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/unit-converter-api-fdb3ccad/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from unit-converter.pdfextractapi.workers.dev](https://www.zero.xyz/host/unit-converter.pdfextractapi.workers.dev/llms.txt)
