# Fraction from Decimal Converter

> Fraction from Decimal Converter is a paid API for AI agents from fraction.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Converts a decimal string (including repeating decimals) to its exact reduced fraction form

## Facts

- Endpoint: POST https://fraction.openverbs.com/v1/from-decimal
- 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/fraction-from-decimal-converter-258d0061
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2pdYvkK97mCTmOJnIeIfb

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 fraction-from-decimal-converter-258d0061 -d '<json body>'
```

Example prompt: Can you convert the repeating decimal 0.1666 to an exact reduced fraction? The last 1 digit repeats.

## When to prefer this

Use this endpoint when you need the exact rational fraction equivalent of a decimal number, especially for repeating decimals where floating-point arithmetic would lose precision. Prefer this over manual computation or general-purpose math libraries when you need a guaranteed reduced result for a single decimal conversion without setting up any math environment.

## Known failure modes

- Non-numeric string value returns a clean HTTP 400 error
- Missing required 'value' field returns a validation error
- repeat count exceeding 1024 or below 0 returns a validation error
- value string longer than 1024 characters returns a validation error

## How this service works

Convert a decimal string to an exact reduced fraction. For a repeating decimal, set repeat to the number of trailing fractional digits that repeat (e.g. value='0.1666', repeat=1 → 1/6; value='0.3', repeat=1 → 1/3). A non-numeric value is a clean 400.

## Output

Returns the exact reduced fraction representation of the input decimal, expressed as a numerator and denominator in lowest terms. For repeating decimals, the repeat parameter ensures the mathematically exact rational equivalent is computed (e.g. 0.1666 with repeat=1 yields 1/6).

## 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",
       "minLength": 1,
       "maxLength": 1024,
       "description": "Decimal number as a string, e.g. '0.75' or '-3.5'."
      },
      "repeat": {
       "type": "integer",
       "minimum": 0,
       "maximum": 1024,
       "description": "Count of trailing fractional digits that repeat. Default 0 (terminating)."
      }
     },
     "required": [
      "value"
     ],
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fraction-from-decimal-converter-258d0061/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fraction.openverbs.com](https://www.zero.xyz/host/fraction.openverbs.com/llms.txt)
