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.

Pay by wallet (x402) paid-api-preflight

Example

Example answer
{
  "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

FieldTypeRequiredWhat it is
urlstringYesThe paid API endpoint URL to check before paying

Output fields

How reliably each field appears in a successful answer.

FieldTypeAppears
urlstringAlways (present in every successful answer)
issuesarrayAlways (present in every successful answer)
serverstring or nullUsually (present for most inputs)
ssl_validbooleanAlways (present in every successful answer)
status_codeintegerAlways (present in every successful answer)
is_reachablebooleanAlways (present in every successful answer)
recommendationone of proceed, caution, avoidAlways (present in every successful answer)
payment_detailsobjectAlways (present in every successful answer)
payment_protocolone of L402, x402, MPP, unknownAlways (present in every successful answer)
response_time_msintegerAlways (present in every successful answer)
facilitator_reachableboolean or nullUsually (present for most inputs)
payment_handshake_validbooleanAlways (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
  }'

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.