{
  "openapi": "3.0.1",
  "info": {
    "title": "Voice Pagination",
    "version": "1.0.0",
    "description": "API for retrieving a paginated list of voices with filtering options."
  },
  "servers": [
    {
      "url": "https://converter.fineshare.net",
      "description": "Voices"
    }
  ],
  "paths": {
    "/api/pagevoices": {
      "get": {
        "summary": "Retrieve Paginated Voices",
        "operationId": "PageVoices",
        "tags": ["Voice Management"],
        "parameters": [
          {
            "name": "v",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
			  "enum": ["v2"]
            },
            "description": "Version of the voices data."
          },
          {
            "name": "categroy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Category of the voices. For custom models, pass the value my_voices.",
            "example": "narration"
          },
          {
            "name": "gender",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["all","male", "female"]
            },
            "description": "Gender filter for the voices.",
            "example": "female"
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Language filter for the voices.",
            "example": "all,en-US,zh-CN..."
          },
          {
            "name": "page",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Page number for pagination.",
            "example": 0
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of voices per page.",
            "example": 10
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer token for authentication.",
            "example": "Bearer eyJhbGciOiJIUzI1NiIsInR5cC..."
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of voices retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageVoicesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            }
          },
          "500": {
            "description": "Server error - unable to process the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PageVoicesResponse": {
        "type": "object",
        "properties": {
          "page": {
            "type": "integer",
            "example": 1
          },
          "limit": {
            "type": "integer",
            "example": 10
          },
          "total": {
            "type": "integer",
            "example": 50
          },
          "voices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "example": "Nabuless"
                },
                "name": {
                  "type": "string",
                  "example": "Narration Voice"
                },
                "language": {
                  "type": "string",
                  "example": "en-US"
                },
                "gender": {
                  "type": "string",
                  "example": "female"
                },
                "category": {
                  "type": "string",
                  "example": "narration"
                }
              }
            }
          }
        }
      },
      "ErrorModel": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "example": "Invalid parameters."
          },
          "details": {
            "type": "string",
            "example": "The 'limit' parameter exceeds the maximum allowed value."
          }
        }
      }
    }
  }
}

