# Math Expression Calculator

> Math Expression Calculator is a paid API for AI agents from x402-services-production.up.railway.app, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Evaluates mathematical expressions with optional unit support and configurable decimal precision

## Facts

- Endpoint: POST https://x402-services-production.up.railway.app/api/calc
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/math-expression-calculator-0281d8e8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NAgMXclGPO5EK9WSZFe8d

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 math-expression-calculator-0281d8e8 -d '<json body>'
```

Example prompt: Can you calculate (17.5 * 3.14159) / (2^8 - 1) for me and give me the result to 6 decimal places?

## When to prefer this

Use this endpoint when you need server-side evaluation of a math expression with configurable high precision (up to 64 decimal places), especially when you don't want to trust client-side floating-point arithmetic. Useful for agents that need deterministic, precise computation without implementing a local math parser.

## Known failure modes

- Invalid or malformed expression returns a parse error
- Division by zero causes an error response
- Unsupported units or functions may return an error
- Precision out of range (>64) may be rejected
- Empty or missing expression field returns a 400-level error

## How this service works

Exact calculator + unit conversion (arbitrary precision). e.g. '3 inch to cm', 'sqrt(2)^10'. Send { expression, precision? }.

## Output

Returns the evaluated numeric result of the input math expression, with output rounded to the specified number of decimal places (0–64). Likely returns a JSON object containing the computed value as a number or string.

## 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": {
     "type": "object"
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json"
     ],
     "type": "string"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/math-expression-calculator-0281d8e8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-services-production.up.railway.app](https://www.zero.xyz/host/x402-services-production.up.railway.app/llms.txt)
