> For the complete documentation index, see [llms.txt](https://docs.muzaic.ai/muzaic-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.muzaic.ai/muzaic-api-docs/reference/api-reference/soundtrack.md).

# soundtrack

## Generate soundtrack

> Generates a soundtrack based on provided parameters and regions.\
> The same operation is available as \`POST /soundtrack/{origin}\`; when origin is present in the path,\
> the API key must be valid for that origin and the endpoint must be allowed for it (see Admin API origin-endpoint config).<br>

```json
{"openapi":"3.0.0","info":{"title":"Muzaic Core API","version":"1.0.0"},"tags":[{"name":"Soundtrack","description":"Soundtrack generation operations"}],"servers":[{"url":"https://m10.muzaic.ai","description":"Core API server"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"MuzaicAPI-Secret-Key"}}},"paths":{"/soundtrack":{"post":{"summary":"Generate soundtrack","description":"Generates a soundtrack based on provided parameters and regions.\nThe same operation is available as `POST /soundtrack/{origin}`; when origin is present in the path,\nthe API key must be valid for that origin and the endpoint must be allowed for it (see Admin API origin-endpoint config).\n","tags":["Soundtrack"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["regions"],"properties":{"regions":{"type":"array","description":"Array of audio regions to generate","items":{"type":"object","required":["time","duration","action"],"properties":{"time":{"type":"number","format":"float","description":"Start time in seconds"},"duration":{"type":"number","format":"float","description":"Duration in seconds"},"action":{"type":"string","description":"Action to perform","enum":["generate","copy","silence"]},"method":{"type":"string","description":"Generation method","enum":["strict","smart"]},"tags":{"type":"array","items":{"type":"integer"},"description":"Array of tag IDs"},"params":{"type":"object","description":"Generation parameters","properties":{"intensity":{"type":"integer","minimum":1,"maximum":10},"tempo":{"type":"integer","minimum":1,"maximum":10},"tone":{"type":"integer","minimum":1,"maximum":10},"variance":{"type":"integer","minimum":1,"maximum":10},"rhythm":{"type":"integer","minimum":1,"maximum":10}}},"sourceHash":{"type":"string","description":"Source hash for copy action"}}}},"normalize":{"type":"boolean","description":"Whether to normalize audio"}}}}}},"responses":{"200":{"description":"Soundtrack generated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"apiVersion":{"type":"string"},"status":{"type":"array","items":{"type":"string"}},"regions":{"type":"integer","description":"Number of regions processed"},"regionHashes":{"type":"array","items":{"type":"string"},"description":"Array of region hashes"},"audioDuration":{"type":"number","format":"float","description":"Total audio duration in seconds"},"mp3":{"type":"string","description":"Base64 encoded MP3 audio data"},"tokensUsed":{"type":"integer","description":"Number of tokens consumed"}}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.muzaic.ai/muzaic-api-docs/reference/api-reference/soundtrack.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
