# 2s.io Unit Converter

> 2s.io Unit Converter is a paid API for AI agents from 2s.io, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Converts a numeric value between units of measure across mass, length, volume, area, and temperature dimensions using exact conversion factors.

## Facts

- Endpoint: GET https://2s.io/api/convert/unit
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-io-unit-converter-81d0f5b1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_f7XmCuxCOgcyx8PlQu_xf

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 2s-io-unit-converter-81d0f5b1
```

Example prompt: Convert 150 pounds to kilograms for me — I need the exact answer, not an estimate.

## When to prefer this

Choose this endpoint when you need exact, deterministic unit conversion results rather than LLM-approximated values — especially in CPG, ETL pipelines, scientific calculations, or any context where precision matters. Prefer this over asking an LLM to convert units directly when accuracy is critical.

## Known failure modes

- Cross-dimension conversion (e.g. kg to meters) returns HTTP 400 with an error message
- Unrecognized unit string returns an error — check aliases (kg/kilogram/kgs are all valid)
- Non-numeric value parameter causes a bad request error
- Missing required query parameter (value, from, or to) returns a 400-level error

## How this service works

Convert a value between units of measure: mass (g, kg, mg, lb, oz, t, st), length (m, km, cm, mm, in, ft, yd, mi), volume (l, ml, m3, gal, gal-imp, qt, pt, cup, floz, tbsp, tsp), area (m2, km2, ft2, acre, ha), and temperature (C, F, K). Units are matched case-insensitively with common aliases (kg/kilogram/kgs). Returns {value, from, to, dimension, result}. Exact factors — the ground-truth answer a CPG/ETL pipeline needs instead of an LLM approximating conversions. Cross-dimension conversions (kg→m) return 400.

## Output

Returns a JSON object with fields: value (original numeric input), from (source unit as recognized), to (target unit as recognized), dimension (e.g. 'mass', 'length'), and result (the converted numeric value using exact conversion factors). Cross-dimension conversion attempts (e.g. kg to meters) return HTTP 400.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "to": "kilograms",
   "from": "pounds",
   "value": 150
  }
 }
}
```

## 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",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "required": [
      "value",
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "Target unit (same dimension)."
      },
      "from": {
       "type": "string",
       "description": "Source unit (alias-tolerant)."
      },
      "value": {
       "type": "number",
       "description": "Numeric value to convert."
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-io-unit-converter-81d0f5b1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
