Source: https://ailoot.ai/models/en/google-lyria/
Canonical: https://ailoot.ai/models/en/google-lyria/
Language: en

# Lyria

[Markdown](https://ailoot.ai/models/en/google-lyria/index.md) · [JSON](https://ailoot.ai/models/en/google-lyria/facts.json)

## [Lyria](https://ailoot.ai/models/en/google-lyria/)

Text-to-music generation with one to eight requested clips and synchronous result delivery.

- [**Ailoot · Music** `POST /v1/music/generations` `google/lyria`](https://ailoot.ai/models/en/google-lyria/#method-0)

About the model

This description covers the model’s capabilities. Available in Ailoot inputs, outputs and options are listed for the selected method below.

google/lyria creates music from a written prompt through /v1/music/generations. A concrete use is requesting a restrained instrumental bed for a product demonstration, describing the foreground instruments and how much space the narration needs. Choose this route when a generated music clip is the desired result.

The request requires model and prompt. The n or count control accepts one to eight clips, and the method returns its generation result synchronously. Save every returned clip and its actual metadata. This entry does not expose audio-reference input, a duration setting or a tempo field, so those are not independently selectable controls. Describe musical intent in the prompt without treating it as a guaranteed measured property of the output.

**Ailoot · Music** `POST /v1/music/generations` `google/lyria`

[`google/lyria`](https://ailoot.ai/models/en/#m=google%2Flyria&route=Core&caller=google%2Flyria&fmt=music)

Google /`google/lyria`

### Overview

Text-to-music generation with one to eight requested clips and synchronous result delivery.

Accepted inputs

Text

Results

music

### Available in Ailoot · inputs & methods

**Ailoot · Music** `POST /v1/music/generations`

Input types

`text`

Output types

`music`

Output format

complete owned audio clips / JSON links

| Field | Type | Requirement | Values & limits | Default |
| --- | --- | --- | --- | --- |
| Field`model` | Type`string` | RequirementRequired | Values & limits google/lyria | Default— |
| Field`prompt` | Type`string` | RequirementRequired | Values & limits Minimum length: 1 | Default— |
| Field`n` | Type`integer` | RequirementOptional | Values & limits Minimum: 1 Maximum: 8 | Default1 |
| Field`count` | Type`integer` | RequirementOptional | Values & limits Minimum: 1 Maximum: 8 Conditions: Ifnalso supplied, countmustagree | Default— |

Input material combinations

**text\_to\_music** · Required: prompt

Method parameters and lifecycle

| Parameter | Contract |
| --- | --- |
| Parameter`material_types` | Contracttext |
| Parameter`required` | Contractnull |
| Parameter`optional_controls` | Contractnull |

Lifecycle: `synchronous_result_then_owned_library`

`GET /v1/media/tasks/{task_id}` · actual returned task\_id or media library record

`GET /v1/media/assets/{asset_id}/content`

`GET /v1/media/assets`

`GET /v1/media/assets/{asset_id}`

Method shapes and IDs are exact; supplier capability is separate from admission.

### Pricing

#### Ailoot method rates

Output

$0.08 *per clip*

Reference only · not added

$0.08 *per request*

Delivered clips × base clip rate. The per-request reference is not added. Examples are before applicable adjustments.

`1 × $0.08 = $0.08`

`4 × $0.08 = $0.32`

Ailoot reserves an estimated amount before a request. After the result, it settles the final charge from measured usage. Streaming settlement uses the final usage record. [How reservation and settlement work →](https://ailoot.ai/docs/en/billing/reserve/)

### Example requests

#### Ailoot · Music

Music example

```bash
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_PROMPT_FILE:?Set your actual UTF-8 music brief}"
export AILOOT_PROMPT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "google/lyria", "prompt": ""}')
f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 brief")
p['prompt']=f.read_text(encoding="utf-8")
if not p['prompt'].strip():raise SystemExit("Brief must contain text")
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/music/generations \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
export AILOOT_API_KEY
python3 - <<'PY_RESULT'
import json, os, subprocess
from pathlib import Path
from urllib.parse import urljoin, urlparse
result=json.loads(Path("result.json").read_text(encoding="utf-8"))
print(json.dumps(result,ensure_ascii=False,indent=2))
for number,clip in enumerate(result.get("data") or []):
    u=urlparse(urljoin("https://api.ailoot.ai",clip["url"]))
    if u.scheme!="https" or not u.hostname or u.username or u.password:
        raise SystemExit("Result URL must be HTTPS without embedded credentials")
    owned=u.netloc=="api.ailoot.ai" and u.path.startswith("/v1/media/assets/") and u.path.endswith("/content")
    args=["curl","--fail-with-body","--silent","--show-error",u.geturl()]
    if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
    raw=subprocess.check_output(args)
    ext="wav" if raw.startswith(b"RIFF") and raw[8:12]==b"WAVE" else "flac" if raw.startswith(b"fLaC") else "ogg" if raw.startswith(b"OggS") else "mp3" if raw.startswith(b"ID3") or raw[:1]==b"\xff" else "bin"
    f=Path("music-"+str(number)+"."+ext);f.write_bytes(raw)
    print("Saved",f,clip.get("asset_id"))

PY_RESULT
```

### Receive and save results

#### Ailoot · Music

complete owned audio clips / JSON links

- `GET /v1/media/tasks/{task_id}`
- `GET /v1/media/assets/{asset_id}/content`
- `GET /v1/media/assets`
- `GET /v1/media/assets/{asset_id}`

##### Keep all completed results

Keep every complete returned response, file and content part.

Save/fetch every returned clip and preserve actual ID, MIME and metadata. The method is synchronous; no separate Ailoot music generationpollingURL is introduced.

##### If the original response needs checking

If a music result requires a check, keep the original operation\_id/X-Client-Request-ID and returned clip information. Recover existing owned clips through the media library using actual task\_id or asset\_id values. Do not resubmit the music request or construct a generation polling URL from operation\_id.

Response fields

| Field | Type |
| --- | --- |
| Field`model` | Typestring |
| Field`response_id` | Typestring |
| Field`data[]` | Typeowned clip record |

Errors and next steps

| Response | Condition | Next step |
| --- | --- | --- |
| Response400 · `invalid_request_error` | ConditionInvalid required fields, material representation or parameter value | Next stepCorrect the indicated fields before a new creation request. |
| Response`server_error` | ConditionThe returned response says the operation or result requires a check | Next stepKeep the original returned operation/task ID, request headers and response; continue supported reads of that original operation. Do not resubmit the creation request. |

### Aliases

#### Model aliases

**Ailoot** [`google/lyria`](https://ailoot.ai/models/en/#m=google%2Flyria&route=Core&caller=google%2Flyria&fmt=music)

#### Method path aliases

Use the method paths shown above.

#### Related caller IDs

[`google/lyria`](https://ailoot.ai/models/en/#m=google%2Flyria&route=Core&caller=google%2Flyria&fmt=music)

FAQ · Lyria

What inputs and results are available?

`POST /v1/music/generations` · `google/lyria`: `text` → `music`

Which fields does the request use?

`POST /v1/music/generations` · `google/lyria`: `model`, `prompt`, `n`, `count`

What limits apply?

`POST /v1/music/generations` · `google/lyria`: `n.minimum`: `1`; `n.maximum`: `8`; `count.minimum`: `1`; `count.maximum`: `8`

Connect Ailoot to Claude Code, OpenCode, Hermes or your own app.

## The company and its project portfolio

The company and its project portfolio: millions of customers; monthly sales in the billions.

## Buy tokens at a discount.

Subscription discounts for regular use. Promo codes offer up to 50% off token purchases.

Subscription

Choose a discounted plan for your regular requests.

Promo code: up to 50% off

Enter your code at checkout. The price updates to reflect the current promotion.

Spending in your history

The model, tokens and amount are recorded for each request.

[Choose a subscription](https://ailoot.ai/docs/en/billing/subscriptions/) · [View model prices](https://ailoot.ai/models/en/)

## Connect the API to a product you sell.

Use Ailoot in SaaS, apps and bots under its official service offer and licence agreement. Request a reseller licence for resale.

Commercial application

Add text, image, video and audio generation to paid features in your service.

Reseller licence

Send a description of your project and how you provide access. Request written terms for use and resale.

Documents on the website

The service offer, licence agreement and data processing policy are available before you connect.

[Request a reseller licence](mailto:support@ailoot.ai) · [Service offer and licence agreement](https://ailoot.ai/legal/offer?lang=en)

## Ailoot · The company and its project portfolio





Ailoot combines established operating experience, a large client base, stable service and ongoing KPI control.





The company and its project portfolio: millions of customers; monthly sales in the billions.





Ailoot brings that operating experience to API access for AI features in customer products, agents, applications and automations.
