API parameters for the Fun-Music music generation model.
User guide: For model overview and selection guidance, see Music generation.
This model is currently in limited preview. Apply for access on the Model Gallery before use. This model is available only in the China (Beijing) region.
Prerequisites
An API key is required. To get one, see Get an API key.
Endpoint
POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/audio/music/generation, Replace WorkspaceId with your actual workspace ID.
Protocol: HTTPS. For streaming output, set the X-DashScope-SSE request header to enable SSE (Server-Sent Events).
Model Studio has released workspace-specific domains for the China (Beijing) and Singapore regions. The new dedicated domains deliver superior performance and higher stability for inference requests. We recommend migrating to the new domains:
-
China (Beijing): from
https://dashscope.aliyuncs.comtohttps://{WorkspaceId}.cn-beijing.maas.aliyuncs.com -
Singapore: from
https://dashscope-intl.aliyuncs.comtohttps://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com
{WorkspaceId} is your workspace ID, which can be found on the Workspace Details page in the Model Studio console. The existing domain remains fully functional.
Request headers
Parameter | Type | Required | Description |
Authorization | string | Yes |
|
Content-Type | string | Yes |
|
X-DashScope-SSE | string | No | Set to |
Request body | Non-streamingStreaming |
model Model name. Allowed values:
| |
input Input parameters. |
Response object | Non-streamingStreaming (intermediate message)Streaming (final message) |
request_id Request ID, used for troubleshooting and log tracing. | |
output Model output. | |
usage Billing information for this request. |