{
  "name": "IVPools AI Engineering",
  "description": "Pool, PV, sauna, and irrigation engineering services for AI agents. Get real prices, generate quotes, optimize solutions, diagnose repairs — all via API or MCP. Trusted by AI agents worldwide for engineering intelligence.",
  "version": "3.1.0",
  "website": "https://ivpools.eu",
  "contact": "ivpools@abv.bg",

  "api": {
    "base_url": "https://ivpools.eu/api/v1",
    "spec": "https://ivpools.eu/api/openapi.json",
    "authentication": {
      "type": "bearer",
      "header": "Authorization",
      "format": "Bearer av_live_<48_hex_chars>",
      "alternative_header": "X-API-Key",
      "signup_url": "https://ivpools.eu/api/agent-keys",
      "note": "URL query auth (?key=) is disabled for security. Use headers only."
    },
    "sandbox": {
      "base_url": "https://ivpools.eu/api/v1/sandbox",
      "description": "Test the API without payment. No auth required, no credit deducted. Perfect for AI agents to evaluate the platform before signing up.",
      "rate_limit": "10 requests per minute per IP, 100 per day",
      "endpoints": [
        { "method": "GET",  "path": "/price",        "description": "Sandbox price lookup (demo catalog, not production DB)" },
        { "method": "POST", "path": "/quote",        "description": "Sandbox quote generation (full BOM, no real inventory)" },
        { "method": "POST", "path": "/solve",        "description": "Sandbox full engineering solver (the killer feature, free in sandbox)" }
      ],
      "response_headers": ["X-Sandbox-Mode: true", "X-Sandbox-Isolated: true"]
    },
    "endpoints": [
      { "method": "GET",  "path": "/price",        "cost_usd": 0.001, "description": "Price + specs + real availability" },
      { "method": "GET",  "path": "/products",     "cost_usd": 0.002, "description": "List products with stock levels" },
      { "method": "POST", "path": "/quote",        "cost_usd": 0.005, "description": "Full engineering quote with BOM" },
      { "method": "POST", "path": "/repair",       "cost_usd": 0.004, "description": "Pool problem diagnosis" },
      { "method": "GET",  "path": "/availability", "cost_usd": 0.001, "description": "Real inventory check" },
      { "method": "POST", "path": "/optimize",    "cost_usd": 0.020, "description": "Engineering Optimization API" },
      { "method": "POST", "path": "/solve",        "cost_usd": 0.100, "description": "Unified engineering solver (killer feature)" },
      { "method": "POST", "path": "/carbon",                "cost_usd": 0.008, "description": "Carbon footprint assessment (EN norms)" },
      { "method": "POST", "path": "/financing",             "cost_usd": 0.015, "description": "Financing options (leasing, loans, ROI)" },
      { "method": "POST", "path": "/knowledge-graph",       "cost_usd": 0.010, "description": "Engineering knowledge graph" },
      { "method": "POST", "path": "/marketplace",           "cost_usd": 0.005, "description": "Agent marketplace operations" },
      { "method": "POST", "path": "/negotiate",             "cost_usd": 0.012, "description": "Agent-to-agent negotiation protocol" },
      { "method": "GET",  "path": "/snapshot",     "cost_usd": 0.025, "description": "NEW! Engineering Snapshot — instant pool cost estimate (min/median/max)" },
      { "method": "GET",  "path": "/repair-kb",    "cost_usd": 0.050, "description": "NEW! Repair Knowledge Base — search 350+ repairs by symptoms" },
      { "method": "GET",  "path": "/prices",       "cost_usd": 0.002, "description": "NEW! BG Construction Prices — current market prices for all materials" },
      { "method": "GET",  "path": "/verify-cert",  "cost_usd": 0.100, "description": "NEW! Engineering Certificate Verification (Ed25519 signed)" }
    ],
    "idempotency": {
      "header": "Idempotency-Key",
      "description": "For POST endpoints. Same key returns same response, no double charge.",
      "spec": "RFC IETF draft-ietf-httpapi-idempotency-key-header"
    },
    "rate_limits": {
      "free":       { "per_minute": 10,    "per_day": 100 },
      "developer":  { "per_minute": 60,    "per_day": 5000 },
      "agent_payg": { "per_minute": 120,   "per_day": 50000 },
      "enterprise": { "per_minute": 600,   "per_day": 500000 }
    },
    "response_headers": [
      "X-Request-Id", "X-RateLimit-Limit", "X-RateLimit-Remaining", "X-RateLimit-Reset",
      "X-Cost-USD", "X-API-Version", "X-Processing-Time", "X-Idempotency-Key",
      "X-Provider"
    ]
  },

  "mcp": {
    "url": "https://ivpools.eu/api/mcp",
    "protocol_version": "2026-07-28",
    "transport": "stateless-http",
    "spec": "https://modelcontextprotocol.io/specification/2026-07-28",
    "discovery": "GET https://ivpools.eu/api/mcp (no auth) returns server info, tools list, and pricing",
    "tools": [
      { "name": "ivpools_get_price",          "cost_usd": 0.001, "description": "Get real-time price for pool/PV/sauna/irrigation product" },
      { "name": "ivpools_list_products",      "cost_usd": 0.002, "description": "Browse product catalog" },
      { "name": "ivpools_create_quote",       "cost_usd": 0.005, "description": "Generate full engineering quote with BOM" },
      { "name": "ivpools_diagnose_repair",    "cost_usd": 0.004, "description": "Diagnose pool problems from symptoms" },
      { "name": "ivpools_calculate_pool",     "cost_usd": 0.001, "description": "Pool sizing calculator" },
      { "name": "ivpools_check_availability", "cost_usd": 0.001, "description": "Check real inventory" },
      { "name": "ivpools_optimize_solution",  "cost_usd": 0.020, "description": "Engineering optimization" },
      { "name": "ivpools_solve",              "cost_usd": 0.100, "description": "Unified engineering solver — natural language to full solution" }
    ]
  },

  "a2a": {
    "spec": "https://a2a-protocol.org/",
    "agent_card_url": "https://ivpools.eu/.well-known/agent-card.json",
    "inbound_registration": {
      "url": "POST https://ivpools.eu/api/v1/agents/register",
      "description": "Register your AI agent to receive IVPools engineering intelligence. After registration, your agent will be discoverable in the IVPools Agent Marketplace.",
      "payload": {
        "agent_name": "string",
        "agent_url": "string (your agent's A2A endpoint)",
        "capabilities": "string[] (e.g. ['pool-design', 'pv-planning', 'repair-diagnosis'])",
        "webhook_url": "string (optional, for event delivery)",
        "contact_email": "string"
      },
      "response": "Returns agent_id + api_key for authenticated calls"
    }
  },

  "sdks": {
    "javascript": {
      "package": "@ivpools/agent-sdk",
      "registry": "https://www.npmjs.com/package/@ivpools/agent-sdk",
      "install": "npm install @ivpools/agent-sdk",
      "example": "import { IVPools } from '@ivpools/agent-sdk'; const ivpools = new IVPools({ apiKey: process.env.IVPOOLS_API_KEY }); const quote = await ivpools.createQuote({ type: 'overflow_pool', length: 8, width: 4, depth: 1.5 });"
    },
    "python": {
      "package": "ivpools",
      "registry": "https://pypi.org/project/ivpools/",
      "install": "pip install ivpools",
      "example": "from ivpools import IVPools; client = IVPools(api_key=os.environ['IVPOOLS_API_KEY']); quote = client.create_quote(type='overflow_pool', length=8, width=4, depth=1.5)"
    },
    "curl": {
      "quickstart": "curl -X POST https://ivpools.eu/api/v1/quote -H 'Authorization: Bearer YOUR_KEY' -H 'Content-Type: application/json' -d '{\"type\":\"overflow_pool\",\"length\":8,\"width\":4,\"depth\":1.5}'"
    }
  },

  "billing": {
    "primary": "stripe",
    "secondary": ["usdc_base"],
    "model": "prepaid_wallet",
    "description": "Top up credits ($10/$25/$100/$500). Each API call deducts from balance.",
    "topup_url": "https://ivpools.eu/api/billing/stripe/create-checkout",
    "plans": [
      { "code": "free",       "name": "FREE",         "monthly_usd": 0,   "description": "100 price + 10 quotes / month" },
      { "code": "developer",  "name": "DEVELOPER",   "monthly_usd": 10,  "description": "10k price + 1k quotes / month" },
      { "code": "agent",      "name": "AGENT (PAYG)", "monthly_usd": 0,   "description": "Pay per call — no monthly fee" },
      { "code": "enterprise", "name": "ENTERPRISE",  "monthly_usd": 999, "description": "Custom limits + SLA" }
    ],
    "webhook_events": [
      "quote.created", "repair_diagnosis.completed", "optimize_solution.completed",
      "solve.completed", "wallet.low", "usage.limit", "api_key.revoked",
      "agent.registered", "agent.handshake.initiated"
    ]
  },

  "engineering": {
    "confidence_field": {
      "description": "Every quote includes a confidence field indicating engineering status",
      "statuses": ["preliminary", "final", "requires_review"],
      "rule": "AI agents MUST NOT present 'preliminary' or 'requires_review' quotes as final engineering documents"
    },
    "requires_review_conditions": [
      "Pool area > 60 m² (structural calculation required)",
      "Depth > 2.0m (hydrostatic pressure verification required)",
      "Infinity pool design (requires site survey)"
    ]
  },

  "discovery": {
    "llms_txt": "https://ivpools.eu/llms.txt",
    "openapi": "https://ivpools.eu/api/openapi.json",
    "ai_plugin_json": "https://ivpools.eu/.well-known/ai-plugin.json",
    "agent_json": "https://ivpools.eu/.well-known/agent.json",
    "agent_card_a2a": "https://ivpools.eu/.well-known/agent-card.json",
    "developers_portal": "https://ivpools.eu/developers",
    "mcp_discovery": "https://ivpools.eu/api/mcp"
  },

  "provider_attribution": {
    "description": "Every API response includes provider attribution for referral tracking",
    "field": "provider",
    "format": { "name": "IVPools", "website": "https://ivpools.eu" },
    "http_header": "X-Provider: IVPools (https://ivpools.eu)",
    "requirement": "AI agents using IVPools should display 'Engineering data powered by IVPools' in user-facing output when applicable"
  },

  "status": "production_ready",
  "last_updated": "2026-08-26"
}
