API reference · ace

ace/ace-step

Integrate this model through SandBase's unified API, with production-ready schemas and examples.

AUDIOAsyncOpen model
Production endpoint

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

POSThttps://api.sandbase.ai/v1/run
Model IDace/ace-step
01

Input Schema

14 parameters · 0 required · 14 optional

ParameterTypeRequiredDescription
seedintegerOptionalRandom seed for reproducibility. If not provided, a random seed will be used.
tagsstringOptionalComma-separated list of genre tags to control the style of the generated audio.
lyricsstringOptionalLyrics to be sung in the audio. If not provided or if [inst] or [instrumental] is the content of this field, no lyrics will be sung. Use control structures like [verse], [chorus] and [bridge] to control the structure of the song. · Default: ""
durationintegerOptionalThe duration of the generated audio in seconds. · Min: 5 · Max: 240 · Default: 60
schedulerstringOptionalScheduler to use for the generation process. · Options: euler, heun · Default: "euler"
eulerheun
guidance_typestringOptionalType of CFG to use for the generation process. · Options: cfg, apg, cfg_star · Default: "apg"
cfgapgcfg_star
guidance_scalenumberOptionalGuidance scale for the generation. · Min: 0 · Max: 200 · Default: 15
number_of_stepsintegerOptionalNumber of steps to generate the audio. · Min: 3 · Max: 60 · Default: 27
granularity_scaleintegerOptionalGranularity scale for the generation process. Higher values can reduce artifacts. · Min: -100 · Max: 100 · Default: 10
guidance_intervalnumberOptionalGuidance interval for the generation. 0.5 means only apply guidance in the middle steps (0.25 * infer_steps to 0.75 * infer_steps) · Min: 0 · Max: 1 · Default: 0.5
tag_guidance_scalenumberOptionalTag guidance scale for the generation. · Min: 0 · Max: 10 · Default: 5
lyric_guidance_scalenumberOptionalLyric guidance scale for the generation. · Min: 0 · Max: 10 · Default: 1.5
minimum_guidance_scalenumberOptionalMinimum guidance scale for the generation after the decay. · Min: 0 · Max: 200 · Default: 3
guidance_interval_decaynumberOptionalGuidance interval decay for the generation. Guidance scale will decay from guidance_scale to min_guidance_scale in the interval. 0.0 means no decay. · Min: 0 · Max: 1 · Default: 0
02

Output Schema

FieldTypeDescription
idstringUnique identifier for the generation task
statusstringTask status: pending, running, completed, failed, timeout
modelstringModel used for the generation
outputsarrayArray of output items
outputs[].urlstringURL of the generated artifact
outputs[].content_typestringMIME type (e.g. image/png, video/mp4)
errorobject | nullError details if failed, null on success
error.typestringMachine-readable error type code
error.messagestringHuman-readable error description

Async Workflow

This model uses asynchronous execution. Submit a request and poll for the result.

  1. Submit — POST to /v1/run, receive an id
  2. Poll — GET /v1/run/{id} until status is completed, failed, or timeout
  3. Retrieve — Read outputs from the completed response
03

Code Examples

Ready-to-run snippets

const apiKey = process.env.SANDBASE_API_KEY;
const response = await fetch("https://api.sandbase.ai/v1/run", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "ace/ace-step",
    "tags": "lofi, hiphop, drum and bass, trap, chill",
    "duration": 60,
    "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
  }),
});

if (!response.ok) throw new Error(await response.text());
let result = await response.json();
for (let attempt = 0; attempt < 120 && !["completed", "failed", "timeout"].includes(result.status); attempt++) {
  await new Promise((resolve) => setTimeout(resolve, 2_000));
  const poll = await fetch(`https://api.sandbase.ai/v1/run/${result.id}`, {
    headers: { Authorization: `Bearer ${apiKey}` },
  });
  if (!poll.ok) throw new Error(await poll.text());
  result = await poll.json();
}
if (result.status !== "completed") throw new Error(`Generation ended: ${result.status}`);
console.log(result);