We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.
Music and audio generation API
Describe the music or ask for a spoken reply, and receive audio in the chat completion response. Useful for jingles, background tracks and voice-first apps.
- Background music for videos
- Jingles and sound beds
- Voice-first assistants
- Prototyping audio ideas
Sign in to use thisCreate free account
Results will appear here.
5 of 5 free messages left today. A free account adds free usage and an API key.Create free accountSign inSession cost $0.00
Settings
Music generation API · 4 models
| Model | Provider | Context | Price |
|---|---|---|---|
| Google: Lyria 3 Pro Previewgoogle/lyria-3-pro-preview | Free | ||
| Google: Lyria 3 Clip Previewgoogle/lyria-3-clip-preview | Free | ||
| OpenAI: GPT Audio Miniopenai/gpt-audio-mini | OpenAI | $2.10 / 1M tokens$8.40 / 1M tokens | |
| OpenAI: GPT Audioopenai/gpt-audio | OpenAI | $8.75 / 1M tokens$35.00 / 1M tokens |
How to call the Music generation API API
- Create an API key in your dashboard.
- Install the official openai SDK for your language.
- Set baseURL to https://api14.com/api/v1 and model to "openai/gpt-audio-mini".
How do I get audio back?
Call chat completions with modalities ["text", "audio"]; the audio arrives base64-encoded in the message.
How is audio output priced?
By input and output tokens like other chat models; audio output tokens have their own price on the model page.
Can I use the audio commercially?
Check the terms of the model provider; usage rights are set by the provider of each model.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api14.com/api/v1",
apiKey: process.env.API14_API_KEY,
});
const result = await client.chat.completions.create({
"model": "openai/gpt-audio-mini",
"messages": [
{
"role": "user",
"content": "Explain vector databases in two sentences."
}
]
});
console.log(result.choices[0].message.content);