{
  "openapi": "3.0.3",
  "info": {
    "title": "Cardsmith",
    "version": "1.0.0",
    "description": "Open Graph / social-card image API. One GET endpoint that returns a PNG."
  },
  "servers": [
    {
      "url": "https://cardsmith.dev"
    }
  ],
  "paths": {
    "/v1/card.png": {
      "get": {
        "summary": "Render a social card PNG",
        "parameters": [
          {
            "name": "title",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 300
            },
            "description": "Main heading"
          },
          {
            "name": "subtitle",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 500
            }
          },
          {
            "name": "footer",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "badge",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "description": "Pill label above the title"
          },
          {
            "name": "theme",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "dark",
                "light",
                "midnight",
                "forest",
                "sunset",
                "ocean",
                "violet",
                "paper",
                "ember"
              ],
              "default": "dark"
            }
          },
          {
            "name": "accent",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^#?[0-9a-fA-F]{3,8}$"
            },
            "description": "Accent color override"
          },
          {
            "name": "bg",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^#?[0-9a-fA-F]{3,8}$"
            },
            "description": "Solid background color override"
          },
          {
            "name": "align",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "left",
                "center"
              ],
              "default": "left"
            }
          },
          {
            "name": "width",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1200,
              "maximum": 2400
            }
          },
          {
            "name": "height",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 630,
              "maximum": 2400
            }
          },
          {
            "name": "key",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "API key (or X-Api-Key header)"
          }
        ],
        "responses": {
          "200": {
            "description": "PNG image",
            "content": {
              "image/png": {}
            }
          },
          "429": {
            "description": "Free-tier daily limit reached"
          },
          "500": {
            "description": "Render failed"
          }
        }
      }
    }
  }
}