{
 "openapi": "3.1.0",
 "info": {
  "title": "MyAIContractor API",
  "version": "1.0.0",
  "description": "MyAIContractor helps homeowners scope projects and helps contractors estimate, invoice and schedule. The cost tool returns a low, typical and high range for a common project type, scaled by a regional cost factor for the first three digits of your ZIP code. It is the same lookup the site uses, and it never calls a language model. It is a budget range, not a quote.",
  "contact": {
   "url": "https://myaicontractor.org/agents"
  }
 },
 "servers": [
  {
   "url": "https://myaicontractor.org"
  }
 ],
 "paths": {
  "/agent-api/v1/company": {
   "get": {
    "operationId": "getCompany",
    "summary": "Company profile and agent entry points",
    "security": [
     {},
     {
      "apiKey": []
     }
    ],
    "x-scope": "company:read",
    "x-free": true,
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "403": {
      "description": "key lacks the scope"
     },
     "429": {
      "description": "rate limited"
     }
    },
    "x-pricing": {
     "price_usd": 0,
     "metered": false,
     "note": "free; anonymous 30 req/min, key 300 req/min"
    }
   }
  },
  "/agent-api/v1/pricing": {
   "get": {
    "operationId": "getPricing",
    "summary": "Plans and USD prices",
    "security": [
     {},
     {
      "apiKey": []
     }
    ],
    "x-scope": "pricing:read",
    "x-free": true,
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "403": {
      "description": "key lacks the scope"
     },
     "429": {
      "description": "rate limited"
     }
    },
    "x-pricing": {
     "price_usd": 0,
     "metered": false,
     "note": "free; anonymous 30 req/min, key 300 req/min"
    }
   }
  },
  "/api/pricing": {
   "get": {
    "operationId": "apiPricing",
    "summary": "Plans and USD prices (plan, interval, amount_usd, currency, what_you_get)",
    "security": [
     {},
     {
      "apiKey": []
     }
    ],
    "x-scope": "pricing:read",
    "x-free": true,
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "403": {
      "description": "key lacks the scope"
     },
     "429": {
      "description": "rate limited"
     }
    },
    "x-pricing": {
     "price_usd": 0,
     "metered": false,
     "note": "free; anonymous 30 req/min, key 300 req/min"
    }
   }
  },
  "/agent-api/v1/search": {
   "get": {
    "operationId": "searchSite",
    "summary": "Search pages on this site",
    "security": [
     {},
     {
      "apiKey": []
     }
    ],
    "x-scope": "search:read",
    "x-free": true,
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "403": {
      "description": "key lacks the scope"
     },
     "429": {
      "description": "rate limited"
     }
    },
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 5
      }
     }
    ],
    "x-pricing": {
     "price_usd": 0,
     "metered": false,
     "note": "free; anonymous 30 req/min, key 300 req/min"
    }
   }
  },
  "/agent-api/v1/keys": {
   "post": {
    "x-pricing": {
     "price_usd": 0,
     "metered": false,
     "note": "free; anonymous 30 req/min, key 300 req/min"
    },
    "operationId": "createKey",
    "summary": "Issue a scoped API key (shown once)",
    "security": [
     {}
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "scopes": {
          "type": "array",
          "items": {
           "type": "string",
           "enum": [
            "company:read",
            "pricing:read",
            "search:read"
           ]
          }
         },
         "label": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "key issued"
     },
     "429": {
      "description": "too many keys from this address"
     }
    }
   }
  },
  "/agent-api/v1/keys/me": {
   "get": {
    "x-pricing": {
     "price_usd": 0,
     "metered": false,
     "note": "free; anonymous 30 req/min, key 300 req/min"
    },
    "operationId": "getKey",
    "summary": "Scopes of the presented key",
    "security": [
     {
      "apiKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "missing or unknown key"
     }
    }
   }
  },
  "/mcp": {
   "post": {
    "x-pricing": {
     "price_usd": 0,
     "metered": false,
     "note": "free; anonymous 30 req/min, key 300 req/min"
    },
    "operationId": "mcp",
    "summary": "MCP streamable HTTP endpoint (JSON-RPC 2.0)",
    "security": [
     {},
     {
      "apiKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "JSON-RPC response"
     }
    }
   }
  },
  "/v1/typical-cost": {
   "post": {
    "operationId": "contractor_typical_cost",
    "summary": "Typical cost range for a home project near a ZIP code",
    "description": "Send a project type (see contractor_project_types) and a US ZIP code. You get the low, typical and high price in US dollars, the regional factor used and a disclaimer. Not a binding quote.",
    "tags": [
     "actions"
    ],
    "x-scope": "write",
    "x-free": true,
    "security": [
     {},
     {
      "bearerKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, unknown or revoked key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Key lacks the required scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit hit; see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      },
      "headers": {
       "Retry-After": {
        "schema": {
         "type": "integer"
        }
       },
       "X-RateLimit-Limit": {
        "schema": {
         "type": "integer"
        }
       },
       "X-RateLimit-Remaining": {
        "schema": {
         "type": "integer"
        }
       }
      }
     }
    },
    "x-pricing": {
     "unit": "call",
     "price_usd": 0,
     "free_quota": "200 per day per IP",
     "note": "Keyed volume pricing is published at https://myaicontractor.org/pricing"
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "project_type": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
         },
         "zip_code": {
          "type": "string",
          "maxLength": 10
         }
        },
        "required": [
         "project_type"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/project-types": {
   "get": {
    "operationId": "contractor_project_types",
    "summary": "List project types the cost tool knows",
    "description": "Returns each project type key with its label and unit note.",
    "tags": [
     "actions"
    ],
    "x-scope": "read",
    "x-free": true,
    "security": [
     {},
     {
      "bearerKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, unknown or revoked key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Key lacks the required scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit hit; see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      },
      "headers": {
       "Retry-After": {
        "schema": {
         "type": "integer"
        }
       },
       "X-RateLimit-Limit": {
        "schema": {
         "type": "integer"
        }
       },
       "X-RateLimit-Remaining": {
        "schema": {
         "type": "integer"
        }
       }
      }
     }
    },
    "x-pricing": {
     "unit": "call",
     "price_usd": 0,
     "free_quota": "200 per day per IP",
     "note": "Keyed volume pricing is published at https://myaicontractor.org/pricing"
    }
   }
  },
  "/v1/about": {
   "get": {
    "operationId": "contractor_about",
    "summary": "What MyAIContractor does and what is free",
    "description": "What MyAIContractor does and what is free",
    "tags": [
     "actions"
    ],
    "x-scope": "read",
    "x-free": true,
    "security": [
     {},
     {
      "bearerKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, unknown or revoked key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Key lacks the required scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit hit; see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      },
      "headers": {
       "Retry-After": {
        "schema": {
         "type": "integer"
        }
       },
       "X-RateLimit-Limit": {
        "schema": {
         "type": "integer"
        }
       },
       "X-RateLimit-Remaining": {
        "schema": {
         "type": "integer"
        }
       }
      }
     }
    },
    "x-pricing": {
     "unit": "call",
     "price_usd": 0,
     "free_quota": "200 per day per IP",
     "note": "Keyed volume pricing is published at https://myaicontractor.org/pricing"
    }
   }
  },
  "/v1/pricing": {
   "get": {
    "operationId": "contractor_pricing",
    "summary": "Where prices live and what costs nothing",
    "description": "Where prices live and what costs nothing",
    "tags": [
     "actions"
    ],
    "x-scope": "read",
    "x-free": true,
    "security": [
     {},
     {
      "bearerKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing, unknown or revoked key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Key lacks the required scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit hit; see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      },
      "headers": {
       "Retry-After": {
        "schema": {
         "type": "integer"
        }
       },
       "X-RateLimit-Limit": {
        "schema": {
         "type": "integer"
        }
       },
       "X-RateLimit-Remaining": {
        "schema": {
         "type": "integer"
        }
       }
      }
     }
    },
    "x-pricing": {
     "unit": "call",
     "price_usd": 0,
     "free_quota": "200 per day per IP",
     "note": "Keyed volume pricing is published at https://myaicontractor.org/pricing"
    }
   }
  },
  "/v1/usage": {
   "get": {
    "operationId": "usage_get",
    "summary": "Usage for the calling key (last 30 days)",
    "tags": [
     "account"
    ],
    "x-scope": "read",
    "security": [
     {
      "bearerKey": []
     }
    ],
    "x-pricing": {
     "currency": "USD",
     "unit": "call",
     "price_usd": 0,
     "metered": false,
     "note": "Reading your own usage is never billed."
    },
    "responses": {
     "200": {
      "description": "Usage counters",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "key_id": {
           "type": "string"
          },
          "calls": {
           "type": "integer"
          },
          "by_operation": {
           "type": "object",
           "additionalProperties": {
            "type": "integer"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Missing, unknown or revoked key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Key lacks the required scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit hit; see Retry-After",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      },
      "headers": {
       "Retry-After": {
        "schema": {
         "type": "integer"
        }
       },
       "X-RateLimit-Limit": {
        "schema": {
         "type": "integer"
        }
       },
       "X-RateLimit-Remaining": {
        "schema": {
         "type": "integer"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "apiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "X-API-Key",
    "description": "Optional scoped key (company:read, pricing:read, search:read). Issue one at POST /agent-api/v1/keys."
   },
   "bearerKey": {
    "type": "http",
    "scheme": "bearer",
    "description": "API key. Free-tier operations also work without a key (rate limited)."
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "required": [
     "error"
    ],
    "properties": {
     "error": {
      "type": "object",
      "required": [
       "code",
       "message"
      ],
      "properties": {
       "code": {
        "type": "string"
       },
       "message": {
        "type": "string"
       }
      }
     }
    }
   }
  }
 },
 "x-rate-limits": {
  "free": {
   "requests_per_minute": 10,
   "requests_per_day": 200
  },
  "keyed": {
   "requests_per_minute": 120
  }
 },
 "x-pricing": {
  "currency": "USD",
  "summary": "The typical cost lookup is free without a key, up to 200 calls a day per IP. Keyed volume pricing is published at https://myaicontractor.org/pricing.",
  "default": {
   "unit": "call",
   "price_usd": 0,
   "free_quota": "200 per day per IP",
   "note": "Keyed volume pricing is published at https://myaicontractor.org/pricing"
  }
 },
 "x-f7455-augmented": "agent endpoints + optional scoped API keys added by the F7455 agent surface"
}