x402 · USDC on Base or Solana · live

Text to music, paid per call

Describe the genre, mood, instruments and tempo, settle the 402 in USDC, and an original Google Lyria 3 track comes back in the same response.

POST /api/x402/music · from $0.06

Turn the sound on: the only audio in this reel is a Google Lyria 3 bed, scored from one line of description. It was made on our own account, not bought here; the music endpoint sells the same model, the track alone.Google Lyria 3

Try it

1 · Ask for the price (free)
curl -i -X POST https://www.trezalabs.com/api/x402/music \
  -H 'Content-Type: application/json' \
  -d '{"prompt":"warm lo-fi hip hop, soft piano chords, vinyl crackle, relaxed 80 bpm groove","model":"lyria-3-clip"}'

Without a payment this answers 402 Payment Required, with the price for exactly this body, the USDC token and the address to pay in the PAYMENT-REQUIRED header. Nothing is charged.

2 · Pay and collect, with Coinbase's awal wallet
npx awal@latest x402 pay https://www.trezalabs.com/api/x402/music \
  -X POST \
  -d '{"prompt":"warm lo-fi hip hop, soft piano chords, vinyl crackle, relaxed 80 bpm groove","model":"lyria-3-clip"}' \
  --max-amount 60000

awal reads the 402, pays it from your agentic wallet in USDC on Base, repeats the request and prints the response. --max-amount caps the payment in USDC units of a millionth: 60,000 is $0.06, this body's price. Any other x402 client works the same way.

Or just read what it asks for
npx awal@latest x402 details https://www.trezalabs.com/api/x402/music

Price

Quoted per request in the 402, so read it from there rather than hard-coding it. A render that fails gets a free retry.

  • Google Lyria 3 Clipdefaultlyria-3-clip

    $0.06

  • Google Lyria 3 Prolyria-3-pro

    $0.12

Limits

  • prompt: up to 2,000 characters.
  • Returns an MP3 URL in the JSON response, with a statusUrl you can GET again for free.
  • 60 requests per hour per IP address, before any payment is looked at.
  • Paid in USDC on Base or Solana. Fields the endpoint does not read are refused before payment, not charged for and ignored.
  • lyria-3-clip is a 30-second piece: a bed, a sting or a loop. lyria-3-pro is a full-length song with an intro, a development and an ending.

A bare GET /api/x402/music answers with the whole menu as JSON.

What a paid call returns
{
  "runId": "2026-09-23T18:04:11.000Z#1a2b3c4d",
  "status": "success",
  "audio": "https://www.trezalabs.com/api/media/generated/x402_music/1a2b3c4d.mp3?s=...&c=...",
  "statusUrl": "https://www.trezalabs.com/api/x402/music?runId=...&token=...",
  "paidUsd": 0.06,
  "model": "lyria-3-clip",
  "transaction": "0x..."
}