x402 Engine — What & Why
HTTP 402 · pay-per-use
• Enable HTTP 402 Payment Required for pay-per-use access (no account/API key).
• Instant settlement (USDC, etc). 0 protocol fee.
• Great for AI agents: buy premium data on demand or charge per inference.
• Instant settlement (USDC, etc). 0 protocol fee.
• Great for AI agents: buy premium data on demand or charge per inference.
1) Auto-unlock third-party data on 402 → x402 pays → retry → continue.
2) Monetize our agent (backtest+, premium alerts, image quiz) via per-call credits.
2) Monetize our agent (backtest+, premium alerts, image quiz) via per-call credits.
High-Level Architecture
services & dataWeb app · Telegram bot · Discord bot
FastAPI/Node · JWT auth · rate limit · x402 middleware
learning-service · chartsage-service · pulsescout-service · x402-service
TimescaleDB/ClickHouse · Redis feature store · Object storage (snapshots, quiz)
Celery/Temporal (scans & 4-hour updates)
OpenTelemetry + Grafana
x402 Flow (Example)
PulseScout needs premium order book- Agent requests data → provider returns 402 Payment Required with {amount, chain, memo}.
- x402-service pays (USDC on Base/Solana) → get on-chain proof (tx/signature).
- Retry the same request with proof → access granted → proceed to analysis/alert.
Interactive Console
uses backend OpenAIConnect wallet and unlock to enable the console. Every action calls the backend agent (OpenAI) with your session token.
Parsed Output (if JSON)
proof, retry request, accounting| Key | Value |
|---|