Mathematics
Arithmetic, powers, roots, logarithms, number theory and combinatorics.
A precise JSON API for mathematics, statistics, and business analytics — one contract, three domains.
Zelvyn exposes stateless operations under a single contract. Every request goes to the API directly from the browser or server — no computation is persisted, and no result is ever stored. Calculation endpoints work without a key; a key is optional and raises your limit.
All endpoints are served from:
https://api-zelvyn.devs.surfEvery operation lives under /api/v1, followed by the domain and the operation name — for example /api/v1/math/add. No API key is required; a key is optional and only raises your rate limit.
# Works without a key. Optional: add -H 'Authorization: Bearer $ZELVYN_API_KEY'
curl -sS -X POST 'https://api-zelvyn.devs.surf/api/v1/math/add' \
-H 'Content-Type: application/json' \
-d '{"values":[0.1,0.2]}'One API, three domains. Pick an operation and run it in the explorer or call it directly — every operation below links straight to the explorer with its request body pre-filled.
Arithmetic, powers, roots, logarithms, number theory and combinatorics.
Descriptive statistics over datasets of up to 10,000 values.
Profitability, growth, marketing efficiency, retention and CLV.
The complete registry — every path the API answers, in one table. The request fields, the examples and the exact edge cases live in the documentation.
Health 1
| Operation | Method | Path | Summary |
|---|---|---|---|
| health | GET | /api/v1/health | Liveness / readiness probe |
Statistics 9
| Operation | Method | Path | Summary |
|---|---|---|---|
| mean | POST | /api/v1/statistics/mean | Arithmetic mean |
| median | POST | /api/v1/statistics/median | Median |
| variance | POST | /api/v1/statistics/variance | Population variance |
| standard-deviation | POST | /api/v1/statistics/standard-deviation | Population standard deviation |
| percentile | POST | /api/v1/statistics/percentile | Percentile (linear interpolation) |
| sum | POST | /api/v1/statistics/sum | Sum of a dataset |
| min | POST | /api/v1/statistics/min | Minimum value |
| max | POST | /api/v1/statistics/max | Maximum value |
| range | POST | /api/v1/statistics/range | Range (max − min) |
Mathematics 16
| Operation | Method | Path | Summary |
|---|---|---|---|
| add | POST | /api/v1/math/add | Add numbers |
| subtract | POST | /api/v1/math/subtract | Subtract numbers (left to right) |
| multiply | POST | /api/v1/math/multiply | Multiply numbers |
| divide | POST | /api/v1/math/divide | Divide numbers (left to right) |
| percent-of | POST | /api/v1/math/percent-of | Percent of a value |
| percentage-change | POST | /api/v1/math/percentage-change | Percentage change between two values |
| power | POST | /api/v1/math/power | Raise a base to an exponent |
| sqrt | POST | /api/v1/math/sqrt | Square root |
| nth-root | POST | /api/v1/math/nth-root | N-th root |
| log | POST | /api/v1/math/log | Logarithm to a base (default 10) |
| ln | POST | /api/v1/math/ln | Natural logarithm |
| factorial | POST | /api/v1/math/factorial | Factorial |
| gcd | POST | /api/v1/math/gcd | Greatest common divisor |
| lcm | POST | /api/v1/math/lcm | Least common multiple |
| permutations | POST | /api/v1/math/permutations | Permutations P(n, r) |
| combinations | POST | /api/v1/math/combinations | Combinations C(n, r) |
Business analytics 17
| Operation | Method | Path | Summary |
|---|---|---|---|
| profit | POST | /api/v1/business/profit | Profit |
| profit-margin | POST | /api/v1/business/profit-margin | Profit margin (percent) |
| markup | POST | /api/v1/business/markup | Markup (percent) |
| roi | POST | /api/v1/business/roi | Return on investment ROI (percent) |
| roas | POST | /api/v1/business/roas | Return on ad spend ROAS (ratio) |
| cagr | POST | /api/v1/business/cagr | Compound annual growth rate CAGR (percent) |
| break-even | POST | /api/v1/business/break-even | Break-even volume (units) |
| conversion-rate | POST | /api/v1/business/conversion-rate | Conversion rate (percent) |
| ctr | POST | /api/v1/business/ctr | Click-through rate CTR (percent) |
| cpc | POST | /api/v1/business/cpc | Cost per click CPC |
| cpm | POST | /api/v1/business/cpm | Cost per mille CPM |
| cpa | POST | /api/v1/business/cpa | Cost per acquisition CPA |
| cac | POST | /api/v1/business/cac | Customer acquisition cost CAC |
| aov | POST | /api/v1/business/aov | Average order value AOV |
| retention-rate | POST | /api/v1/business/retention-rate | Retention rate (percent) |
| churn-rate | POST | /api/v1/business/churn-rate | Churn rate (percent) |
| clv | POST | /api/v1/business/clv | Customer lifetime value CLV |
Branch on success. Never parse freeform prose.
{
"success": true,
"data": { "result": 0.3 },
"meta": {
"requestId": "req_01HX...",
"timestamp": "2026-01-01T00:00:00.000Z",
"durationMs": 4
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "values must contain at least 1 value",
"details": { "field": "values" }
},
"meta": {
"requestId": "req_01HX...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}No API key is required. Every endpoint accepts keyless requests on the anonymous rate limit. If you have a key, send it as Authorization: Bearer <key> or x-api-key: <key> for your plan's higher limit and quota. A key you send is always validated: an invalid key is rejected rather than silently ignored.
Errors always arrive in the same envelope, with a stable error.code. Branch on the code, not on the message.
| HTTP | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_ERROR | Malformed body, wrong type, unknown field or out-of-range value |
| 404 | INVALID_OPERATION | Unknown endpoint or operation |
| 405 | METHOD_NOT_ALLOWED | The path exists but not for this HTTP method |
| 410 | ENDPOINT_SUNSET | The endpoint was retired on the date in the sunset header |
| 413 | PAYLOAD_TOO_LARGE | Request body exceeds the 1 MiB limit |
| 422 | DIVISION_BY_ZERO | The denominator of the operation is zero |
| 422 | UNDEFINED_RESULT | The result is mathematically or business-undefined |
| 422 | INVALID_DATASET | The dataset cannot produce a meaningful result |
| 429 | RATE_LIMITED | The per-window rate limit was exceeded — check retry-after |
| 500 | INTERNAL_ERROR | Unexpected internal failure |
| 503 | SERVICE_UNAVAILABLE | The control plane is temporarily unavailable |
Use the API Explorer to browse operations, edit payloads, and run live requests against the API — the response, the HTTP status and the request id all show up next to your call.