Any AI agent that speaks HTTP can use the Uteplennya insulation calculator directly, without a browser. Paid endpoints use the open x402 protocol — the agent sends a request, receives a 402 Payment Required response with USDC payment details, pays $0.001 on Base mainnet, and retries to get results. Free endpoints require no payment at all.

Endpoints

Method Path Cost Description
GET /api/v1 free API schema, endpoint list, and live payment configuration
GET /api/v1/materials free Full material catalogue — 14 insulation types + 21 wall materials with λ values
GET /api/v1/climate/{region} $0.001 USDC Heating season data (monthly avg temps & days). Supported: kyiv
POST /api/v1/calculate $0.001 USDC Full insulation calculation — energy savings, total cost, payback period for thicknesses 20–200 mm

How x402 payment works

1
Agent sends a normal request

No special headers needed on the first call.

2
Server replies 402 Payment Required

The response includes a PAYMENT-REQUIRED header containing a base64-encoded JSON object with the amount, USDC contract address on Base mainnet, recipient wallet, and the Coinbase x402 facilitator URL.

3
Agent pays and retries

The agent (or its x402 SDK) signs a USDC transferWithAuthorization (EIP-3009) transaction and retries with a PAYMENT-SIGNATURE header containing the proof of payment.

4
Server verifies and responds

Payment is verified via the Coinbase facilitator. Results are returned instantly.

Example — discover the API (free)

curl https://uteplennya.com/api/v1

Example — run a calculation

Request body for POST /api/v1/calculate:

{
  "wall_area_m2": 120,
  "indoor_temperature": 20,
  "heating_efficiency": 0.9,
  "energy_tariff_uah_kwh": 4.32,
  "wall_layers": [
    { "material_name": "Brick", "thickness": 0.38, "lambda_value": 0.7 }
  ],
  "insulation_material": "mineral_wool"
}

Available values for insulation_material: mineral_wool, eps, xps, polyurethane. Optionally include climate_data (array of {month, temperature, days}) — defaults to Kyiv if omitted.

Response (after payment)

{
  "success": true,
  "input": {
    "wall_area_m2": 120,
    "indoor_temperature_c": 20,
    "insulation_material": "Mineral Wool",
    "energy_tariff_uah_kwh": 4.32
  },
  "results": [
    { "thickness_mm": 20,  "energy_saved_kwh": 4741,  "money_saved_uah": 22757, "total_cost_uah": 45000, "payback_years": 1.98 },
    { "thickness_mm": 40,  "energy_saved_kwh": 7002,  "money_saved_uah": 33610, "total_cost_uah": 48000, "payback_years": 1.43 },
    { "thickness_mm": 100, "energy_saved_kwh": 9809,  "money_saved_uah": 47083, "total_cost_uah": 57000, "payback_years": 1.21 },
    ...
  ],
  "optimal_thickness": { "thickness_mm": 100, "payback_years": 1.21, ... },
  "recommendation": "100mm gives the best payback at 1.21 years."
}

Agent SDKs

x402-compatible SDKs handle the payment loop (pay → retry) automatically. Use these to integrate into your agent:

Payment currency: USDC on Base mainnet (chain ID 8453). Facilitator: https://x402.org/facilitator.