{
  "openapi": "3.0.1",
  "info": {
    "title": "Step 1: Create a voice-changing task",
    "version": "1.0.0",
    "description": "API for managing audio file transformations."
  },
  "servers": [
    {
      "url": "https://voiceai.fineshare.net",
      "description": "OVC"
    }
  ],
  "paths": {
    "/api/createaudiofilechanger": {
      "post": {
        "summary": "Step 1: Obtain the Voice Transformation Task Node Connection",
        "operationId": "CreateAudioFileChanger",
        "tags": ["Audio Transformation"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVoiceChangerReqModel"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer token for authorization"
          }
        ],
        "responses": {
          "200": {
            "description": "Task node successfully created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Task node created successfully."
                    },
                    "taskId": {
                      "type": "string",
                      "example": "task_id"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing token.",
            "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": {
      "CreateVoiceChangerReqModel": {
        "type": "object",
        "properties": {
          "voice": {
            "type": "string",
            "example": "leo"
          },
          "from": {
            "type": "string",
			"enum": ["fv-file-changer"],
            "example": "fv-file-changer"
          },
          "operation": {
            "type": "string",
			"enum": ["FVC"],
            "example": "FVC"
          },
          "engine": {
            "type": "string",
			"enum": ["v5", "v7"],
            "example": "v5"
          }
        },
        "required": ["voice", "from", "operation", "engine"]
      },
      "ErrorModel": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "example": "Invalid input parameters."
          },
          "details": {
            "type": "string",
            "example": "The 'voice' field is required."
          }
        }
      }
    }
  }
}

