Skip to content

Taan Music

Taan Music v1 creates music from the mood, instruments and moments you describe. It uses the same endpoint as Lyria, /v1/audio/music; the request fields differ.

Model Output Price ($/second)
taan/music-v1 10-240 second track, WAV or MP3 0.01

Pricing is per second of generated music: a 30-second track costs $0.30. A fractional length is rounded up to the next tenth of a second. A refinement that changes nothing is not charged.

What you send What input means Where the length comes from
input only A description of the music duration_sec, default 30
script Musical direction duration_sec, default 30
midi A description of the sound, one line of at most 256 characters The MIDI file
music_id The change to make The track being refined
Terminal window
curl "$LLMTR_BASE_URL/v1/audio/music" \
-H "Authorization: Bearer llmtr-your_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: your-request-id" \
-d '{
"model": "taan/music-v1",
"input": "Gentle solo piano with a hopeful ending. No vocals or percussion.",
"duration_sec": 30,
"audio_format": "mp3"
}'

Send the script as text in script, at most 100,000 characters. input is the musical direction; the length comes from duration_sec, default 30.

{
"model": "taan/music-v1",
"input": "Warm piano and strings, building toward the final smile.",
"script": "INT. KITCHEN - NIGHT. Maya reads the letter alone, then smiles.",
"duration_sec": 60,
"audio_format": "mp3"
}

The notes and the length come from the MIDI file; input only describes the sound: style, instruments, mood. The score must run 10 to 240 seconds.

{
"model": "taan/music-v1",
"input": "Gentle acoustic piano with warm sustained strings, instrumental, no vocals.",
"midi": "data:audio/midi;base64,TVRoZAAAAAYAAAAB...",
"seed": 42
}

seed lets you get the same result again. If you leave it out, one is chosen and returned in the response.

Send the music_id from an earlier response and the change to make. Tracks made from text or a script can be refined; a track made from MIDI cannot.

{
"model": "taan/music-v1",
"music_id": "0b6c3f9e-2d41-4c7a-8e15-9a3d7f2b6c40",
"input": "Add a sustained strings accompaniment. Preserve the piano melody and duration."
}

refinement.outcome in the response tells you what happened:

Value Meaning Charge
changed A new version was made. Keep refining with the new music_id. The track's length
unchanged No change was needed; the original track is returned. None
unsupported The change could not be made; the original track is returned. None

refinement.explanation, when present, says why.

The track comes back as base64 in data[0].b64_json, with its type in mime_type. music_id points to the track in a later refinement request.

{
"id": "6f1c2a7e-0d3b-4a8e-9c55-2b7e41d09a13",
"object": "music.generation",
"model": "taan/music-v1",
"status": "completed",
"music_id": "0b6c3f9e-2d41-4c7a-8e15-9a3d7f2b6c40",
"data": [
{ "b64_json": "UklGRphiOgBXQVZF...", "mime_type": "audio/wav" }
],
"text": "",
"usage": { "seconds": 30 }
}

WAV takes about 384 KB a second and MP3 about 40 KB. A 240-second WAV is 92 MB, so send "audio_format": "mp3" to keep the response small.

Field Description
model taan/music-v1. Required.
input The description, the direction, the MIDI sound description or the refinement instruction. Required. At most 8,000 characters; with MIDI, one line of at most 256 characters.
duration_sec 10-240 seconds. Default 30. Ignored with MIDI or a refinement.
audio_format wav or mp3. Default wav.
script Inline script text, at most 100,000 characters.
midi Base64 data URL: a Standard MIDI File.
seed Integer from 0 to 2147483647. Used with MIDI only.
music_id The track to refine. Cannot be combined with midi or script.
max_budget_usd The most you allow for this request. Below the cost, the request returns 400 before it starts.

If a field in this table means nothing for the way you use the model, such as duration_sec with MIDI, the request does not fail; the field is ignored and listed in llmtr_dropped_parameters in the response.

Generation can take a few minutes. If your connection drops, send the same request again with the same Idempotency-Key header: the music is not generated again, the finished track is returned, and the request is charged at most once. Use a new key for a different request; a different request with the same key returns 409. The key must be 1-128 printable ASCII characters without spaces. If the connection drops after generation has started, the track is still finished and charged; asking again with the same key returns it without a second charge. So send an Idempotency-Key with every request.

If a request takes longer than 15 seconds, the status code 200 is sent at once and blank lines follow until the answer is ready; JSON parsers skip them and you do not need to configure anything. A failure after that point comes in the body as an error field, so check the response for error as well.

Status Type When
400 invalid_request A field is not valid. The message starts with the field.
402 insufficient_credits Your balance does not cover the request.
404 not_found The music_id was not found on this account.
409 idempotency_conflict The same Idempotency-Key was used with a different request.
502 provider_error The track could not be made. You can retry.
503 model_busy The model is busy right now. Wait for Retry-After and retry.
503 model_unavailable The model is not available right now. Try again later.
504 provider_timeout The track did not finish in time. If you sent an Idempotency-Key, retry with the same key.

You are not charged for a failed request.

This model is provided through a third-party provider. The text and MIDI files you send may be stored by the provider and used to train Taan's models. Do not send sensitive, personal or customer data. LLMTR does not store your prompt or the music.