{
  "openapi": "3.0.0",
  "info": {
    "title": "CortexAnime AI Search API",
    "description": "API for searching anime titles, episodes, and Hungarian subtitles on CortexAnime (cortanime.eu).",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://cortanime.eu",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/api/ai/search": {
      "get": {
        "summary": "Search anime titles and check Hungarian subtitle availability",
        "description": "Searches through CortexAnime catalog of Hungarian subtitled anime as well as the global anime database.",
        "operationId": "searchAnime",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Search query string (e.g. 'kantei', 'appraisal skill', 'bleach', 'wiseman')",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "description": "Filter language: 'hu' for Hungarian subtitled only (default), 'all' for all anime",
            "required": false,
            "schema": {
              "type": "string",
              "default": "hu"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results to return (default: 10, max: 30)",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "query": {
                      "type": "string"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "title": {
                            "type": "string"
                          },
                          "hungarianTitle": {
                            "type": "string"
                          },
                          "romaji": {
                            "type": "string"
                          },
                          "episodes": {
                            "type": "integer"
                          },
                          "status": {
                            "type": "string"
                          },
                          "hasHungarianSubtitles": {
                            "type": "boolean"
                          },
                          "score": {
                            "type": "number"
                          },
                          "genres": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "synopsis": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "watchUrl": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}