Lyria 2 API
Google high-fidelity instrumental music generation.
Lyria 2 is a music generation model from Google, available on OttoPort's OpenAI-compatible API as the model ID lyria-2 at $0.069 / second as of 2026-10-14.
Provider
Price
$0.069 / second
Model ID
lyria-2
Type
music generation model
Create with Lyria 2
musicYour result appears here
Start with the example prompt or make it your own. Your OttoPort account is used securely for generation.
Lyria 2 API pricing
What OttoPort bills for Lyria 2, and what that works out to per unit. Rates are read from the same catalog the gateway meters against, and were current on 2026-10-14.
| Per second | $0.069 | |
|---|---|---|
| 30-second track | $2.07 | |
| 60-second track | $4.14 | |
| Seconds per $10 | 144 | of generated audio |
No subscription and no minimum — OttoPort bills prepaid credits against usage. See the full rate card.
Call Lyria 2 in three lines
Send "model": "lyria-2" to POST https://ottoport.ai/api/v1/audio/music with an OttoPort key. No Google account, no waitlist, no separate SDK.
curl https://ottoport.ai/api/v1/audio/music \
-H "Authorization: Bearer $OTTOPORT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "lyria-2",
"prompt": "warm optimistic electronic instrumental, 110 BPM, no vocals",
"duration": 30
}'import requests
job = requests.post(
"https://ottoport.ai/api/v1/audio/music",
headers={"Authorization": "Bearer " + API_KEY},
json={
"model": "lyria-2",
"prompt": "warm optimistic electronic instrumental, 110 BPM, no vocals",
"duration": 30,
},
).json()
print(job["status"])const res = await fetch("https://ottoport.ai/api/v1/audio/music", {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "lyria-2",
prompt: "warm optimistic electronic instrumental, 110 BPM, no vocals",
duration: 30,
}),
});
const job = await res.json();Before you start
- 1. Create a key at /api-keys.
- 2. Top up credits — the smallest pack is $25.
- 3. Paste the request. It returns a job ID; poll it or pass a webhook_url.
Full reference at /docs, or drive it from an agent with the MCP server and CLI.
Request parameters
The body POST https://ottoport.ai/api/v1/audio/music accepts for Lyria 2.
| Field | Type | Required | Notes |
|---|---|---|---|
| model | string | Yes | Always lyria-2 for Lyria 2. |
| prompt | string | Yes | Genre, mood, instrumentation, tempo. |
| duration | integer | No | Seconds of output. This is the billed unit. |
Lyria 2 direct vs through OttoPort
Lyria 2 is the same model either way — what changes is how many accounts, keys, and integrations you carry to reach it.
| Google direct | Via OttoPort | |
|---|---|---|
| Accounts and keys | A Google account, plus one more for every other model you add | One OttoPort account and one key for the whole catalog |
| Request shape | Google's own SDK and response format | OpenAI-compatible — point baseURL at OttoPort and change the model string |
| Switching models | A new integration per provider | Replace lyria-2 with any other model ID in the catalog |
| Billing | A separate invoice and contract per provider | Prepaid credits, no subscription, one usage ledger |
| Provider outages | Your call fails | Configured backup routes are tried in order on provider failure |
Set mood, genre, and energy.
Say whether vocals are wanted.
Describe the intended scene or usage.
Lyria 2 API questions
Cost, keys, and model IDs for Lyria 2 on OttoPort.
How much does the Lyria 2 API cost?
On OttoPort, Lyria 2 costs $0.069 / second as of 2026-10-14. For scale, 30-second track: $2.07. Billing is prepaid usage with no subscription and no minimum, and the current rate is always published at ottoport.ai/pricing.
How do I get a Lyria 2 API key?
You do not need a Google key. Create an OttoPort account, generate a key at ottoport.ai/api-keys, and send it as "Authorization: Bearer <key>" to POST https://ottoport.ai/api/v1/audio/music with "model": "lyria-2". The same key reaches every other model in the catalog.
What is the model ID for Lyria 2?
The OttoPort model ID for Lyria 2 is lyria-2. Pass it as the model field on POST https://ottoport.ai/api/v1/audio/music, or list it programmatically from GET https://ottoport.ai/api/v1/models.
Is Lyria 2 generation synchronous?
No. POST https://ottoport.ai/api/v1/audio/music returns a job ID immediately. Poll GET https://ottoport.ai/api/v1/videos/generations/{id} for status, or pass webhook_url and webhook_secret and OttoPort will call you when the job settles. You are billed per second of output, so a failed job costs nothing.
Do I need a Google account to use Lyria 2?
No. OttoPort connects to Google on your behalf, so one OttoPort account covers Lyria 2 and every other model in the catalog — no per-provider contracts, keys, or invoices.
Other music generation models on the same API
Same endpoint, same key — swapping model is a one-string change from lyria-2.
Suno v6 API
Suno
$0.152 / request
Suno v6 Mini API
Suno
$0.152 / request
Suno v6 Wild API
Suno
$0.152 / request
Seed-Music API
ByteDance
$0.034 / second
Browse the full catalog — every model with its provider and per-unit price.