Skip to main content

Interface: MusicGenerateRequest

Defined in: packages/agentos/src/core/audio/types.ts:80

Request payload for music generation from a text prompt.

Passed to IAudioGenerator.generateMusic by the high-level orchestration layer after normalising user input.

Example

const request: MusicGenerateRequest = {
prompt: 'Upbeat lo-fi hip hop beat with vinyl crackle and mellow piano',
durationSec: 60,
outputFormat: 'mp3',
};

Properties

durationSec?

optional durationSec: number

Defined in: packages/agentos/src/core/audio/types.ts:102

Desired output duration in seconds.

Provider limits vary: Suno caps at ~240s, Stable Audio at ~47s. Exceeding the limit may result in truncation or an error.


modelId?

optional modelId: string

Defined in: packages/agentos/src/core/audio/types.ts:94

Model identifier to use for generation.

When omitted the provider falls back to its IAudioGenerator.defaultModelId.


n?

optional n: number

Defined in: packages/agentos/src/core/audio/types.ts:131

Number of audio clips to generate.

Default

1

negativePrompt?

optional negativePrompt: string

Defined in: packages/agentos/src/core/audio/types.ts:110

Negative prompt describing musical elements to avoid.

Not all providers support negative prompts — unsupported values are silently ignored by the adapter.


outputFormat?

optional outputFormat: AudioOutputFormat

Defined in: packages/agentos/src/core/audio/types.ts:117

Output audio format.

Default

'mp3'

prompt

prompt: string

Defined in: packages/agentos/src/core/audio/types.ts:87

Text prompt describing the desired musical composition.

Quality and specificity of the prompt directly influence output quality. Include genre, mood, instrumentation, and tempo for best results.


providerOptions?

optional providerOptions: Record<string, unknown>

Defined in: packages/agentos/src/core/audio/types.ts:137

Arbitrary provider-specific options.


seed?

optional seed: number

Defined in: packages/agentos/src/core/audio/types.ts:124

Seed for reproducible output.

Not all providers honour seeds — check provider documentation.


userId?

optional userId: string

Defined in: packages/agentos/src/core/audio/types.ts:134

Identifier of the requesting user (for billing / rate limiting).