{
  "openapi": "3.0.0",
  "info": {
    "title": "AI Music Generator",
    "description": "# Overview\nTurn a theme, lyrics, and/or a music style into a complete song. Each AI Music Generator task composes one finished song (mp3) and returns it together with a cover image, the song title, the final lyrics, and a synchronized lyrics timeline.\n\n* Vocal songs and instrumentals: generate a song with vocals, or instrumental music with no vocals and no lyrics (`instrumental: true`).\n* Start from what you have: a theme (`idea`), your own lyrics (`lyrics`), or both. An instrumental song requires an `idea`.\n* Lyrics language: ask for it in the `idea` text (e.g. \"with Japanese lyrics\"). Supported lyrics languages are English, Japanese, Korean, Portuguese, Spanish, German, French, Italian, Traditional Chinese, Simplified Chinese, Hindi, and Turkish.\n\nSample usage:\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2026-10-15/webp_b29b16b3-6f1f-4f94-b0f3-ef7955d1b3e0.webp)\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2026-09-24/webp_90715cdb-e955-4501-9290-0869981b3f43.webp)\n\n---\n\n## Integration Guide\n\n* AI Music Generator Usage Guide\n\nThis guide explains how to run an AI Music Generator task and read its result.\n\nThere is no image or audio input, so you don't need the File API: there is no \"Create a new file\" step before running a task. Just input your `idea` or `lyrics`, choose `music_style`, and create incredible songs.\n\n***\n\n   * Step 1. Create a Task\n\nUse the **AI Task API** (`/s2s/v2.0/task/ai-song`) with a theme, lyrics, and/or a music style:\n\n```bash\ncurl --request POST \\\n  --url https://yce-api-01.makeupar.com/s2s/v2.0/task/ai-song \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'content-type: application/json' \\\n  --data '{\"idea\":\"A song about a small cafe that stays open late for people who cannot sleep\",\"music_style\":{\"genre\":\"Acoustic Pop\",\"mood\":\"Calm, hopeful\",\"vocal\":\"female\",\"description\":\"soft piano, brushed drums\"},\"instrumental\":false}'\n```\n\nThe response returns the `task_id` of this task:\n\n```json\n{\n  \"status\": 200,\n  \"data\": {\n    \"task_id\": \"grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe\"\n  }\n}\n```\n\n***\n\n   * Step 2. Poll for Task Result\n\nUse the `task_id` from the run response to check the status until `task_status` is `success` or `error`:\n\n```bash\ncurl --request GET \\\n  --url https://yce-api-01.makeupar.com/s2s/v2.0/task/ai-song/YOUR_TASK_ID \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'content-type: application/json'\n```\n\n***\n\n   * Step 3. Retrieve Result\n\nA successful response includes the song, its cover image, title, final lyrics, and synchronized lyrics timestamps:\n\n```json\n{\n  \"status\": 200,\n  \"data\": {\n    \"error\": null,\n    \"results\": {\n      \"url\": \"https://example.com/sample-song-url\",\n      \"cover_urls\": [\n        \"https://example.com/sample-cover-url\"\n      ],\n      \"title\": \"Leave the Light On\",\n      \"lyrics\": \"[verse]\\nTwo a.m., the neon hums\\nSteam on the glass, the night still runs\",\n      \"duration\": 154.3,\n      \"timestamps\": \"{\\\"lyrics_lrc_timestamps\\\": \\\"[00:23.98]Two a.m., the neon hums\\\"}\"\n    },\n    \"task_status\": \"success\"\n  }\n}\n```\n\n---\n\n## Inputs & Outputs\n\n* Request Body\n\n| Field | Type | Description |\n|---|---|---|\n| idea | string (max 500 characters) | Theme of the song. Required when `instrumental` is `true`. For a song with vocals, provide `idea`, `lyrics`, or both. |\n| lyrics | string (max 3000 characters) | Lyrics of the song. Section tags such as `[intro]`, `[verse]`, `[chorus]`, and `[outro]` are supported. |\n| music_style | object | Music style of the song: `genre` (max 100), `mood` (max 100), `vocal` (`female` or `male`, ignored for instrumentals), and `description` (max 300) for other details such as instruments or rhythm. All fields are optional. |\n| instrumental | boolean | `true` to generate instrumental music with no vocals and no lyrics. Default `false`. |\n\nA request must describe a song one of these ways: from an `idea` (`idea` is not empty), or from lyrics for a song with vocals (`lyrics` is not empty and `instrumental` is not `true`).\n\n* Results (`data.results`)\n\n| Field | Type | Description |\n|---|---|---|\n| url | string | URL to download the generated song (mp3). Valid for 2 hours |\n| cover_urls | array of string | URLs to download the cover images (jpg). Currently one image. Valid for 2 hours |\n| title | string | Generated title of the song |\n| lyrics | string | Final lyrics of the song. Empty for instrumental music |\n| duration | number | Length of the song in seconds |\n| timestamps | string | JSON-encoded string of an object whose `lyrics_lrc_timestamps` field holds the synchronized lyrics in LRC format, e.g. `[00:08.54]Lyrics text`. The LRC text is empty for instrumental music |\n\n---\n\n## File Specs & Errors\n\n* Supported Limits\n\n| Type | Limit |\n|---|---|\n| idea (theme) | Max 500 characters. Required when `instrumental` is `true` |\n| lyrics | Max 3000 characters. Section tags such as `[intro]`, `[verse]`, `[chorus]`, and `[outro]` are supported |\n| music_style `genre` / `mood` | Max 100 characters each |\n| music_style `description` | Max 300 characters |\n| Input file | None. There is no image or audio input, so no File API step is needed |\n| Output | Song: mp3. Cover image: jpg. Result URLs are valid for 2 hours |\n\n* Error Codes\n\n| Error Code | Description |\n|---|---|\n| invalid_parameter | Invalid parameter value, e.g. neither `idea` nor `lyrics` is provided, `idea` is missing for an instrumental task, or a field exceeds its maximum length |\n\n    > Task-level failures are reported in the status response: `data.error` is the error code and `data.error_message` is a detailed description of the error.\n\n---\n\n## Unit Consumption\n\nPriced by song type.\n\n| Song Type | Unit Consumed |\n|---|---|\n| Song with vocals (`instrumental: false`) | 10 units per song |\n| Instrumental music (`instrumental: true`) | 20 units per song |\n\n---",
    "version": "",
    "termsOfService": "https://www.makeupar.com/perfectbeauty/youcam/terms-of-service-api",
    "contact": {
      "email": "YouCamOnlineEditor_API@perfectcorp.com"
    },
    "license": {
      "name": "Privacy policy",
      "url": "https://www.makeupar.com/perfectbeauty/youcam/privacy-policy-api"
    }
  },
  "servers": [
    {
      "url": "https://yce-api-01.makeupar.com"
    }
  ],
  "tags": [
    {
      "name": "V1.0",
      "description": "AI Music Generator API composes a complete song from a theme, lyrics, and/or a music style. Each task returns one finished song (mp3) with its cover image, title, lyrics, and synchronized lyrics timestamps."
    }
  ],
  "paths": {
    "/s2s/v2.0/task/ai-song": {
      "post": {
        "summary": "Run an AI Music Generator task.",
        "description": "AI tasks are asynchronous. Prefer webhook-based completion handling when the feature supports webhooks. Configure your webhook endpoint, verify webhook signatures, and use the received `task_id` to query the task result after a `success` or `error` notification. See the [webhook integration guide](/develop/webhook.md) for setup and verification details.\n\nIf webhooks are not supported or cannot be used in your integration, implement polling. After submitting an AI task, poll the status endpoint at regular intervals (e.g., every 10 seconds) until the task status is `success` or `error`.\n",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "idea": {
                    "type": "string",
                    "maxLength": 500,
                    "default": "",
                    "description": "Theme of the song. Required when instrumental is true. For a song with vocals, provide idea, lyrics, or both. To ask for lyrics in a specific language, say so here (e.g. \"with Japanese lyrics\").",
                    "example": "A song about a small café that stays open late for people who can't sleep"
                  },
                  "lyrics": {
                    "type": "string",
                    "maxLength": 3000,
                    "default": "",
                    "description": "Lyrics of the song. Section tags such as [intro], [verse], [chorus] and [outro] are supported. Supported lyrics languages: English, Japanese, Korean, Portuguese, Spanish, German, French, Italian, Traditional Chinese, Simplified Chinese, Hindi, Turkish.",
                    "example": "[verse]\nTwo a.m., the neon hums\nSteam on the glass, the night still runs\n\n[chorus]\nLeave the light on, leave the light on\nFor the ones who don't go home"
                  },
                  "music_style": {
                    "type": "object",
                    "description": "Music style of the song. All fields are optional.",
                    "properties": {
                      "genre": {
                        "type": "string",
                        "maxLength": 100,
                        "description": "Genre of the song, e.g. Pop or Lo-fi Hip Hop.",
                        "example": "Acoustic Pop"
                      },
                      "mood": {
                        "type": "string",
                        "maxLength": 100,
                        "description": "Mood of the song, e.g. Calm or Uplifting.",
                        "example": "Calm, hopeful"
                      },
                      "vocal": {
                        "type": "string",
                        "enum": [
                          "female",
                          "male"
                        ],
                        "description": "Vocal type. Ignored when instrumental is true.",
                        "example": "female"
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 300,
                        "description": "Other details, such as instruments or rhythm.",
                        "example": "soft piano, brushed drums"
                      }
                    }
                  },
                  "instrumental": {
                    "type": "boolean",
                    "default": false,
                    "description": "true to generate instrumental music with no vocals and no lyrics.",
                    "example": false
                  }
                },
                "anyOf": [
                  {
                    "title": "Song from an idea",
                    "required": [
                      "idea"
                    ],
                    "properties": {
                      "idea": {
                        "minLength": 1
                      }
                    }
                  },
                  {
                    "title": "Song with vocals from lyrics",
                    "required": [
                      "lyrics"
                    ],
                    "properties": {
                      "lyrics": {
                        "minLength": 1
                      },
                      "instrumental": {
                        "enum": [
                          false
                        ]
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful execution of the task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicRunTaskResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "Failed execution of task",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RunError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/s2s/v2.0/task/ai-song/{task_id}": {
      "get": {
        "summary": "Check the status of an AI Music Generator task.",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
            },
            "description": "ID of task to check"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful check of the task status",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/TaskStatusResponseV2"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "results": {
                              "type": "object",
                              "properties": {
                                "cover_urls": {
                                  "type": "array",
                                  "description": "URLs to download the cover images (jpg). Currently one image. Valid for 2 hours",
                                  "items": {
                                    "type": "string",
                                    "example": "https://example.com/sample-cover-url"
                                  }
                                },
                                "title": {
                                  "type": "string",
                                  "description": "Generated title of the song",
                                  "example": "Leave the Light On"
                                },
                                "lyrics": {
                                  "type": "string",
                                  "description": "Final lyrics of the song. Empty for instrumental music"
                                },
                                "duration": {
                                  "type": "number",
                                  "description": "Length of the song in seconds",
                                  "example": 154.3
                                },
                                "timestamps": {
                                  "type": "string",
                                  "description": "JSON-encoded string of an object whose lyrics_lrc_timestamps field holds the synchronized lyrics in LRC format, e.g. [00:08.54]Lyrics text. The LRC text is empty for instrumental music",
                                  "example": "{\"lyrics_lrc_timestamps\": \"[00:23.98]Two a.m., the neon hums\\n[00:28.26]Steam on the glass, the night still runs\"}"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuthenticationV2": {
        "type": "http",
        "scheme": "bearer",
        "description": "Use the standard 'Bearer authentication'. Put your 'API Key' in header: `Authorization:Bearer YOUR_API_KEY`. Notice that there is ' ' a space between 'Bearer' and the 'YOUR_API_KEY'."
      }
    },
    "schemas": {
      "BasicRunTaskResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "Response status",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "task_id": {
                "type": "string",
                "description": "ID of this task. Task result is valid to query by this ID for 30 days.",
                "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
              }
            }
          }
        }
      },
      "RunError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "Response status",
            "example": 400
          },
          "error": {
            "type": "string",
            "description": "Error message",
            "example": "The operation could not be completed"
          },
          "error_code": {
            "type": "string",
            "enum": [
              "InvalidParameters",
              "CreditInsufficiency",
              "InvalidStyleGroup",
              "InvalidStyle",
              "BadRequest"
            ],
            "description": "Error code:\n  * InvalidParameters - Invalid request parameters\n  * CreditInsufficiency - Insufficient unit to run\n  * BadRequest - Unexpected request parameter\n  * InvalidStyleGroup - Invalid style group id\n  * InvalidStyle - Invalid style id\n"
          }
        }
      },
      "EngineErrorCode": {
        "type": "string",
        "nullable": true,
        "enum": [
          "error_exceed_max_image_size",
          "exceed_max_filesize",
          "invalid_parameter",
          "error_download_image",
          "error_download_mask",
          "error_decode_image",
          "error_decode_mask",
          "error_nsfw_content_detected",
          "error_no_face",
          "error_pose",
          "error_face_parsing",
          "error_inference",
          "exceed_nsfw_retry_limits",
          "error_upload",
          "unknown_internal_error"
        ],
        "description": "Errors:\n- \\`error_exceed_max_image_size\\`  - Input image size exceeds the maximum limit\n- \\`exceed_max_filesize\\` - Input file size exceeds the maximum limit\n- \\`invalid_parameter\\` - Invalid parameter value\n- \\`error_download_image\\` - Download source image error\n- \\`error_download_mask\\` - Download mask image error\n- \\`error_decode_image\\` - Decode source image error\n- \\`error_decode_mask\\` - Decode mask image error\n- \\`error_nsfw_content_detected\\` - NSFW content detected in source image\n- \\`error_no_face\\` - No face detected on source image\n- \\`error_pose\\` - Failed to detect pose on source image\n- \\`error_face_parsing\\` - Failed to do face segmentation on source image\n- \\`error_inference\\` - Inference pipeline error\n- \\`exceed_nsfw_retry_limits\\` - Exceed the retry limits to avoid generated NSFW image\n- \\`error_upload\\` - Upload result image error\n- \\`unknown_internal_error\\` - Others\n"
      },
      "TaskStatusResponseBodySingleUrlResultsV2": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "URL to download this result. Valid for 2 hours",
            "example": "https://example.com/sample-result-url"
          }
        }
      },
      "TaskStatusResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "Response status",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "task_status": {
                "type": "string",
                "enum": [
                  "running",
                  "success",
                  "error"
                ],
                "description": "Status of this task"
              },
              "error": {
                "$ref": "#/components/schemas/EngineErrorCode"
              },
              "error_message": {
                "type": "string",
                "description": "Detailed description of error"
              },
              "results": null
            }
          }
        },
        "$ref": "#/components/schemas/TaskStatusResponseBodySingleUrlResultsV2"
      }
    },
    "responses": {
      "InvalidApiKey": {
        "description": "Invalid or missing API key",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 401,
                  "description": "Response status"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid API key"
                }
              }
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Too many requests",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 429,
                  "description": "Response status"
                },
                "error": {
                  "type": "string",
                  "example": "Too many requests"
                }
              }
            }
          }
        }
      },
      "InvalidTaskId": {
        "description": "Invalid task ID",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 400,
                  "description": "Response status"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid task ID"
                }
              }
            }
          }
        }
      },
      "TaskTimeout": {
        "description": "Task execution timeout",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 500,
                  "description": "Response status"
                },
                "error": {
                  "type": "string",
                  "example": "Task execution timed out"
                }
              }
            }
          }
        }
      }
    }
  }
}