Skip to main content

Overview

AI music generation enables creators to produce high-quality music without professional music knowledge. Suno and Producer represent two approaches to AI music generation, unified through Ace Data Cloud API calls.

Involved Services

  • Suno: POST https://api.acedata.cloud/suno/audios
  • Producer: POST https://api.acedata.cloud/producer/audios

Technical Solution

Prerequisites

  1. Register an account at Ace Data Cloud
  2. Obtain an API Token
  3. Install Python 3.7+ and the requests library

Implementation Steps

Step 1: Choose a Music Engine

Suno supports multi-style song generation, while Producer (FUZZ) focuses on high-fidelity music production.

Step 2: Generate Music

Use /suno/audios for Suno, and /producer/audios for Producer.

Step 3: Customize Lyrics

Set custom: true and provide the lyric field to generate music with custom lyrics.

Code Example

Below is a complete Python example using Suno:
import requests

API_TOKEN = "YOUR_API_TOKEN"

def call_suno():
    response = requests.post(
        "https://api.acedata.cloud/suno/audios",
        headers={
            "Authorization": f"Bearer {API_TOKEN}",
            "Content-Type": "application/json",
        },
        json={
    "action": "generate",
    "prompt": "A cheerful pop song about summer vacation",
    "model": "chirp-v5",
    "custom": false
},
    )
    return response.json()

result = call_suno()
print(result)

Best Practices

  • Error Retry: Implement exponential backoff retries for 429 (rate limiting) and 5xx errors
  • Asynchronous Processing: For time-consuming tasks (image/video generation), use callback_url to receive results asynchronously
  • Cost Control: Monitor usage and expenses via the Ace Data Cloud console
  • Token Security: Store API Tokens in environment variables; avoid hardcoding them in code