{
  "openapi": "3.0.3",
  "info": {
    "title": "urlexpander API",
    "version": "1.2.0"
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/api/expand": {
      "post": {
        "summary": "Expand a URL",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "fetchMeta": {
                        "type": "boolean"
                      },
                      "showChain": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "required": [
                  "url"
                ]
              },
              "example": {
                "url": "https://bit.ly/...",
                "options": {
                  "fetchMeta": true,
                  "showChain": true
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Key-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Key-Remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Key-Reset": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/api/stats": {
      "get": {
        "summary": "Service stats",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  }
}