Integration guide

One heat-risk function, four interfaces

The website, JSON API, x402, MPP, and MCP all call the same validated executeService(input) handler. Choose a city planning baseline or provide current conditions.

Input

Send exactly one of city_slug or conditions. Paid HTTP calls also require an Idempotency-Key header containing 8–128 URL-safe characters.

{
  "tier": "standard",
  "conditions": {
    "label": "Madrid outdoor work",
    "temperature_c": 38,
    "feels_like_c": 41,
    "humidity_percent": 31,
    "uv_index": 10,
    "wind_kph": 9,
    "overnight_low_c": 25,
    "peak_window": "13:00-20:00"
  },
  "exposure": {
    "exertion": "high",
    "shade": "none",
    "duration_minutes": 120
  }
}

Limited browser preview

POST /api/v1/preview is free but limited to 5 requests per minute. It returns the preview tier and points to paid routes after the limit.

curl -X POST https://elnino.wiki/api/v1/preview \
  -H "Content-Type: application/json" \
  -d '{"tier":"preview","city_slug":"phoenix"}'

x402 v2

Call a tier endpoint without PAYMENT-SIGNATURE to receive HTTP 402 and the authoritative PAYMENT-REQUIRED header. Sign through a compatible x402 client, retry the same request, and read the settlement from PAYMENT-RESPONSE.

POST /api/x402/v1/preview  $0.02
POST /api/x402/v1/execute          $1.00
POST /api/x402/v1/premium  $3.00

Network: eip155:8453 (Base mainnet)
Asset: USDC
Scheme: exact

MPP one-time charge

MPP returns HTTP 402 with WWW-Authenticate: Payment. A payment-aware client retries with Authorization: Payment …; the successful response includes Payment-Receipt.

POST /api/mpp/v1/preview  $0.02
POST /api/mpp/v1/execute          $1.00
POST /api/mpp/v1/premium  $3.00

Method: tempo
Intent: charge
Asset: USDC

MCP Streamable HTTP

Connect to https://elnino.wiki/mcp. The free service_info tool explains the service. Paid tools issue the native MPP MCP error -32042, accept the credential in request metadata, and return a receipt in result metadata.

{
  "mcpServers": {
    "elnino-heat-risk": {
      "url": "https://elnino.wiki/mcp"
    }
  }
}

Errors and safety

  • 400 — invalid JSON, schema, or idempotency key
  • 402 — payment required; inspect protocol headers
  • 413 — body exceeds 16384 bytes
  • 429 — rate limit reached
  • 503 — operator payment configuration is not ready

Never expose wallet credentials. Set a hard client-side maximum spend. Treat the returned briefing as decision support and check official local alerts.