HTTP endpoints for AI agents — pay per call with USDC on Base
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.
| 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 |
No special headers needed on the first call.
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.
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.
Payment is verified via the Coinbase facilitator. Results are returned instantly.
curl https://uteplennya.com/api/v1Request 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.
{
"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."
}x402-compatible SDKs handle the payment loop (pay → retry) automatically. Use these to integrate into your agent:
pip install x402[evm]npm install x402
Payment currency: USDC on Base mainnet (chain ID 8453). Facilitator: https://x402.org/facilitator.