Paid API Pre-flight Check
Check an API's reachability, HTTPS use and HTTP 402 payment response for L402, x402 or MPP. Returns payment details and a proceed, caution or avoid result.
paid-api-preflight Example
{
"url": "https://api.example.com/v1/data",
"issues": [],
"server": "nginx",
"ssl_valid": true,
"status_code": 402,
"is_reachable": true,
"recommendation": "proceed",
"payment_details": {
"amount": "1000000",
"scheme": "exact",
"network": "base-sepolia",
"has_pay_to": true,
"has_accepts": true
},
"payment_protocol": "x402",
"response_time_ms": 340,
"facilitator_reachable": true,
"payment_handshake_valid": true
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
url | string | Yes | The paid API endpoint URL to check before paying |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
url | string | Always (present in every successful answer) |
issues | array | Always (present in every successful answer) |
server | string or null | Usually (present for most inputs) |
ssl_valid | boolean | Always (present in every successful answer) |
status_code | integer | Always (present in every successful answer) |
is_reachable | boolean | Always (present in every successful answer) |
recommendation | one of proceed, caution, avoid | Always (present in every successful answer) |
payment_details | object | Always (present in every successful answer) |
payment_protocol | one of L402, x402, MPP, unknown | Always (present in every successful answer) |
response_time_ms | integer | Always (present in every successful answer) |
facilitator_reachable | boolean or null | Usually (present for most inputs) |
payment_handshake_valid | boolean | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "paid-api-preflight",
"inputs": {
"url": "https://httpbin.org/get"
},
"max_price_cents": 2
}' {
"tool": "strale_execute",
"arguments": {
"slug": "paid-api-preflight",
"inputs": {
"url": "https://httpbin.org/get"
},
"max_price_cents": 2
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "paid-api-preflight",
inputs: {
"url": "https://httpbin.org/get"
},
max_price_cents: 2,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="paid-api-preflight",
inputs={
"url": "https://httpbin.org/get",
},
max_price_cents=2,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i 'https://api.strale.io/x402/v2/paid-api-preflight?url=https%3A%2F%2Fhttpbin.org%2Fget' Limitations
Only L402, x402 and MPP are detected
Parses L402 (Lightning), x402 (Base/Coinbase), and MPP (Stripe/Tempo) protocols only. Endpoints using proprietary or non-standard payment headers will return payment_protocol: "unknown" with a non-402 or unparsed 402 response.
What to do instead: For unknown protocols, inspect the raw response headers manually via the payment_details field which includes the raw header value.
Endpoint must return HTTP 402 to validate payment handshake
If the endpoint requires specific request parameters (POST body, auth token, etc.) to trigger the paywall, a plain GET request may return 200 or 401 instead of 402. The handshake check will be skipped and recommendation will be "proceed" based on reachability only.
What to do instead: Pre-flight is most accurate for endpoints that gate on HTTP 402 without requiring a specific payload. For parameterized paywalls, verify the protocol docs directly.
Facilitator reachability check uses HEAD with 2s timeout
The x402 facilitator reachability check sends a HEAD request with a 2-second timeout. Slow facilitators may appear unreachable even if functional.
What to do instead: Treat facilitator_reachable: false as a caution signal, not a hard block.
Related tools
- Address Validation €0.03
- Age Check €0.02
- Bank BIC Lookup €0.05
- Bulk Email Validation €0.15
- Business Day Check €0.02
- Company ID Detection €0.05