x402station.io API reference
Preflight endpoint risk check
Synchronous risk check before an agent pays an unfamiliar x402 endpoint.
This HTML page is served by GET /api/v1/preflight. The paid API operation remains POST /api/v1/preflight.
x402 challenge example
HTTP/1.1 402 Payment Required
payment-required: <base64 PaymentRequiredResponse>
www-authenticate: x402
content-type: application/json; charset=utf-8
{
"x402Version": 2,
"error": "Payment required",
"resource": {
"url": "https://x402station.io/api/v1/preflight",
"description": "Preflight endpoint risk check"
},
"accepts": [
{
"scheme": "exact",
"network": "eip155:8453",
"asset": "USDC",
"amount": "1000",
"payTo": "0x4053338C7cB38624C0bc23c900F78Cf8470b4E38",
"maxTimeoutSeconds": 300
}
]
}
Request body
{
"url": "https://api.example.com/x402-endpoint"
}
Success response
{
"ok": true,
"warnings": [],
"metadata": {
"service_id": "svc_example",
"price": {
"amount": "0.005",
"currency": "USDC",
"network": "Base"
},
"uptime_pct_1h": 100,
"established": true
},
"risk_score": 8,
"confidence": 0.86,
"recommended_action": "pay"
}
Error codes
| status | meaning |
|---|---|
400 | Malformed JSON body, invalid URL, or missing required field. |
402 | Payment required. Decode payment-required, sign x402, retry. |
503 | Query/probe pipeline timeout. Treat as failed preflight; do not pay target blindly. |
422 | Target URL is syntactically valid but not processable as an x402 endpoint. |
Notes
- ok=false means at least one critical signal fired.
- unknown_endpoint is billed and means no independent history, not safety.