# 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"}}}}}}}}}}}
```
