Generate song
Model id ai-music-api/generate. Create a task, then poll it. The playground on the Suno model page sends the same fields.
Create a task
POST https://modelfold.ai/api/v1/jobs/createTask
curl https://modelfold.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"ai-music-api/generate","input":{"custom_mode":false,"instrumental":true,"model":"V6_MINI","style":"acoustic guitar","prompt":"A short sunny acoustic sketch"}}'const created = await fetch('https://modelfold.ai/api/v1/jobs/createTask', {
method: 'POST',
headers: { Authorization: 'Bearer ' + process.env.MODELFOLD_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({"model":"ai-music-api/generate","input":{"custom_mode":false,"instrumental":true,"model":"V6_MINI","style":"acoustic guitar","prompt":"A short sunny acoustic sketch"}}),
}).then((r) => r.json())A synchronous call is also accepted at POST https://modelfold.ai/v1/audio/generations with the same JSON body flattened (model plus the input fields). Long songs should use the jobs API.
Parameters
| Field | Type | Required | Meaning |
|---|---|---|---|
model | string | yes | Version |
custom_mode | boolean | yes | Custom mode |
instrumental | boolean | yes | Instrumental |
prompt | string | no | Prompt |
style | string | no | Style |
title | string | no | Title |
lyrics | string | no | Lyrics |
negative_tags | string | no | Exclude |
vocal_gender | string | no | Vocal gender |
style_weight | number | no | Style weight |
weirdness_constraint | number | no | Weirdness |
audio_weight | number | no | Audio weight |
variety | number | no | Variety |
persona_id | string | no | Persona id |
persona_model | string | no | Persona type |
duration | number | no | Duration (seconds) |
image_urls | url | no | Reference images |
video_urls | url | no | Reference videos |
audio_urls | url | no | Reference audio |
Non-custom mode needs at least one of style, lyrics, image_urls, video_urls, or audio_urls. A prompt by itself is not enough. Custom mode needs title and at least one of style, lyrics, prompt, or negative_tags. duration is only accepted for V5_5, V6, V6_MINI, and V6_WILD when custom mode is on, from 10 to 360 seconds. V4 through V5.5 are discontinued and can fail; the failed call is refunded. V6_MINI, V6, and V6_WILD are the current versions. The price does not change with the version.
Price
Upstream cost 12 credits per call. Sale price is ceil(cost × markup). At the default 1.5× markup this is 18 credits.
The markup can be changed in site settings (price_markup). Per-model upstream costs can be overridden with the suno_pricing setting.
Result
GET https://modelfold.ai/api/v1/jobs/recordInfo?taskId=TASK_ID
When state is success, resultJson contains resultUrls (audio, video, MIDI, or a text sidecar) and resultObject.sourceTaskId plus resultObject.tracks[].id. Follow-up calls use that source task id and track id. A failed task is refunded.
Webhook
Optional callBackUrl must be public HTTPS on port 443. callbackSecret is 32 to 256 characters. ModelFold POSTs the event below and signs the raw body. Signature is base64 HMAC-SHA256 of timestamp.eventId.rawBody, sent as X-ModelFold-Signature, with X-ModelFold-Timestamp and X-ModelFold-Event-Id.
{
"event": "task.completed",
"data": { "taskId": "MODELFOLD_TASK_ID", "model": "ai-music-api/generate", "state": "success" }
}More Suno endpoints
Extend · Cover · Upload and extend · Add instrumental · Add vocals · Mashup · Separate vocals · Replace section · Sound effect · Music video · Timestamped lyrics · Lyrics · Boost style · Convert to WAV · Recover audio · Cover image · Persona · MIDI · Create voice · Check voice · Validation phrase · Regenerate phrase
