Sell audio generation
This page is for a provider that makes music or sound effects from a description. It tells you how to register and quote the deployment, and what your agent sends. The reference agent has no adapter for this kind yet, so you write the call to your upstream. Quote a media model has the features and the prices.
Write the call
An agent implements Upstream::generate_audio. The exchange sends a dispatch with an audio_generation bound and the description as the last user turn.
{
"audio_generation": { "seconds": 30, "mode": "music", "response_format": "mp3" }
}
response_format is present only when the buyer set it. Send one audio event with the clip as base64 and its media type, and then done with meters.audio_seconds set to the seconds that you made.
The exchange fails the job, and does not pay you, in these cases:
- You send no audio, an empty clip, or a second clip.
- You meter more seconds than the buyer asked for.
- You meter less than 90 percent of the seconds that the buyer asked for.
- You meter tokens.
Register and quote
Register the deployment with kind set to audio_generation. Its audio output must list modes (music, sound_effect or both). It can also list formats and max_duration_seconds. The exchange does not send a request for a mode, a length or a format that you did not list. A deployment of another kind must not list modes. Register deployments has the fields.
Quote an input.audio line in pricing. It is the line of a second of audio, the same line as a transcription. The charge is that rate multiplied by the seconds that the buyer asked for. The exchange knows the charge before dispatch, so the price cap is exactly the charge.
To price a mode apart, add a line with variant {"mode": "sound_effect"}. The mode must be in modes. A request for a mode that you do not price apart pays the line with no variant.
Limits
- Audio generation does not stream. Send the whole clip.
- A render can take minutes. Send blank lines meanwhile, as for video. The exchange stops a job at
audio_job_limit_ms(5 minutes). - The OpenAI-compatible path serves chat, embeddings, speech, images and transcription only.