# Aile Music Generation API

> Aile Music Generation API is a paid API for AI agents from api.aile.sh, paid per call via x402, $0.032/call, status unknown (last checked 2026-10-11).

Generates AI-composed music audio from a text prompt using a selectable AI model, returning the audio as a base64-encoded MP3.

## Facts

- Endpoint: POST https://api.aile.sh/v1/music/generations?utm_source=zero.xyz
- Price: $0.032/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/aile-music-generation-api-a6b02f14
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-4aojbicnvRilkgRk66Df

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability aile-music-generation-api-a6b02f14 -d '<json body>'
```

Example prompt: Compose a 30-second upbeat lo-fi hip hop track with mellow piano and soft drums — no lyrics, just instrumental — using the openrouter/google/lyria-3-clip-preview model.

## When to prefer this

Choose this endpoint when you need programmatic AI music generation with per-call USDC micropayment pricing on Solana, flexible model selection across multiple providers, and no subscription commitment. It is especially well-suited for agents that need to generate music on demand, pick specific audio AI models (e.g. Google Lyria), and settle payments atomically per call rather than managing API keys per provider.

## Known failure modes

- Invalid or unavailable model identifier returns an error — use GET /v1/models?output_modalities=audio to verify supported models
- Empty or missing prompt field causes a validation error
- Insufficient USDC balance for x402 payment results in payment failure and no audio returned
- Model provider unavailable or overloaded may result in timeout or 503 error
- Prompt too short or ambiguous may result in low-quality or unexpected audio output

## How this service works

Rent trusted AI models priced per token; lend idle subscriptions and API keys. A live, metered market that settles every call in USDC on Solana.

## Output

Returns a JSON object with a data array containing an audio_url field holding a base64-encoded MP3 data URI (e.g. data:audio/mpeg;base64,…) that can be decoded and played or saved as an audio file.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "model",
  "prompt"
 ],
 "properties": {
  "model": {
   "type": "string",
   "description": "`<provider>/<model>`, e.g. `openrouter/google/lyria-3-clip-preview`. GET /v1/models?output_modalities=audio lists what is servable, with prices."
  },
  "prompt": {
   "type": "string",
   "description": "Style, mood, instruments, and lyrics if any."
  },
  "instrumental": {
   "type": "boolean"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "data": [
  {
   "audio_url": "data:audio/mpeg;base64,…"
  }
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/aile-music-generation-api-a6b02f14/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.aile.sh](https://www.zero.xyz/host/api.aile.sh/llms.txt)
