{
  "openapi": "3.1.0",
  "info": {
    "title": "Ahmed Mohamed Portfolio API",
    "description": "Public API for Ahmed Mohamed's portfolio site. Provides portfolio content in Markdown format and a contact form endpoint for inquiries.",
    "version": "1.0.0",
    "contact": {
      "name": "Ahmed Mohamed",
      "email": "info@ahmedinnov.com",
      "url": "https://ahmedinnov.com"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://ahmedinnov.com"
    },
    "x-logo": {
      "url": "https://ahmedinnov.com/favicon.svg",
      "altText": "Ahmed Innovation logo"
    }
  },
  "servers": [
    {
      "url": "https://ahmedinnov.com",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "content",
      "description": "Portfolio content endpoints"
    },
    {
      "name": "contact",
      "description": "Contact and inquiry endpoints"
    }
  ],
  "paths": {
    "/api/md": {
      "get": {
        "tags": ["content"],
        "operationId": "getMarkdown",
        "summary": "Get portfolio content as Markdown",
        "description": "Returns the complete portfolio of Ahmed Mohamed in Markdown format. Includes: about, services, tech stack, featured projects, client testimonials, process, FAQ, and contact info. Designed for AI agents, LLMs, and scrapers that prefer structured text.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Markdown portfolio content",
            "headers": {
              "Content-Type": {
                "description": "text/markdown when Accept header includes text/markdown or text/plain, otherwise text/plain",
                "schema": { "type": "string" }
              },
              "Cache-Control": {
                "description": "Cache directive",
                "schema": { "type": "string", "example": "public, max-age=3600" }
              },
              "X-Robots-Tag": {
                "description": "Prevents search engine indexing of this endpoint",
                "schema": { "type": "string", "example": "noindex" }
              }
            },
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string",
                  "description": "Full portfolio content in Markdown"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "Full portfolio content as plain text"
                }
              }
            }
          }
        }
      }
    },
    "/contact.php": {
      "post": {
        "tags": ["contact"],
        "operationId": "sendContact",
        "summary": "Send a contact message to Ahmed Mohamed",
        "description": "Submit an inquiry or project request. The message is delivered to Ahmed Mohamed via email within minutes. He replies within 24 hours.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactRequest"
              },
              "examples": {
                "project-inquiry": {
                  "summary": "Project inquiry",
                  "value": {
                    "name": "Sarah Johnson",
                    "email": "sarah@startup.com",
                    "company": "Startup Inc.",
                    "budget": "$5,000 – $10,000",
                    "message": "Hi Ahmed, I need a Flutter app for my e-commerce platform. Can we schedule a discovery call?"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message sent successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/sitemap.xml": {
      "get": {
        "tags": ["content"],
        "operationId": "getSitemap",
        "summary": "XML Sitemap",
        "description": "Returns the XML sitemap containing all portfolio pages and project case studies.",
        "responses": {
          "200": {
            "description": "XML sitemap",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string",
                  "description": "Sitemap XML"
                }
              }
            }
          }
        }
      }
    },
    "/robots.txt": {
      "get": {
        "tags": ["content"],
        "operationId": "getRobots",
        "summary": "Robots.txt",
        "description": "Returns robots.txt with AI crawler policies and sitemap reference.",
        "responses": {
          "200": {
            "description": "Robots directives",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "tags": ["content"],
        "operationId": "getLlmsTxt",
        "summary": "LLMs.txt — AI content declaration",
        "description": "Returns a structured summary of the site following the llms.txt standard. Designed for LLMs and AI crawlers.",
        "responses": {
          "200": {
            "description": "LLMs.txt content",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContactRequest": {
        "type": "object",
        "required": ["name", "email", "message"],
        "properties": {
          "name": {
            "type": "string",
            "description": "Full name of the person reaching out",
            "minLength": 2,
            "maxLength": 120,
            "example": "Sarah Johnson"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Contact email address",
            "example": "sarah@startup.com"
          },
          "company": {
            "type": "string",
            "description": "Company or organization name (optional)",
            "maxLength": 120,
            "example": "Startup Inc."
          },
          "budget": {
            "type": "string",
            "description": "Project budget range (optional)",
            "maxLength": 60,
            "example": "$5,000 – $10,000"
          },
          "message": {
            "type": "string",
            "description": "Detailed message describing the project or inquiry",
            "minLength": 10,
            "maxLength": 5000,
            "example": "Hi Ahmed, I need a Flutter app for my e-commerce platform."
          }
        }
      },
      "ContactResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "example": true
          },
          "message": {
            "type": "string",
            "example": "Message sent! Ahmed will reply within 24 hours."
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string",
            "example": "Invalid request body"
          }
        }
      }
    }
  },
  "externalDocs": {
    "description": "Full portfolio and case studies",
    "url": "https://ahmedinnov.com"
  },
  "x-service-info": {
    "categories": ["freelance", "software-development", "mobile", "backend", "consultation"],
    "payment_enabled": true,
    "payment_endpoint": "https://ahmedinnov.com/api/premium",
    "payment_schemes": ["x402"],
    "currency": "USDC",
    "network": "eip155:8453"
  },
  "x-payment-info": {
    "intent": "charge",
    "method": "x402",
    "amount": 1,
    "currency": "USDC",
    "description": "1 USDC for priority portfolio access on Base network",
    "endpoint": "https://ahmedinnov.com/api/premium",
    "network": "eip155:8453",
    "facilitator": "https://x402.org/facilitator"
  }
}
