models

Lyria

Markdown · JSON

Lyria

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

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

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
FieldTypeRequirementValues & limitsDefault
FieldmodelTypestringRequirementRequiredValues & limits
google/lyria
Default—
FieldpromptTypestringRequirementRequiredValues & limits
Minimum length: 1
Default—
FieldnTypeintegerRequirementOptionalValues & limits
Minimum: 1
Maximum: 8
Default1
FieldcountTypeintegerRequirementOptionalValues & limits
Minimum: 1
Maximum: 8
Conditions: Ifnalso supplied, countmustagree
Default—
Input material combinations

text_to_music · Required: prompt

Method parameters and lifecycle
ParameterContract
Parametermaterial_typesContracttext
ParameterrequiredContractnull
Parameteroptional_controlsContractnull

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

Ailoot MusicPOST /v1/music/generations
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 →

Example requests

Ailoot · Music

Music example
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
FieldType
FieldmodelTypestring
Fieldresponse_idTypestring
Fielddata[]Typeowned clip record
Errors and next steps
ResponseConditionNext step
Response400 · invalid_request_errorConditionInvalid required fields, material representation or parameter valueNext stepCorrect the indicated fields before a new creation request.
Responseserver_errorConditionThe returned response says the operation or result requires a checkNext 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

Method path aliases

Use the method paths shown above.

Related caller IDs

google/lyria

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

More details

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 · View model prices

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 · Service offer and licence agreement