Create Music
Changed onGenerate a music track with lyria-3-pro. The request waits for the track and answers 200 with a time-limited audio_url to the mp3. duration_seconds is a target: a longer render is cut to it with a fade-out, and a shorter one is kept, so read the returned duration_seconds for the real length. Send an Idempotency-Key header with every request: it is required. Repeating a request with the same key and body returns the original track instead of generating again, and a duplicate sent while the original is still running gets 409 request_in_progress. Each track is priced at the vendor's flat per-song cost. A request the workspace's API credits cannot cover is refused with 402 insufficient_credit before the model runs. The credits are charged once the track is made, and a failed generation is not charged. If the balance no longer covers the charge when the track is ready, the request answers 402 insufficient_credit without it.
Request
- Base URLhttps://api.heygen.com
- URLhttps://api.heygen.com/v3/audio/music
- Auth
- API key in header x-api-key
- or HTTP bearer
Headers
Required client-supplied key for safely retrying a request that charges. A retry within 24 hours that shares this key returns the original response instead of running again. The body must be the same: a different body under the same key returns 409 conflict. A retry that arrives while the original is still in flight gets a 409 request_in_progress. When the original could not be confirmed, repeating it with the same key settles that attempt instead of starting another. Scope is the space plus the request path, so the same key on another video is independent, and a key sent by another member of the space replays that member's response. A missing or blank value is rejected with 400. Keys must be 1–255 characters from [A-Za-z0-9_:.-]; a UUID is a safe default.
Request body
Response
The finished track with its download URL.
Changes
- info
endpoint added
- info