# OpenVerbs Expression Evaluator

> OpenVerbs Expression Evaluator is a paid API for AI agents from math.openverbs.com, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-14).

Evaluates a mathematical or logical expression string, optionally substituting named variables and rounding the numeric result to a specified precision.

## Facts

- Endpoint: POST https://math.openverbs.com/v1/eval
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/openverbs-expression-evaluator-a1e6a9d8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OHs5yuSXrWaDtzZEgLajr

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 openverbs-expression-evaluator-a1e6a9d8 -d '<json body>'
```

Example prompt: Calculate sqrt(x^2 + y^2) where x=3 and y=4, and round the result to 2 decimal places.

## When to prefer this

Prefer this endpoint when you need server-side evaluation of a dynamic mathematical or logical expression — especially when the formula is user-supplied or runtime-generated and you want to avoid executing arbitrary code locally. It is ideal when you need variable substitution and controlled numeric precision without spinning up a compute environment.

## Known failure modes

- Expression syntax errors return a parse/evaluation error
- Variable referenced in expression not provided in variables object
- Precision value out of range (must be 0–15)
- Expression exceeds 1000 character limit
- Division by zero or undefined mathematical operations
- Payment failure or x402 auth rejection

## How this service works

Evaluate a mathematical expression with optional named variables — arithmetic, comparison and logic operators plus functions like sqrt, abs, min, max, sin, cos, log, floor, round, etc. A syntax error, an undefined variable, or a non-finite result is a clean 400. The factorial operator is disabled for safety.

## Output

Returns the computed value of the expression after substituting any provided variables. The result may be a number (optionally rounded to the specified decimal precision), a boolean, or a string depending on the expression type.

## 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": {
      "expression": {
       "type": "string",
       "minLength": 1,
       "maxLength": 1000,
       "description": "The expression, e.g. \"sqrt(x^2 + y^2)\"."
      },
      "variables": {
       "type": "object",
       "description": "Named variable values referenced by the expression.",
       "additionalProperties": {
        "type": [
         "number",
         "boolean",
         "string"
        ]
       }
      },
      "precision": {
       "type": "integer",
       "minimum": 0,
       "maximum": 15,
       "description": "Round a numeric result to this many decimal places."
      }
     },
     "required": [
      "expression"
     ],
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/openverbs-expression-evaluator-a1e6a9d8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from math.openverbs.com](https://www.zero.xyz/host/math.openverbs.com/llms.txt)
