{
  "openapi": "3.1.0",
  "info": {
    "title": "MiniMax Voice Management API",
    "description": "MiniMax Voice Management API with support for getting and deleting voices",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.minimax.io"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/get_voice": {
      "post": {
        "summary": "Get Voice",
        "operationId": "getVoice",
        "tags": ["Voice"],
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "The media type of the request body. Must be set to `application/json` to ensure the data is sent in JSON format.",
            "schema": {
              "type": "string",
              "enum": ["application/json"],
              "default": "application/json"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetVoiceReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetVoiceResp"
                }
              }
            }
          }
        }
      }
    },
    "/v1/delete_voice": {
      "post": {
        "summary": "Delete Voice",
        "description": "Delete a voice by ID and type",
        "operationId": "deleteVoice",
        "tags": ["Voice"],
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "The media type of the request body. Must be set to `application/json` to ensure the data is sent in JSON format.",
            "schema": {
              "type": "string",
              "enum": ["application/json"],
              "default": "application/json"
            }
          }
        ],
        "requestBody": {
          "description": "Delete voice request parameters",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteVoiceReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteVoiceResp"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": ["error", "message"],
        "properties": {
          "error": {
            "type": "integer",
            "format": "int32",
            "description": "Error code"
          },
          "message": {
            "type": "string",
            "description": "Error message"
          }
        }
      },
      "GetVoiceReq": {
        "type": "object",
        "required": ["voice_type"],
        "properties": {
          "voice_type": {
            "type": "string",
            "description": "The type of voice to query. Supported values:\n\n- `system`: System voices\n- `voice_cloning`: Quick cloned voices (available only after being successfully used for speech synthesis)\n- `voice_generation`: Voices generated via the text-to-voice API (available only after being successfully used for speech synthesis)\n- `all`: All of the above",
            "enum": ["system", "voice_cloning", "voice_generation", "all"]
          }
        },
        "example": {
          "voice_type": "all"
        }
      },
      "GetVoiceResp": {
        "type": "object",
        "properties": {
          "system_voice": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SystemVoiceInfo"
            },
            "description": "Contains system-defined voices"
          },
          "voice_cloning": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VoiceCloningInfo"
            },
            "description": "Contains data of quick cloned voices"
          },
          "voice_generation": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VoiceGenerationInfo"
            },
            "description": "Contains data of voices generated via the text-to-voice API"
          },
          "base_resp": {
            "$ref": "#/components/schemas/BaseResp"
          }
        },
        "example": {
          "system_voice": [
            {
              "voice_id": "Chinese (Mandarin)_Reliable_Executive",
              "description": [
                "A steady and reliable male executive voice in standard Mandarin, conveying a trustworthy impression."
              ],
              "voice_name": "Steady Executive",
              "created_time": "1970-01-01"
            },
            {
              "voice_id": "Chinese (Mandarin)_News_Anchor",
              "description": [
                "A professional middle-aged female news anchor voice in standard Mandarin, with a broadcast-style tone."
              ],
              "voice_name": "News Anchor (Female)",
              "created_time": "1970-01-01"
            }
          ],
          "voice_cloning": [
            {
              "voice_id": "test12345",
              "description": [],
              "created_time": "2025-08-20"
            },
            {
              "voice_id": "test12346",
              "description": [],
              "created_time": "2025-08-21"
            }
          ],
          "voice_generation": [
            {
              "voice_id": "ttv-voice-2025082011321125-2uEN0X1S",
              "description": [],
              "created_time": "2025-08-20"
            },
            {
              "voice_id": "ttv-voice-2025082014225025-ZCQt0U0k",
              "description": [],
              "created_time": "2025-08-20"
            }
          ],
          "base_resp": {
            "status_code": 0,
            "status_msg": "success"
          }
        }
      },
      "SystemVoiceInfo": {
        "type": "object",
        "properties": {
          "voice_id": {
            "type": "string",
            "description": "The voice ID."
          },
          "voice_name": {
            "type": "string",
            "description": "The voice display name (not the API call ID)."
          },
          "description": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The voice description."
          }
        }
      },
      "VoiceCloningInfo": {
        "type": "object",
        "properties": {
          "voice_id": {
            "type": "string",
            "description": "Quick cloned voice ID."
          },
          "description": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The description provided during cloning."
          },
          "created_time": {
            "type": "string",
            "description": "Creation date in `yyyy-mm-dd` format."
          }
        }
      },
      "VoiceGenerationInfo": {
        "type": "object",
        "properties": {
          "voice_id": {
            "type": "string",
            "description": "The generated voice ID."
          },
          "description": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The description provided during voice generation."
          },
          "created_time": {
            "type": "string",
            "description": "Creation date in `yyyy-mm-dd` format."
          }
        }
      },
      "BaseResp": {
        "type": "object",
        "properties": {
          "status_code": {
            "type": "integer",
            "format": "int64",
            "description": "Status code.\n\n- `0`: Request successful\n- `2013`: Invalid input parameters\n\nFor more information, please refer to the [Error Code Reference](/api-reference/errorcode)."
          },
          "status_msg": {
            "type": "string",
            "description": "Status details."
          }
        }
      },
      "DeleteVoiceReq": {
        "type": "object",
        "required": ["voice_type", "voice_id"],
        "properties": {
          "voice_type": {
            "type": "string",
            "description": "Accepted values:\n\n- `voice_cloning`: Cloned voice\n- `voice_generation`: Voice generated from text prompt\n\nOnly these two categories are supported for deletion.",
            "enum": ["voice_cloning", "voice_generation"]
          },
          "voice_id": {
            "type": "string",
            "description": "The voice_id of the voice to be deleted."
          }
        },
        "example": {
          "voice_type": "voice_cloning",
          "voice_id": "yanshang11123"
        }
      },
      "DeleteVoiceResp": {
        "type": "object",
        "properties": {
          "voice_id": {
            "type": "string",
            "description": "The voice_id of the deleted voice."
          },
          "created_time": {
            "type": "string",
            "description": "The time when the voice generation request was submitted, not the first activation time. Format: `yyyy-mm-dd`."
          },
          "base_resp": {
            "$ref": "#/components/schemas/DeleteBaseResp"
          }
        },
        "example": {
          "voice_id": "yanshang11123",
          "created_time": "1728962464",
          "base_resp": {
            "status_code": 0,
            "status_msg": "success"
          }
        }
      },
      "DeleteBaseResp": {
        "type": "object",
        "properties": {
          "status_code": {
            "type": "integer",
            "format": "int64",
            "description": "Status code:\n\n- `0`: Deletion successful\n- `2013`: Invalid input\n\nFor more information, please refer to the [Error Code Reference](/api-reference/errorcode)."
          },
          "status_msg": {
            "type": "string",
            "description": "Status message."
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "`HTTP: Bearer Auth`\n- Security Scheme Type: http\n- HTTP Authorization Scheme: `Bearer API_key`, can be found in [Account Management>API Keys](https://platform.minimax.io/user-center/basic-information/interface-key)."
      }
    }
  }
}
