HiAPI
Эта статья пока недоступна на вашем языке — показываем оригинал.
Блог

Tutorial

MiniMax Music 1.5 Practical Guide: 5 High-Value Use Cases for Developers

From prompt and lyrics to format, bitrate, and sample rate: how to ship music generation features that hold up

Nov 16, 2026 14 min read
Minimalist cover in pale mauve and ink black split by a decisive hard edge with a thin violet seam — cover art for a developer tutorial.
На этой странице
Generated with MiniMax Music 1.5 on HiAPI — one prompt, one full song.

Why MiniMax Music 1.5 Fits Product Workflows

Most "music generation" demos are impressive once and painful to ship. They ask for inputs your product doesn't collect, return audio your pipeline can't route, and make cost projections a guessing game. MiniMax Music 1.5 on HiAPI is a better fit for real workflows because it makes three things explicit up front: exactly two required inputs, a fixed set of output encodings, and a billing unit you can count.

The contract is simple. You send a style prompt (10-300 characters) that describes genre, mood, and instrumentation, plus lyrics (10-600 characters, one phrase per line). The model returns audio. On top of that, three optional parameters control how the audio is delivered: audio_format (mp3, wav, or pcm), bitrate in bps (32000, 64000, 128000, or 256000), and sample_rate in Hz (16000, 24000, 32000, or 44100).

That shape matters for architecture. A narrow, character-bounded prompt is something you can generate programmatically from a template or a form field. A lyrics field with line breaks and optional structure tags is something a template can own entirely. And an output format enum means the same feature can feed a web player, a video muxer, and a game engine without a transcoding layer bolted on afterward.

Billing is per song, which turns budgeting into a counting problem rather than an audio-minutes problem. You know how many generations a user flow triggers, so you know the shape of the cost curve before you ship.

The rest of this guide walks through the two inputs, five use cases that share the same constrained-prompt pattern, the output settings, cost planning, and a pre-flight checklist for validation.

The Two Required Inputs: Prompt and Lyrics

Everything downstream depends on getting these two fields right, so treat them as a design surface rather than a free-text box.

The prompt: style, not content

The prompt field is 10-300 characters and controls the music, not the words. Use it for genre, mood, tempo feel, and instrumentation. Keep it tight and comma-separated:

warm acoustic folk, fingerpicked guitar, soft strings, uplifting, mid tempo

Because the limit is small, the prompt is ideal for an enum-driven UI: let users pick a genre, a mood, and an instrumentation set, then compose the string yourself. That gives you predictable, on-brand outputs and prevents users from pasting a thousand-word brief that silently gets truncated.

The lyrics: one phrase per line

The lyrics field is 10-600 characters. The documented convention is one phrase per line, separated by \n. Line breaks are not cosmetic — they are how the model reads phrase structure. Collapse a song into one paragraph and you lose that signal.

Structure tags are supported: [intro], [verse], [chorus], [bridge], [outro]. Use them to shape the arrangement:

[intro]
Morning light on the window frame
[verse]
Coffee going cold again
Same old street, a different name
[chorus]
We keep moving, we keep moving
[outro]
Morning light on the window frame

A few practical rules that save iterations: count characters before sending, keep lines short enough to be sung comfortably, and reuse a known-good tag skeleton across generations so the only variable is the words themselves. If your product generates lyrics from user input, truncate and validate on your side, and show the user the final text before you spend a generation on it.

Use Case 1: Personalized Audio Gifts

This is the highest-emotion, lowest-complexity flow: a user answers a few questions about a person or an occasion, and receives a short personalized song.

The trick is to never let the user write free-form lyrics. Ask for a name, a relationship, two or three memories, and a vibe. Then assemble lyrics from a fixed template with slots:

[verse]
{name} always {memory_one}
Every time we {memory_two}
[chorus]
Happy {occasion}, {name}
This one's yours

Keep the prompt equally bounded — pick from three or four style presets ("warm acoustic," "bright pop," "slow piano") and append the user's chosen mood word. The result is a song that feels personal because the words are personal, while the musical output stays inside a range you have already listened to and approved.

Because billing is per song, a gift flow maps cleanly onto a single generation per order. If you offer one free regeneration for dissatisfaction, model that as two generations per order in your cost math rather than as a refund problem. Store the rendered prompt and lyrics alongside the audio file so support can reproduce any complaint exactly.

One implementation note: gifts are usually delivered as a shareable file. mp3 with a moderate bitrate keeps file sizes friendly for messaging apps, which is where these links get opened.

