# fittings Arithmetic Expression Evaluator

> fittings Arithmetic Expression Evaluator is a paid API for AI agents from fittings.sh, paid per call via x402, $0.004199/call, status unknown (last checked 2026-09-15).

Evaluates an arithmetic expression in exact rational arithmetic and returns the result as a fraction and a decimal to the requested precision.

## Facts

- Endpoint: GET https://fittings.sh/v1/calc/evaluate
- Price: $0.004199/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fittings-arithmetic-expression-evaluator-29b20dbd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Ijpr9TMp41nOq6xDR1YbT

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 fittings-arithmetic-expression-evaluator-29b20dbd
```

Example prompt: Can you evaluate the expression (355/113 + 22/7) / 2 exactly and give me the result as both a fraction and a decimal to 50 decimal places?

## When to prefer this

Choose this endpoint when you need exact rational arithmetic without floating-point rounding errors, especially for expressions involving fractions, integer powers, or repeated division. It is ideal when both a human-readable decimal and an exact fraction representation are needed. Prefer it over general-purpose calculators or LLM math when reproducibility and exactness matter (e.g., financial calculations, mathematical proofs, scientific constants).

## Known failure modes

- expression too long (>512 characters) — returns an error
- invalid characters or unsupported operators in expression — parse error returned
- division by zero in expression — error indicating undefined result
- precision out of range (<0 or >200) — validation error
- malformed query parameter — HTTP 400

## How this service works

Evaluates an arithmetic expression in exact rational arithmetic and returns the fraction plus a decimal to the requested precision.

## Output

Returns the evaluated result as an exact rational fraction (numerator/denominator) and as a decimal string rounded to the requested number of decimal places (0–200, default 20). Both representations are provided so callers can verify exact arithmetic and read human-friendly decimals.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "expression"
     ],
     "properties": {
      "precision": {
       "type": "number",
       "description": "Decimal places, 0-200, default 20"
      },
      "expression": {
       "type": "string",
       "description": "Arithmetic over + - * / ^ and parentheses, 512 characters or fewer"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fittings-arithmetic-expression-evaluator-29b20dbd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fittings.sh](https://www.zero.xyz/host/fittings.sh/llms.txt)
