Skip to main content
POST
Generate music from a text prompt
Generate music tracks from text with control over lyrics, tempo, key, and style. Returns a request_id for status polling.
Prerequisite: Consult the Model Selection endpoint to identify a valid model slug and check its parameter limits. Model slugs look like AceStep_1_5_Turbo — always take them from the models endpoint rather than hard-coding a display name.

Field values worth knowing

These constraints are enforced by validation and are easy to trip over:
timesignature is validated as an integer, not as musical notation. If you populate it from a UI dropdown offering values like 4/4 or 6/8, convert to the integer before sending — otherwise only the requests that set the field fail, while the rest keep succeeding.

Authorizations

Authorization
string
header
required

Sanctum personal access token, sent as Authorization: Bearer <token>. The token is opaque — it carries no claims and no embedded expiry, so do not attempt to decode it. Issue and revoke tokens from your account dashboard.

Headers

Accept
enum<string>
default:application/json
required
Available options:
application/json

Body

multipart/form-data

Music generation parameters

Every example in this schema is a working set for the model example shown — they are not defaults and not portable. Sizes, step counts, frame counts and frame rates are all per-model: read info.limits and info.defaults for the model you actually intend to use from GET /api/v2/models. Substituting a different model while keeping these values is the most common source of a 422.

caption
string
required

Text description of the music to generate

Example:

"upbeat electronic dance music with energetic synths"

model
string
required

The model to use for music generation. Available models can be retrieved via the GET /api/v2/models endpoint.

Example:

"AceStep_1_5_Turbo"

lyrics
string
required

Lyrics for the music. Use "[Instrumental]" for instrumental tracks without vocals.

Example:

"[Instrumental]"

duration
number
required

Duration in seconds (10-600). The accepted range is model-specific — read info.limits.min_duration/max_duration for your model from GET /api/v2/models. Some models additionally cap duration per output format via info.limits.max_duration_by_format.

Example:

30

inference_steps
integer
required

Number of diffusion inference steps (1-100). Use 8 for turbo models, 32+ for base models. The accepted range is model-specific — read info.limits.min_steps/max_steps for your model from GET /api/v2/models; several models pin it to a single value.

Example:

8

guidance_scale
number
required

Classifier-free guidance scale. The accepted range is model-specific — read info.limits.min_guidance / max_guidance for your model from GET /api/v2/models. Several models pin it to a single value (AceStep_1_5_Turbo accepts only 1), so a value outside that range is rejected with 422.

Example:

1

seed
integer
required

Random seed. Use -1 for random.

Example:

-1

format
string
required

Audio output format. Read info.limits.output_formats for your model from GET /api/v2/models and send one of the listed values; anything else is rejected with 422.

Example:

"mp3"

bpm
integer | null

Beats per minute (30-300)

Example:

120

keyscale
string | null

Musical key/scale (e.g. "C major", "F# minor")

Example:

"C major"

timesignature
integer | null

Time signature. Must be 2, 3, 4, or 6.

Example:

4

vocal_language
string | null

Language code for vocals (e.g. "en", "es", "fr")

Example:

"en"

reference_audio
file | null

Optional reference audio file for style transfer. Supported formats: mp3, wav, flac, ogg, m4a. Max size configurable (default 10MB). Duration must be within model-specific limits.

webhook_url
string<uri> | null

Optional HTTPS URL to receive webhook notifications for job status changes (processing, completed, failed). Must be HTTPS. Max 2048 characters. A per-request URL is self-contained: it is delivered even when the account has no webhook configuration, or the account webhook is disabled. See the webhooks block at the top level of this document for the event payloads and the headers each delivery carries.

Maximum string length: 2048
Example:

"https://your-server.com/webhooks/deapi"

webhook_secret
string | null

Optional per-request HMAC secret (min. 32 chars) used to sign the webhook callback. Overrides the account-default secret for this job only. If omitted, the account-default secret signs the callback; if no secret exists at all, the callback is still delivered but UNSIGNED (empty X-DeAPI-Signature header). Requires webhook_url to also be set.

Required string length: 32 - 255
Example:

"a1b2c3d4e5f60708091a2b3c4d5e6f7081920a1b2c3d4e5f60708091a2b3c4d5"

Response

ID of the inference request.

data
object
required

Information from success endpoint