{
  "openapi": "3.1.0",
  "info": {
    "title": "ContactLint API",
    "version": "1.0.0",
    "description": "Email and phone validation API."
  },
  "servers": [
    {
      "url": "https://contactlint.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      },
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "Usage": {
        "type": "object",
        "properties": {
          "billed_as": {
            "enum": [
              "free",
              "credit"
            ]
          },
          "free_used_this_month": {
            "type": "integer"
          },
          "free_limit": {
            "type": "integer"
          },
          "credits_remaining": {
            "type": "integer"
          }
        }
      },
      "EmailResult": {
        "type": "object",
        "properties": {
          "input": {
            "type": "string"
          },
          "syntax_valid": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "domain": {
            "type": [
              "string",
              "null"
            ]
          },
          "disposable": {
            "type": "boolean"
          },
          "role_address": {
            "type": "boolean"
          },
          "free_provider": {
            "type": "boolean"
          },
          "mx_found": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "a_found": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "mx_records": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "deliverable_domain": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "verdict": {
            "enum": [
              "valid",
              "risky",
              "invalid",
              "unknown"
            ]
          }
        }
      },
      "PhoneResult": {
        "type": "object",
        "properties": {
          "input": {
            "type": "string"
          },
          "parsed": {
            "type": "boolean"
          },
          "valid": {
            "type": "boolean"
          },
          "possible": {
            "type": "boolean"
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "region": {
            "type": [
              "string",
              "null"
            ]
          },
          "country_calling_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "e164": {
            "type": [
              "string",
              "null"
            ]
          },
          "national": {
            "type": [
              "string",
              "null"
            ]
          },
          "international": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "bearer": []
    },
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/v1/email/validate": {
      "post": {
        "summary": "Validate an email address",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "$ref": "#/components/schemas/EmailResult"
                    },
                    "usage": {
                      "$ref": "#/components/schemas/Usage"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Bad key"
          },
          "402": {
            "description": "Quota exceeded"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/phone/validate": {
      "post": {
        "summary": "Validate a phone number",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "phone"
                ],
                "properties": {
                  "phone": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  },
                  "carrier_lookup": {
                    "type": "boolean",
                    "description": "Paid tier, currently disabled"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "$ref": "#/components/schemas/PhoneResult"
                    },
                    "usage": {
                      "$ref": "#/components/schemas/Usage"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Bad key"
          },
          "402": {
            "description": "Quota exceeded"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "summary": "Usage and credit balance",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "MCP streamable HTTP endpoint (JSON-RPC 2.0). Tools: validate_email, validate_phone",
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          }
        }
      }
    },
    "/signup": {
      "post": {
        "summary": "Create an API key (email required, shown once)",
        "security": [],
        "responses": {
          "201": {
            "description": "Key created, shown once"
          }
        }
      }
    }
  }
}