暂无中文版本——显示英文。

POST /v1/music/generations

Generate music from a text prompt, with optional lyrics. Routes to providers running a music service (ACE-Step). The response is the raw audio bytes (audio/mpeg by default) — not JSON.

Request

curl https://api.inference.club/v1/music/generations \
  -H "Authorization: Bearer $INFERENCE_CLUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "ace-step",
    "prompt": "dreamy lo-fi hip-hop with mellow piano and soft vinyl crackle",
    "lyrics": "[verse]\nNeon rain on the window...",
    "audio_duration": 60
  }' \
  --output song.mp3
FieldTypeNotes
modelstringRequired. A model with service_type: music from GET /v1/models.
promptstringRequired. Style, mood, instruments.
lyricsstringOptional. Use [verse] / [chorus] section tags.
audio_durationnumberSeconds, 5–300. Omit to let the model decide.
audio_formatstringmp3 (default), wav, flac, opus, aac.
inference_stepsinteger1–200, default 8.
guidance_scalenumber0–30, default 7.
seedintegerFixed seed; or use_random_seed: true (default).
bpmintegerOptional tempo hint.
key_scalestringOptional, e.g. "C major".
vocal_languagestringOptional, e.g. "en".

Also accepts the visibility and collection sharing fields.

Response

The finished audio, streamed back with Content-Disposition: inline. The request and its audio are stored in your dashboard (and in Dashboard → Music) for replay, sharing, and playlists.

Errors use the standard error format: 404 no_provider when no online provider serves the model, 413 when prompt + lyrics are too long.