{
  "openapi": "3.0.0",
  "info": {
    "title": "AI Email Reply Generator API",
    "version": "1.0.0",
    "description": "Generate structured email replies, subject suggestions, and reply variations for common business scenarios."
  },
  "servers": [
    {
      "url": "https://ai-email-reply-generator-api.vercel.app"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "summary": "List all available endpoints",
        "responses": {
          "200": {
            "description": "API index"
          }
        }
      }
    },
    "/openapi": {
      "get": {
        "summary": "Get OpenAPI spec",
        "responses": {
          "200": {
            "description": "OpenAPI JSON spec"
          }
        }
      }
    },
    "/intents": {
      "get": {
        "summary": "Get supported reply intents",
        "responses": {
          "200": {
            "description": "List of intents"
          }
        }
      }
    },
    "/tones": {
      "get": {
        "summary": "Get supported tones",
        "responses": {
          "200": {
            "description": "List of tones"
          }
        }
      }
    },
    "/generate-reply": {
      "post": {
        "summary": "Generate one email reply",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "incomingMessage": {
                    "type": "string",
                    "example": "Can you send an update on the issue?"
                  },
                  "intent": {
                    "type": "string",
                    "example": "support"
                  },
                  "tone": {
                    "type": "string",
                    "example": "professional"
                  },
                  "length": {
                    "type": "string",
                    "example": "medium"
                  },
                  "recipientName": {
                    "type": "string",
                    "example": "Sarah"
                  },
                  "senderName": {
                    "type": "string",
                    "example": "Alex"
                  },
                  "senderRole": {
                    "type": "string",
                    "example": "customer support manager"
                  },
                  "desiredOutcome": {
                    "type": "string",
                    "example": "provide the customer with clarity and next steps"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated reply"
          }
        }
      }
    },
    "/generate-variations": {
      "post": {
        "summary": "Generate multiple email reply variations",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "incomingMessage": {
                    "type": "string"
                  },
                  "intent": {
                    "type": "string"
                  },
                  "length": {
                    "type": "string"
                  },
                  "recipientName": {
                    "type": "string"
                  },
                  "senderName": {
                    "type": "string"
                  },
                  "senderRole": {
                    "type": "string"
                  },
                  "desiredOutcome": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated variations"
          }
        }
      }
    }
  }
}