For the complete documentation index, see llms.txt. This page is also available as Markdown.

soundtrack

Generate soundtrack

post

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).

Authorizations
MuzaicAPI-Secret-KeystringRequired
Body
normalizebooleanOptional

Whether to normalize audio

Example: true
Responses
200

Soundtrack generated successfully

application/json
apiVersionstringOptionalExample: 1.0.0
statusstring[]OptionalExample: ["region 0 completed"]
regionsintegerOptional

Number of regions processed

Example: 1
regionHashesstring[]Optional

Array of region hashes

Example: ["abc123def456"]
audioDurationnumber · floatOptional

Total audio duration in seconds

Example: 30
mp3stringOptional

Base64 encoded MP3 audio data

Example: data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4Ljc2LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAAAwAAAb...
tokensUsedintegerOptional

Number of tokens consumed

Example: 30
post/soundtrack
POST /soundtrack HTTP/1.1
Host: m10.muzaic.ai
MuzaicAPI-Secret-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 204

{
  "regions": [
    {
      "time": 0,
      "duration": 30,
      "action": "generate",
      "method": "strict",
      "tags": [
        1,
        2,
        3
      ],
      "params": {
        "intensity": 7,
        "tempo": 8,
        "tone": 5,
        "variance": 5,
        "rhythm": 5
      },
      "sourceHash": "abc123def456"
    }
  ],
  "normalize": true
}
{
  "apiVersion": "1.0.0",
  "status": [
    "region 0 completed"
  ],
  "regions": 1,
  "regionHashes": [
    "abc123def456"
  ],
  "audioDuration": 30,
  "mp3": "data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4Ljc2LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAAAwAAAb...",
  "tokensUsed": 30
}

Last updated