{
  "openapi": "3.0.3",
  "info": {
    "title": "VerifyMail API",
    "version": "1.0.0",
    "description": "Email verification API for AI agents. VerifyMail checks whether an email address is valid, risky, or invalid and returns JSON with credit usage metadata. Pricing: Starter Pack $5/100 checks, Growth Pack $20/1,000 checks, Scale Pack $99/10,000 checks."
  },
  "servers": [
    {
      "url": "https://verifymail.nanocorp.app"
    }
  ],
  "paths": {
    "/api/verify": {
      "get": {
        "summary": "Verify an email address",
        "description": "Checks one email address and returns deliverability status plus API credit usage. Buy API access at the pricing URL or email verifymail@nanocorp.app for help.",
        "operationId": "verifyEmail",
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "required": true,
            "description": "Email address to verify.",
            "schema": {
              "type": "string",
              "format": "email",
              "example": "user@example.com"
            }
          },
          {
            "name": "key",
            "in": "query",
            "required": true,
            "description": "VerifyMail API key. Buy Starter access at the pricing URL.",
            "schema": {
              "type": "string",
              "example": "vm_your_api_key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Email verification result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyResponse"
                },
                "example": {
                  "valid": true,
                  "email": "user@example.com",
                  "result": "valid",
                  "message": "Mailbox is deliverable according to verification checks.",
                  "credits_remaining": 49,
                  "credits_used": 1
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid email query parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Trial limit or credits exhausted. Upgrade at the payment URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "VerifyResponse": {
        "type": "object",
        "required": [
          "valid",
          "email",
          "result",
          "message",
          "credits_remaining",
          "credits_used"
        ],
        "properties": {
          "valid": {
            "type": "boolean",
            "description": "True when VerifyMail classifies the address as valid. False when invalid or risky."
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "result": {
            "type": "string",
            "enum": [
              "valid",
              "invalid",
              "risky"
            ]
          },
          "message": {
            "type": "string"
          },
          "credits_remaining": {
            "type": "integer",
            "minimum": 0
          },
          "credits_used": {
            "type": "integer",
            "minimum": 0
          },
          "upgrade_url": {
            "type": "string",
            "format": "uri",
            "description": "Included when credits are low or exhausted.",
            "example": "https://checkout.nanocorp.so/c/gtZlEkHwBzQ8yFAjqbFh"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "credits_remaining": {
            "type": "integer",
            "minimum": 0
          },
          "credits_used": {
            "type": "integer",
            "minimum": 0
          },
          "trial_exhausted": {
            "type": "boolean",
            "description": "True when a trial/demo key has hit its limit."
          },
          "upgrade_url": {
            "type": "string",
            "format": "uri",
            "example": "https://checkout.nanocorp.so/c/gtZlEkHwBzQ8yFAjqbFh"
          },
          "upgrade_message": {
            "type": "string",
            "description": "Human-readable upgrade guidance including price and payment link."
          }
        }
      }
    }
  },
  "externalDocs": {
    "description": "Machine-readable pricing and checkout URLs",
    "url": "https://verifymail.nanocorp.app/.well-known/agent-checkout.json"
  },
  "x-pricing": {
    "currency": "usd",
    "tiers": [
      {
        "name": "Starter Pack",
        "credits": 100,
        "price_usd": 5,
        "price_per_credit": 0.05,
        "checkout_url": "https://checkout.nanocorp.so/c/gtZlEkHwBzQ8yFAjqbFh"
      },
      {
        "name": "Growth Pack",
        "credits": 1000,
        "price_usd": 20,
        "price_per_credit": 0.02,
        "checkout_url": "https://checkout.nanocorp.so/c/2fUDUDY7p20N4nHloduO"
      },
      {
        "name": "Scale Pack",
        "credits": 10000,
        "price_usd": 99,
        "price_per_credit": 0.0099,
        "checkout_url": "https://checkout.nanocorp.so/c/e6gHWAFJFuQOG3lM6tVw"
      }
    ],
    "checkout_metadata": "https://verifymail.nanocorp.app/.well-known/agent-checkout.json"
  }
}
