Zelvyn
Home/API

API

A precise JSON API for mathematics, statistics, and business analytics — one contract, three domains.

Overview

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.

43operations
3domains
1response envelope
10,000values per dataset

Base URL

All endpoints are served from:

url
https://api-zelvyn.devs.surf

Every 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.

bash
# 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]}'

Domains

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.

All operations

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

OperationMethodPathSummary
healthGET/api/v1/healthLiveness / readiness probe

Statistics 9

OperationMethodPathSummary
meanPOST/api/v1/statistics/meanArithmetic mean
medianPOST/api/v1/statistics/medianMedian
variancePOST/api/v1/statistics/variancePopulation variance
standard-deviationPOST/api/v1/statistics/standard-deviationPopulation standard deviation
percentilePOST/api/v1/statistics/percentilePercentile (linear interpolation)
sumPOST/api/v1/statistics/sumSum of a dataset
minPOST/api/v1/statistics/minMinimum value
maxPOST/api/v1/statistics/maxMaximum value
rangePOST/api/v1/statistics/rangeRange (max − min)

Mathematics 16

OperationMethodPathSummary
addPOST/api/v1/math/addAdd numbers
subtractPOST/api/v1/math/subtractSubtract numbers (left to right)
multiplyPOST/api/v1/math/multiplyMultiply numbers
dividePOST/api/v1/math/divideDivide numbers (left to right)
percent-ofPOST/api/v1/math/percent-ofPercent of a value
percentage-changePOST/api/v1/math/percentage-changePercentage change between two values
powerPOST/api/v1/math/powerRaise a base to an exponent
sqrtPOST/api/v1/math/sqrtSquare root
nth-rootPOST/api/v1/math/nth-rootN-th root
logPOST/api/v1/math/logLogarithm to a base (default 10)
lnPOST/api/v1/math/lnNatural logarithm
factorialPOST/api/v1/math/factorialFactorial
gcdPOST/api/v1/math/gcdGreatest common divisor
lcmPOST/api/v1/math/lcmLeast common multiple
permutationsPOST/api/v1/math/permutationsPermutations P(n, r)
combinationsPOST/api/v1/math/combinationsCombinations C(n, r)

Business analytics 17

OperationMethodPathSummary
profitPOST/api/v1/business/profitProfit
profit-marginPOST/api/v1/business/profit-marginProfit margin (percent)
markupPOST/api/v1/business/markupMarkup (percent)
roiPOST/api/v1/business/roiReturn on investment ROI (percent)
roasPOST/api/v1/business/roasReturn on ad spend ROAS (ratio)
cagrPOST/api/v1/business/cagrCompound annual growth rate CAGR (percent)
break-evenPOST/api/v1/business/break-evenBreak-even volume (units)
conversion-ratePOST/api/v1/business/conversion-rateConversion rate (percent)
ctrPOST/api/v1/business/ctrClick-through rate CTR (percent)
cpcPOST/api/v1/business/cpcCost per click CPC
cpmPOST/api/v1/business/cpmCost per mille CPM
cpaPOST/api/v1/business/cpaCost per acquisition CPA
cacPOST/api/v1/business/cacCustomer acquisition cost CAC
aovPOST/api/v1/business/aovAverage order value AOV
retention-ratePOST/api/v1/business/retention-rateRetention rate (percent)
churn-ratePOST/api/v1/business/churn-rateChurn rate (percent)
clvPOST/api/v1/business/clvCustomer lifetime value CLV

Response envelope

Branch on success. Never parse freeform prose.

json
{
  "success": true,
  "data": { "result": 0.3 },
  "meta": {
    "requestId": "req_01HX...",
    "timestamp": "2026-01-01T00:00:00.000Z",
    "durationMs": 4
  }
}
json
{
  "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"
  }
}

Authentication

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.

Error codes

Errors always arrive in the same envelope, with a stable error.code. Branch on the code, not on the message.

HTTPCodeMeaning
400VALIDATION_ERRORMalformed body, wrong type, unknown field or out-of-range value
404INVALID_OPERATIONUnknown endpoint or operation
405METHOD_NOT_ALLOWEDThe path exists but not for this HTTP method
410ENDPOINT_SUNSETThe endpoint was retired on the date in the sunset header
413PAYLOAD_TOO_LARGERequest body exceeds the 1 MiB limit
422DIVISION_BY_ZEROThe denominator of the operation is zero
422UNDEFINED_RESULTThe result is mathematically or business-undefined
422INVALID_DATASETThe dataset cannot produce a meaningful result
429RATE_LIMITEDThe per-window rate limit was exceeded — check retry-after
500INTERNAL_ERRORUnexpected internal failure
503SERVICE_UNAVAILABLEThe control plane is temporarily unavailable

Try it out

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.

Resources