Skip to content

Suno

Create music with POST /api/v2/media/tasks and model: "suno". Set your GPTunneL API key in the GPTUNNEL_API_KEY environment variable.

This method accepts text for Suno generation. To validate the request and get a quote, send the same model, prompt, params and inputs to the price endpoint.

Describe the sound in prompt using up to 500 characters. To supply your own lyrics, title and style separately, set is_custom: true.

Окно терминала
curl 'https://gptunnel.ru/api/v2/media/tasks' \
-H "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"model": "suno",
"prompt": "Спокойный lo-fi трек с мягким пианино и лёгкими ударными"
}'

Pass the lyrics in prompt, the title in params.title and the style description in params.tags.

Окно терминала
curl 'https://gptunnel.ru/api/v2/media/tasks' \
-H "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"model": "suno",
"prompt": "[Verse]\nMorning lights along the shore\nWaves are rolling in once more\nWe count the boats against the blue\nAnd wait to watch the sky turn new",
"params": {
"is_custom": true,
"version": "chirp-v6",
"title": "Along the Shore",
"tags": "Indie pop, acoustic guitar, soft drums, 95 BPM",
"vocal_gender": "f"
}
}'
Parameter What to pass
is_custom Set to true to provide your own lyrics, style and title. Defaults to false.
version Suno version from the model catalog.
title Track title, up to 80 characters. Required when is_custom: true.
tags Style description. Required when is_custom: true. Up to 1,000 characters for v6 and v6 mini.
instrumental For a track without lyrics, pass is_custom: true, instrumental: true, title and tags. Omit prompt.
vocal_gender When is_custom: true, use f for female vocals or m for male vocals.
voice_id ID of a Suno voice you saved.

Retired Suno version IDs are mapped to current versions. The response reports the version used in params.version.

For v6 and v6 mini, lyrics can contain up to 5,000 characters, counted in UTF-16 code units, like JavaScript String.length. For example, 🎵 takes two units.

For an instrumental track with your own style, use the following request body.

{
"model": "suno",
"params": {
"is_custom": true,
"instrumental": true,
"title": "У берега",
"tags": "Акустическая гитара, мягкие ударные, 95 BPM"
}
}

The Suno model entry describes this combination in prompt_optional_when. An invalid value for a known parameter returns HTTP 400 with the field name in details. Unknown names appear in ignored_params.

Окно терминала
curl 'https://gptunnel.ru/api/v2/media/voices?model=suno' \
-H "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}"

Take voices[].id from the response and use it as params.voice_id. Choose chirp-v6 and omit vocal_gender. For a song with your own lyrics, send the voice ID along with is_custom: true, the title and the style. For an instrumental track, pick a voice marked supports_instrumental: true. The catalog returns saved Suno voices for the key owner. Create a voice in the GPTunneL music tool to get a voice_id. Omit voice_id to let Suno pick the vocals.

If the voice is missing from the owner’s library or incompatible with the selected version, the API returns HTTP 400 before creating a task or charging the account. The provider can also reject a saved voice during generation. Once you have the task id, check the final status with GET /api/v2/media/tasks/{id}.

To retry safely after a timeout, set idempotency_key in the first request to /tasks and retry with the same body and key. Replace TASK_ID with the id from the creation response.

Окно терминала
curl "https://gptunnel.ru/api/v2/media/tasks/${TASK_ID:?Set TASK_ID}" \
-H "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}"

When the status is done, result[].url contains the links to both tracks. See Get task result.