# ACE-Step > Generate full songs or instrumental music from genre tags and optional lyrics, with duration you control up to 4 minutes. ## Overview - **Endpoint**: `https://queue.modelrunner.run/ace-studio/ace-step` - **Model ID**: `ace-studio/ace-step` - **Category**: music - **Kind**: inference - **Tags**: ace-step, text-to-music, music-generation, text-to-audio, audio, song ## Pricing - **Price**: $0.0002 per output second ## Request Lifecycle This model runs on the ModelRunner **asynchronous queue API** — a single POST does not return the output. Every call requires an `Authorization: Key $MODEL_RUNNER_KEY` header. Run three steps: 1. **Submit** — `POST https://queue.modelrunner.run/ace-studio/ace-step` with a JSON body holding the input fields at the top level. The body may also include a reserved top-level `metadata` object — a flat string map (max 16 keys, key ≤64 / value ≤512 chars) stored on the request for your own tagging. It is never sent to the model; filter your request history with `GET https://queue.modelrunner.run/requests?metadata=` (exact key=value matches, AND-ed). The response carries request handles only (no output yet): ```json { "status": "IN_QUEUE", "request_id": "<21-char id>", "status_url": "https://queue.modelrunner.run/ace-studio/ace-step/requests//status", "response_url": "https://queue.modelrunner.run/ace-studio/ace-step/requests/", "cancel_url": "https://queue.modelrunner.run/ace-studio/ace-step/requests//cancel" } ``` 2. **Poll status** — `GET ` until `status` is `COMPLETED`. Possible values are `IN_QUEUE`, `IN_PROGRESS`, `COMPLETED`, `FAILED`, `CANCELLED`. A `FAILED` request responds with HTTP 400 and an `error` field. 3. **Read result** — `GET `. Returns the finished request, including the generated `output`: ```json { "id": "", "status": "COMPLETED", "output": ..., "input": ... } ``` The JavaScript and Python SDKs below perform steps 2–3 for you. In any language without an SDK (Swift, Go, Kotlin, etc.) you must implement the polling loop and the final result fetch yourself — see the cURL example for the full flow. ### Input Schema - **`seed`** (`integer | null`, _optional_): Random seed for reproducible generation. Leave empty for a random result. - **`tags`** (`string`, _required_): Comma-separated genre, mood, and instrument tags that define the musical style (e.g. 'lofi, hiphop, chill' or 'epic orchestral, cinematic'). This is the style control, not a prose prompt. - **`lyrics`** (`string`, _optional_): Optional song lyrics. Use section markers like \[verse\], \[chorus\], and \[bridge\] to structure a sung track. Leave empty or set to \[inst\]/\[instrumental\] for an instrumental piece. - Default: `""` - **`duration`** (`number`, _optional_): Length of the generated audio in seconds. - Default: `60` - Range: `5` to `240` - **`scheduler`** (`SchedulerEnum`, _optional_): Diffusion sampler used during generation. - Default: `"euler"` - Options: `"euler"`, `"heun"` - **`guidance_type`** (`GuidanceTypeEnum`, _optional_): Guidance algorithm. apg is the most stable default; cfg and cfg_star are alternatives. - Default: `"apg"` - Options: `"cfg"`, `"apg"`, `"cfg_star"` - **`guidance_scale`** (`number`, _optional_): Classifier-free guidance scale; higher values follow the tags and lyrics more strictly. - Default: `15` - Range: `0` to `200` - **`number_of_steps`** (`integer`, _optional_): Number of generation steps. More steps can improve quality at the cost of speed. - Default: `27` - Range: `3` to `60` - **`granularity_scale`** (`integer`, _optional_): Controls artifact reduction granularity during generation. - Default: `10` - Range: `-100` to `100` - **`guidance_interval`** (`number`, _optional_): Fraction of the generation over which guidance is applied. - Default: `0.5` - Range: `0` to `1` - **`tag_guidance_scale`** (`number`, _optional_): How strongly generation adheres to the genre tags. - Default: `5` - Range: `0` to `10` - **`lyric_guidance_scale`** (`number`, _optional_): How strongly generation adheres to the provided lyrics. - Default: `1.5` - Range: `0` to `10` - **`minimum_guidance_scale`** (`number`, _optional_): Floor that the guidance scale decays toward over the guidance interval. - Default: `3` - Range: `0` to `200` - **`guidance_interval_decay`** (`number`, _optional_): How much the guidance scale decays across the guidance interval. - Default: `0` - Range: `0` to `1` ### Output Schema _No `Output` schema properties are available._ ## Default Example **Input** ```json { "tags": "lofi, chill, piano", "lyrics": "", "duration": 8, "scheduler": "euler", "guidance_type": "apg", "guidance_scale": 15, "number_of_steps": 27, "granularity_scale": 10, "guidance_interval": 0.5, "tag_guidance_scale": 5, "lyric_guidance_scale": 1.5, "minimum_guidance_scale": 3, "guidance_interval_decay": 0 } ``` **Output** ```json "https://media.modelrunner.ai/GfMii5rKQtJbfHFa1OdRb.wav" ``` ## Usage Examples ### cURL The queue API is asynchronous: submit the request, poll `status_url` until it is `COMPLETED`, then read the result from `response_url`. Requires `jq`. ```bash # 1. Submit the request (returns request handles, not the output) SUBMIT=$(curl --silent --request POST \ --url https://queue.modelrunner.run/ace-studio/ace-step \ --header "Authorization: Key $MODEL_RUNNER_KEY" \ --header "Content-Type: application/json" \ --data '{ "tags": "lofi, chill, piano", "lyrics": "", "duration": 8, "scheduler": "euler", "guidance_type": "apg", "guidance_scale": 15, "number_of_steps": 27, "granularity_scale": 10, "guidance_interval": 0.5, "tag_guidance_scale": 5, "lyric_guidance_scale": 1.5, "minimum_guidance_scale": 3, "guidance_interval_decay": 0 }') STATUS_URL=$(echo "$SUBMIT" | jq -r '.status_url') RESPONSE_URL=$(echo "$SUBMIT" | jq -r '.response_url') # 2. Poll until the request leaves the queue / in-progress state while true; do STATUS=$(curl --silent --url "$STATUS_URL" \ --header "Authorization: Key $MODEL_RUNNER_KEY" | jq -r '.status') echo "Status: $STATUS" case "$STATUS" in COMPLETED) break ;; FAILED|CANCELLED) echo "Request $STATUS"; exit 1 ;; esac sleep 1 done # 3. Read the finished request, including the generated output curl --silent --url "$RESPONSE_URL" \ --header "Authorization: Key $MODEL_RUNNER_KEY" ``` ### JavaScript ```javascript import { modelrunner } from "@modelrunner/client"; const result = await modelrunner.subscribe("ace-studio/ace-step", { input: { "tags": "lofi, chill, piano", "lyrics": "", "duration": 8, "scheduler": "euler", "guidance_type": "apg", "guidance_scale": 15, "number_of_steps": 27, "granularity_scale": 10, "guidance_interval": 0.5, "tag_guidance_scale": 5, "lyric_guidance_scale": 1.5, "minimum_guidance_scale": 3, "guidance_interval_decay": 0 } }); console.log(result.data); ``` ### Python ```python import asyncio import modelrunner_ai async def main(): response = await modelrunner_ai.submit_async( "ace-studio/ace-step", arguments={ "tags": "lofi, chill, piano", "lyrics": "", "duration": 8, "scheduler": "euler", "guidance_type": "apg", "guidance_scale": 15, "number_of_steps": 27, "granularity_scale": 10, "guidance_interval": 0.5, "tag_guidance_scale": 5, "lyric_guidance_scale": 1.5, "minimum_guidance_scale": 3, "guidance_interval_decay": 0 } ) result = await response.get() print(result["output"]) asyncio.run(main()) ``` ## Additional Resources - [Playground](https://modelrunner.ai/models/ace-studio/ace-step) - [OpenAPI Schema](https://modelrunner.ai/models/ace-studio/ace-step/openapi.json) - [LLM Instructions](https://modelrunner.ai/models/ace-studio/ace-step/llms.txt)