{
  "openapi": "3.0.3",
  "info": {
    "title": "Trade-Skins Public API",
    "version": "1.0.0",
    "description": "Read-only endpoints under /api/public/v1. Authenticate with X-Api-Key or Authorization: Bearer."
  },
  "servers": [{ "url": "/", "description": "Same origin" }],
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [{ "ApiKeyHeader": [] }, { "BearerAuth": [] }],
  "paths": {
    "/api/public/v1/trending": {
      "get": {
        "summary": "Trending variants (1d proxy)",
        "responses": { "200": { "description": "OK" }, "401": { "description": "Invalid API key" }, "429": { "description": "Rate limited" } }
      }
    },
    "/api/public/v1/search": {
      "get": {
        "summary": "Search variants (Meilisearch)",
        "parameters": [{ "name": "q", "in": "query", "schema": { "type": "string" } }],
        "responses": { "200": { "description": "OK" } }
      }
    },
    "/api/public/v1/items/{id}": {
      "get": {
        "summary": "Item detail (demo aggregate)",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "OK" } }
      }
    },
    "/api/public/v1/items/{id}/history": {
      "get": {
        "summary": "Price history",
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } },
          { "name": "interval", "in": "query", "schema": { "type": "string", "enum": ["5m", "1h", "1d"] } }
        ],
        "responses": { "200": { "description": "OK" } }
      }
    }
  }
}
