# Generate Persona

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/generate/generate-persona:
    post:
      summary: Generate Persona
      deprecated: false
      description: >
        Create a personalized music Persona based on generated music, giving the
        music a unique identity and characteristics.


        ### Usage Guide

        - Use this endpoint to create Personas (music characters) for generated
        music

        - Requires the taskId from supported music generation endpoints
        (generate, extend, mashup) and audio ID

        - Customize the Persona name and description to give music unique
        personality

        - Generated Personas can be used for subsequent music creation and style
        transfer

        - Optionally specify vocalStart and vocalEnd to define the time range
        (10-30 seconds) for analysis. If not provided, defaults to 0.0 and 30.0
        respectively


        ### Parameter Details

        - `taskId`: Required parameter, can be obtained from the following
        endpoints:
          - [Generate Music](./generate-music) (`/api/v1/generate`)
          - [Extend Music](./extend-music) (`/api/v1/generate/extend`)
        - `audioId`: Required parameter, specifies the audio ID to create
        Persona for

        - `name`: Required parameter, assigns an easily recognizable name to the
        Persona

        - `description`: Required parameter, describes the Persona's musical
        characteristics, style, and personality

        - `vocalStart`: Optional parameter, start time (in seconds) of the audio
        segment to analyze. Default value is 0.0. Must be between 0 and the
        audio duration, and the segment length (vocalEnd - vocalStart) must be
        between 10-30 seconds.

        - `vocalEnd`: Optional parameter, end time (in seconds) of the audio
        segment to analyze. Default value is 30.0. Must be between 0 and the
        audio duration, and the segment length (vocalEnd - vocalStart) must be
        between 10-30 seconds.

        - `style`: Optional parameter, music style label to help categorize the
        Persona


        ### Developer Notes

        - **Important**: Ensure the music generation task is fully completed
        before calling this endpoint. If the music is still generating, this
        endpoint will return a failure

        - **Model Requirement**: Persona generation supports taskId from music
        generated with models V4 and above

        - It is recommended to provide detailed descriptions for Personas to
        better capture musical characteristics

        - The returned `personaId` can be used in subsequent music generation
        requests to create music with similar style characteristics

        - You can apply the `personaId` to the following endpoints:
          - [Generate Music](./generate-music)
          - [Extend Music](./extend-music)
          - [Upload And Cover Audio](./upload-and-cover-audio)
          - [Upload And Extend Audio](./upload-and-extend-audio)
        - Each audio ID can only generate a Persona once


        ### Parameter Example


        <Tabs>


        <TabItem value="tab1" label="With Default Values">


        ```json

        {
          "taskId": "5c79****be8e",
          "audioId": "e231****-****-****-****-****8cadc7dc",
          "name": "Electronic Pop Singer",
          "description": "A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones",
          "style": "Electronic Pop"
        }

        ```


        </TabItem>


        <TabItem value="tab2" label="With Custom Time Range">


        ```json

        {
          "taskId": "5c79****be8e",
          "audioId": "e231****-****-****-****-****8cadc7dc",
          "name": "Electronic Pop Singer",
          "description": "A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones",
          "vocalStart": 10,
          "vocalEnd": 30,
          "style": "Electronic Pop"
        }

        ```


        </TabItem>


        </Tabs>


        :::note[]

        Ensure that the music generation task corresponding to the taskId is
        complete and the audioId is valid.

        :::


        :::tip[]

        Providing detailed and specific descriptions for Personas helps the
        system more accurately capture musical style characteristics.

        :::
      operationId: generate-persona
      tags:
        - docs/en/Suno API/Generate Music
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - taskId
                - audioId
                - name
                - description
              properties:
                taskId:
                  type: string
                  description: >-
                    Unique identifier of the original music generation task.
                    This can be a taskId returned from any of the following
                    endpoints:

                    - Generate Music (/api/v1/generate)

                    - Extend Music (/api/v1/generate/extend)
                  examples:
                    - 5c79****be8e
                audioId:
                  type: string
                  description: >-
                    Audio ID of the music track to create Persona for. This ID
                    can be obtained from the music generation response.
                  examples:
                    - e231****-****-****-****-****8cadc7dc
                name:
                  type: string
                  description: >-
                    Name for the Persona. A descriptive name that captures the
                    essence of the musical style or character.
                  examples:
                    - Electronic Pop Singer
                description:
                  type: string
                  description: >-
                    Detailed description of the Persona's musical
                    characteristics, style, and personality. Be specific about
                    genre, mood, instrumentation, and vocal qualities.
                  examples:
                    - >-
                      A modern electronic music style pop singer, skilled in
                      dynamic rhythms and synthesizer tones
                vocalStart:
                  type: number
                  description: >-
                    Specifies the start time (seconds) of the analysis segment.
                    Used to extract musical characteristics. Optional. Default:
                    0.0.
                  minimum: 0
                  default: 0
                  examples:
                    - 0
                vocalEnd:
                  type: number
                  description: >-
                    Specifies the end time (seconds) of the analysis segment.
                    Used to extract musical characteristics. Optional. Default:
                    30.0. Must be greater than vocalStart.
                  minimum: 0
                  default: 30
                  examples:
                    - 30
                style:
                  type: string
                  description: >-
                    Music style label. Optional. Used to identify the Persona's
                    music style type.
                  examples:
                    - Electronic Pop
              x-apidog-orders:
                - taskId
                - audioId
                - name
                - description
                - vocalStart
                - vocalEnd
                - style
      responses:
        '200':
          description: Request successful
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      code:
                        type: integer
                        enum:
                          - 200
                          - 401
                          - 402
                          - 404
                          - 409
                          - 422
                          - 429
                          - 451
                          - 455
                          - 500
                        description: >-
                          Response Status Codes


                          - **200**: Success - Request has been processed
                          successfully  

                          - **401**: Unauthorized - Authentication credentials
                          are missing or invalid  

                          - **402**: Insufficient Credits - Account does not
                          have enough credits to perform the operation  

                          - **404**: Not Found - The requested resource or
                          endpoint does not exist  

                          - **409**: Conflict - Persona already exists for this
                          music

                          - **422**: Validation Error - The request parameters
                          failed validation checks  

                          - **429**: Rate Limited - Request limit has been
                          exceeded for this resource  

                          - **451**: Unauthorized - Failed to fetch the music
                          data. Kindly verify any access limits set by you or
                          your service provider  

                          - **455**: Service Unavailable - System is currently
                          undergoing maintenance  

                          - **500**: Server Error - An unexpected error occurred
                          while processing the request
                      msg:
                        type: string
                        description: Error message when code != 200
                        examples:
                          - success
                    x-apidog-orders:
                      - code
                      - msg
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          personaId:
                            type: string
                            description: >-
                              Unique identifier for the generated Persona. This
                              personaId can be used in subsequent music
                              generation requests (Generate Music, Extend Music,
                              Upload And Cover Audio, Upload And Extend Audio)
                              to create music with similar style
                              characteristics.
                            examples:
                              - a1b2****c3d4
                          name:
                            type: string
                            description: Name of the Persona as provided in the request.
                            examples:
                              - Electronic Pop Singer
                          description:
                            type: string
                            description: >-
                              Description of the Persona's musical
                              characteristics, style, and personality as
                              provided in the request.
                            examples:
                              - >-
                                A modern electronic music style pop singer,
                                skilled in dynamic rhythms and synthesizer tones
                        x-apidog-orders:
                          - personaId
                          - name
                          - description
                    x-apidog-orders:
                      - data
          headers: {}
          x-apidog-name: Success
        '500':
          description: Server error
          headers: {}
          x-apidog-name: Server Error
      security: []
      x-apidog-folder: docs/en/Suno API/Generate Music
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1412907/apis/api-46842221-run
components:
  schemas: {}
  securitySchemes:
    BearerAuth:
      type: bearer
      scheme: bearer
      bearerFormat: API Key
      description: >-
        # 🔑 API Authentication


        All endpoints require authentication using Bearer Token.


        ## Get API Key


        1. Visit the [API Key Management Page](https://sunoapi.org/api-key) to
        obtain your API Key


        ## Usage


        Add to request headers:


        ```

        Authorization: Bearer YOUR_API_KEY

        ```


        > **⚠️ Note:**

        > - Keep your API Key secure and do not share it with others

        > - If you suspect your API Key has been compromised, reset it
        immediately from the management page
servers:
  - url: https://apibox.erweima.ai
    description: 正式环境
security: []

```