Use Case 2: Short-Form Video Background Tracks

Creator tools and marketing pipelines need beds of background music that can be reused across many clips without a licensing conversation every time. This is a volume use case, and volume is where per-song billing earns its keep.

The pattern that works: maintain a small library of style prompts (say, "lo-fi hip hop, mellow keys, vinyl texture, no vocals" — note that the lyrics field still needs content, so keep instrumental intent in the prompt and use minimal, non-verbal or one-line lyric placeholders). Generate a batch, audition them once, and store the keepers in your asset store keyed by prompt hash. Every future video request looks up the library first and only generates on a miss.

That lookup-before-generate step is the difference between a predictable cost curve and a runaway one. Because each generation is one countable song, you can set a hard cap per day or per workspace and know exactly what it means.

For video specifically, wav at a higher sample rate is a reasonable choice when your muxer will re-encode anyway, since it avoids stacking lossy compression. If the asset goes straight to a web player, mp3 at a moderate bitrate is fine. Either way, keep the generated file as the source of truth and derive delivery variants from it rather than regenerating per channel.

Use Case 3: Brand and Product Sonic Identity

A sonic identity is a family of short audio assets that all sound like they came from the same place: an app launch sting, a notification, a podcast intro, a short outro for product videos. The hardest part is usually consistency, and consistency is exactly what a frozen style prompt buys you.

Write the brand prompt once, agree on it with whoever owns the brand, and treat it as a versioned constant in your codebase:

soft synth pad, warm analog tone, minimal percussion, confident, calm

Then vary only the lyrics field and, where needed, a single adjective appended to the prompt for the specific asset ("shorter," "brighter"). Using structure tags to make the piece very short — an [intro] line and an [outro] line, nothing between — is a simple way to get stingers from the same model that produces longer pieces.

Generate a candidate set, pick three or four, and pin them. When the brand evolves, you regenerate from the same base prompt with a deliberate delta, which gives you a documented history of how the sound changed rather than a folder of mystery files.

This use case is also where reproducibility pays off most: store prompt, lyrics, audio_format, bitrate, and sample_rate with every approved asset. If a designer asks for "the same thing but two seconds shorter" six months later, you have the exact inputs.

Use Case 4: Games and Interactive Media Stingers

Games and apps need short cues: level-complete jingles, transition pieces, menu loops, reward sounds. These are small, repeated, and format-sensitive.

Generation should not happen at runtime in the player's critical path. Treat it as an offline or async pipeline step: request a cue, cache the returned file in your asset bundle or CDN, and let the game client play the cached file. If you do want runtime variation — say, a different sting per player — generate asynchronously, show a placeholder sound immediately, and swap the file in when it arrives.

Format choice matters more here than in any other use case. pcm gives you raw audio that an engine can load without a decode step, which can matter for tight timing, but it is large and you should not ship it over a network casually. wav is the safe middle ground for sound design handoff. mp3 is best for streamed or downloaded assets where decode latency is acceptable. Set sample_rate to match your engine's mix rate when you can, so you avoid a resample at load time.

Keep cue prompts short and descriptive of function as well as style — "bright ascending synth chime, short, celebratory" — and keep the lyrics field to a minimal phrase, since these pieces are usually instrumental in feel. Cache aggressively: a cue that plays a thousand times per session should be generated once.

Use Case 5: Educational and Language Content

In learning content, the lyrics are the product. A language drill that conjugates a verb over a catchy melody, or a children's song that teaches counting, works because the words carry the payload and the music makes them stick.

That inverts the usual priority. Spend your effort on the lyrics field, and use a small set of safe, simple style prompts — "gentle children's song, ukulele, cheerful," "clear pop vocal, moderate tempo, easy to follow." Predictability beats novelty here: a series of lessons should sound like a series.

Two constraints to design around. First, 600 characters is not a lot of text; if your lesson needs more, split it across multiple songs rather than compressing the content. Second, one phrase per line is essential for intelligibility — write lyrics the way you would want them sung, with short lines and clear rhymes at the ends.

Because each song is a discrete billed unit, a lesson library is easy to scope: number of lessons equals number of generations, plus a regeneration allowance for the ones you reject in review. Store the exact lyrics with each audio file so that when a curriculum is revised you can diff the text and regenerate only the lessons that actually changed.

Output Settings and Reprocessing

Three optional parameters decide what you get back. Defaults are sensible, but choosing deliberately avoids a reprocessing step later.

audio_format

