Prediction & anomaly detection
for AI agents
Send a list of numbers. Get the next predicted value or a list of anomalous points. Paid per call via x402 micropayments — no API keys, no accounts, no monthly bills.
Quick start
Predict next value · POST /timeseries
POST https://easy-predict.com/timeseries Content-Type: application/json PAYMENT-SIGNATURE: <x402-signed-payment-payload> // X-PAYMENT: <...> also accepted (legacy alias) { "series": [1.0, 2.3, 4.1, 6.8, 9.2] }
// 200 OK { "prediction": 12.1, "method": "linear", "holdout_errors": { "linear": 0.05, "log1p-linear": 0.31, "last-delta": 0.05, "mean": 3.5 }, "slope": 1.94, "intercept": 0.12 }
Detect anomalies · POST /anomaly-detection
POST https://easy-predict.com/anomaly-detection Content-Type: application/json PAYMENT-SIGNATURE: <x402-signed-payment-payload> // X-PAYMENT: <...> also accepted (legacy alias) { "series": [1.0, 2.3, 4.1, 6.8, 99.0], "threshold": 2.0 }
// 200 OK { "anomalies": [{ "index": 4, "value": 99.0, "z_score": 2.14 }], "method": "z-score", "mean": 15.12, "std": 39.18, "threshold": 2.0 }
No payment · 402 Payment Required
{ "x402Version": 2, "error": "Payment Required", "accepts": [{ "scheme": "exact", "network": "eip155:8453", "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "amount": "10000", "payTo": "0xc99b83818c8865340AC55C45554f377f41c68DBC" }] }
Endpoints
Accepts {"series": [n, …]} or a bare JSON array (3–1000 numbers).
Automatically selects the best model — linear, log1p-linear,
last-delta, or mean — by holding out the last point as a
validation target, then retrains the winner on the full series. Response includes
holdout_errors for all candidates so you can see why the model was chosen.
Calls without a valid PAYMENT-SIGNATURE header receive HTTP 402
with the full payment requirements in the response body.
(X-PAYMENT is accepted as a legacy alias.)
Accepts {"series": [n, …], "threshold": 2.0} or a bare JSON array (3–1000 numbers).
Returns a list of anomalous points using z-score detection. Optional threshold (default 2.0,
range 0–10) controls sensitivity — lower flags more points.
OpenAPI 3.1 spec. Paid operations declare the x402 security scheme; free operations declare "security": [].
Machine-readable x402 resource list with full PaymentRequirements for each paid endpoint. Used by x402scan and other crawlers.
How x402 payment works
accepts array.PAYMENT-SIGNATURE header (X-PAYMENT also accepted as a legacy alias). The facilitator verifies and settles on-chain.prediction (timeseries) or anomalies (anomaly-detection).Agent integration example
A working Python agent that receives a natural-language forecasting task, calls this API, handles the 402 challenge, signs a $0.01 USDC payment on Base, and reports the result — all autonomously. Uses the Anthropic SDK with tool use. The same pattern works in LangChain, LlamaIndex, CrewAI, AutoGen, or any framework that supports custom tool implementations.
# install pip install anthropic requests eth-account # run (live payments) ANTHROPIC_API_KEY=sk-... WALLET_PRIVATE_KEY=0x... python demo_agent.py
Discovery
This API is discoverable by x402-compatible indexers via two standard documents.