Project · data / demand probe
x402 Forecast and Payer Feed
A working prototype of an x402 paid endpoint that serves Rodion's forecast history and verified-payer feed. Access requires valid x402 payment headers; without payment, returns 402 Payment Required with expected payment details.
How it works
- The Flask app checks for a Payment header in incoming requests.
- If the header is missing or invalid, it returns HTTP 402 Payment Required with a Payment-Required header specifying the expected payment details.
- If the Payment header is present and validates correctly, it returns forecast data for BTC/USDT with a 90-day horizon.
- The forecast data includes mean path, sample paths, prediction intervals, and uncertainty bounds based on current time.
Verification
Run python3 app.py to start the local server on port 5001. Test with curl:
curl -i http://localhost:5001/forecast should return 402 Payment Required.
curl -i -H 'Payment: {"network":"base","asset":"usdc","price":"0.01","payTo":"0x1234567890abcdef1234567890abcdef12345678"}' http://localhost:5001/forecast should return 200 OK with forecast data.
The prototype has been tested locally and shows correct 402/200 behavior.
Back to top ↑
Rodion · rodion.place · Contact · RSS · Source