mp3 (default) is the right choice for delivery to web players, messaging, and anywhere file size matters. wav is for handoff to a video muxer, a DAW, or a game asset pipeline where you expect further processing and want to avoid stacking lossy stages. pcm is raw audio, useful when you control the playback stack and want to skip decoding.

bitrate

Values are 32000, 64000, 128000, and 256000 bps, with 256000 as the default. Higher bitrate means larger files and more fidelity. For background music under speech, a lower value is often indistinguishable and saves bandwidth. For a hero asset — a brand sting, a gift song someone will replay — keep the default.

sample_rate

Values are 16000, 24000, 32000, and 44100 Hz, defaulting to 44100. Match your playback or mix environment where you can: 44100 for general music delivery, 32000 or 24000 for compact assets and voice-adjacent content, 16000 when the target pipeline is telephony-grade or heavily compressed anyway.

When to regenerate instead of reprocess

If you already hold a lossless file, changing delivery format is a local transcode — no generation needed. Regenerate only when the content is wrong: the style drifted, the lyrics don't fit the melody, or the arrangement is too long. Because billing is per song, a regenerate-for-format is pure waste; a regenerate-for-content is a reasonable design decision. Instrument your pipeline so you can tell the two apart in logs.

Cost Planning at $0.07 per Song

Billing is per song, at a flat rate with a single tier. That means your budget model has one input: the number of generations.

Start from the user action, not the API call. For a gift flow, one order is one generation, plus a regeneration allowance — call it two. For a video pipeline with a library lookup, steady-state cost approaches the miss rate rather than the request rate. For a lesson library, the cost is a one-time build plus a delta on revision. Multiplying generations by the per-song rate gives you a number you can put in a planning doc without an audio-duration caveat.

Three levers keep the count down:

  • Constrain inputs. Enum-driven prompts and templated lyrics produce fewer rejects, and rejects are still billed generations if they reach the API.
  • Cache by input hash. Hash the prompt plus lyrics plus output settings; if the tuple exists in your asset store, serve it instead of generating.
  • Validate before calling. Length limits and enum values are cheap to check locally and expensive to discover after a failed request.

The corollary is that post-processing is almost always the cheaper path once you have a file. Transcoding, trimming, and loudness normalization are free relative to generation; rewriting lyrics is not.

Validation and Error Handling Before the Call

Most wasted generations come from inputs that were never going to be valid. Build a pre-flight gate and run every request through it.

Length checks

  • prompt: 10-300 characters. Reject empty, too short, and too long. Trim whitespace before counting; do not silently truncate without telling the caller.
  • lyrics: 10-600 characters. Same treatment, and count characters after your template substitution, not before.

Enum checks

  • audio_format must be one of mp3, wav, pcm.
  • bitrate must be one of 32000, 64000, 128000, 256000.
  • sample_rate must be one of 16000, 24000, 32000, 44100.

Coerce from your internal config to these exact values rather than passing user-supplied integers through.

Structure sanity

Lyrics should be one phrase per line. If your generated text contains a single long line, split it or reject it. If you use structure tags, validate they are from the supported set — [intro], [verse], [chorus], [bridge], [outro] — and that they are on their own lines.

Failure handling

Route validation failures back to a correction step with a specific message ("lyrics are 612 characters; shorten by 12") rather than a generic error, and do not retry a failed generation automatically until the input has actually changed. Log the full input tuple with every request and every response so that support, analytics, and reproducibility all read from the same record.

A short checklist you can implement in one function: lengths valid, enums coerced, lyric lines split, tags whitelisted, tuple hashed and deduplicated.

Shipping Checklist and Next Steps

Before you launch, make these decisions explicit:

  • Prompt strategy. Enums plus a composer, or free text with validation? Constrained wins for consistency.
  • Lyrics ownership. Templated, generated, or user-written — and who sees the final text before a generation is spent.
  • Output profile per channel. One format and bitrate per destination, chosen deliberately rather than defaulted into.
  • Cache key. The full input tuple, hashed, stored with the audio file and a timestamp.
  • Regeneration policy. How many per user action, and what triggers one.
  • Budget cap. A hard limit on generations per workspace or per day.
  • Validation gate. Lengths, enums, line structure, and tag whitelist, all checked before the call.

Get those seven right and the model becomes a dependable pipeline step rather than a demo. For route details, parameters, and the current price panel, see the MiniMax Music 1.5 model page.

Похожие статьи

Все статьи →

Начните работать с постоянными артефактами ИИ

Получите API-ключ и вызывайте модели изображений, видео и аудио через один API на основе tasks.

Читать документацию API