{"uid":"cap_OHs5yuSXrWaDtzZEgLajr","slug":"openverbs-expression-evaluator-a1e6a9d8","name":"OpenVerbs Expression Evaluator","description":"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.","url":"https://math.openverbs.com/v1/eval","method":"POST","headers":{},"bodySchema":{"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","required":["expression"],"properties":{"precision":{"type":"integer","maximum":15,"minimum":0,"description":"Round a numeric result to this many decimal places."},"variables":{"type":"object","description":"Named variable values referenced by the expression.","additionalProperties":{"type":["number","boolean","string"]}},"expression":{"type":"string","maxLength":1000,"minLength":1,"description":"The expression, e.g. \"sqrt(x^2 + y^2)\"."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_hg2F9NvcpHxh7OO_E_XJ8","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Evaluates a mathematical or logical expression string, optionally substituting named variables and rounding the numeric result to a specified precision.","exampleAgentPrompt":"Calculate sqrt(x^2 + y^2) where x=3 and y=4, and round the result to 2 decimal places.","exampleUseCases":[{"title":"Physics formula in a tutoring app","prompt":"Evaluate the expression (0.5 * m * v^2) where m=10 and v=5, rounded to 3 decimal places — I want to show the kinetic energy result to a student."},{"title":"Dynamic pricing rule evaluation","prompt":"I have a pricing formula: base_price * (1 + tax_rate) - discount. Can you evaluate it with base_price=99.99, tax_rate=0.08, and discount=15, rounded to 2 decimal places?"},{"title":"Boolean logic check in a workflow","prompt":"Evaluate the expression (revenue > 50000) && (margin > 0.2) with revenue=62000 and margin=0.25 — I need to know if this deal qualifies for the bonus tier."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:30:24.542Z","isFirstParty":false}