{
  "openapi": "3.1.0",
  "info": {
    "title": "Create Voice Persona API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.cometapi.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/suno/persona/voice/one": {
      "post": {
        "summary": "Create a voice persona from one recording",
        "operationId": "create_voice_persona_one",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "singer_skill_level",
                  "name",
                  "vocal_start_s",
                  "vocal_end_s"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public MP3 or WAV URL containing spoken words or singing."
                  },
                  "singer_skill_level": {
                    "type": "string",
                    "description": "Singer skill classification.",
                    "enum": [
                      "Advanced",
                      "Intermediate",
                      "Beginner",
                      "Professional"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "description": "Name for the voice persona."
                  },
                  "vocal_start_s": {
                    "type": "number",
                    "description": "Start of the selected voice segment in seconds.",
                    "minimum": 0
                  },
                  "vocal_end_s": {
                    "type": "number",
                    "description": "End of the selected voice segment in seconds. It must be greater than `vocal_start_s`."
                  }
                }
              },
              "examples": {
                "Default": {
                  "summary": "Create a persona from one recording",
                  "value": {
                    "url": "https://your-audio-host/voice-sample.mp3",
                    "singer_skill_level": "Intermediate",
                    "name": "My Voice",
                    "vocal_start_s": 0,
                    "vocal_end_s": 30
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persona creation response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Persona ID used by later music generation requests."
                    },
                    "name": {
                      "type": "string"
                    },
                    "persona_type": {
                      "type": "string"
                    },
                    "vocal_clip_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "Default",
            "source": "curl https://api.cometapi.com/suno/persona/voice/one \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"url\":\"https://your-audio-host/voice-sample.mp3\",\"singer_skill_level\":\"Intermediate\",\"name\":\"My Voice\",\"vocal_start_s\":0,\"vocal_end_s\":30}'\n"
          },
          {
            "lang": "Python",
            "label": "Default",
            "source": "import os\nimport requests\n\npayload = {\"url\": \"https://your-audio-host/voice-sample.mp3\", \"singer_skill_level\": \"Intermediate\", \"name\": \"My Voice\", \"vocal_start_s\": 0, \"vocal_end_s\": 30}\nresponse = requests.post(\"https://api.cometapi.com/suno/persona/voice/one\", headers={\"Authorization\": \"Bearer \" + os.environ[\"COMETAPI_KEY\"]}, json=payload)\nprint(response.json())\n"
          },
          {
            "lang": "JavaScript",
            "label": "Default",
            "source": "const payload = { url: \"https://your-audio-host/voice-sample.mp3\", singer_skill_level: \"Intermediate\", name: \"My Voice\", vocal_start_s: 0, vocal_end_s: 30 };\nconst response = await fetch(\"https://api.cometapi.com/suno/persona/voice/one\", { method: \"POST\", headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}`, \"Content-Type\": \"application/json\" }, body: JSON.stringify(payload) });\nconsole.log(await response.json());\n"
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer token authentication. Use your CometAPI key."
      }
    }
  }
}
