{"uid":"cap_5B3KFXiqwRcELHfe2yKam","slug":"treza-labs-music-generation-api-3d6d56a3","name":"Treza Labs Music Generation API","description":"Music generation: describe a track, get an original piece back in the same response. Google Lyria 3: a 30-second clip ($0.06) or a full song ($0.12). No account or API key: the payment is the only credential.","url":"https://www.trezalabs.com/api/x402/music?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["prompt"],"properties":{"async":{"type":"boolean","default":false,"description":"true: answer 202 with a statusUrl at once."},"model":{"enum":["lyria-3-clip","lyria-3-pro"],"type":"string","default":"lyria-3-clip","description":"lyria-3-clip: A 30-second piece: a bed for a short video, a sting, a loop. $0.06 lyria-3-pro: A full-length song with structure (intro, development, ending). $0.12"},"prompt":{"type":"string","maxLength":2000,"description":"Genre, mood, instruments, tempo."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"audio":"https://www.trezalabs.com/api/media/generated/x402_music/1a2b3c4d.mp3?s=...&c=...","model":"lyria-3-clip","runId":"2026-09-23T18:04:11.000Z#1a2b3c4d","status":"success","paidUsd":0.06,"statusUrl":"https://www.trezalabs.com/api/x402/music?runId=...&token=...","transaction":"0x..."}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.06","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.06/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.06","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.06","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_z8MGcmS3PKa5ainLpvkTu","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.06","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Generates original music from a text prompt using Google Lyria 3, returning either a 30-second clip or a full-length song in the response, paid per-call via x402 with no API key required.","exampleAgentPrompt":"Can you generate a 30-second upbeat lo-fi hip-hop track with soft piano and light drums for a study video background?","exampleUseCases":[{"title":"Background music for social media reel","prompt":"Make me a 30-second energetic electronic music clip with synths and a driving beat — I need it as a loop for a product launch reel."},{"title":"Full original song for a short film","prompt":"Generate a full-length moody cinematic song with strings and ambient pads, something that builds slowly with a clear intro and ending — it's for a short film I'm scoring."},{"title":"Podcast intro jingle","prompt":"Create a short 30-second upbeat acoustic jingle with guitar and light percussion that I can use as an intro sting for my podcast."}],"resultDescription":"The response contains the generated audio file — either a 30-second clip (lyria-3-clip) or a full-length structured song (lyria-3-pro) — returned directly in the API response body. No separate download step or polling is needed unless async mode is requested, in which case a 202 status and a statusUrl are returned for later retrieval.","failureModes":["Prompt too vague or missing genre/mood/instrument detail may result in generic or unexpected output","Payment failure or insufficient USDC balance blocks the request","Prompt exceeds 2000-character limit and is rejected","Model enum value is invalid, causing a 400 error","Async mode returns 202 with statusUrl but the downstream generation may time out or fail asynchronously","Network timeout during synchronous generation of longer lyria-3-pro tracks"],"whenToPreferThis":"Choose this endpoint when you need original AI-generated music on demand without signing up for an account or managing API keys — just pay per generation. It is ideal for agents automating media production pipelines, content creators needing background music or jingles, or any workflow where royalty-free original audio must be generated from a natural language description. The lyria-3-clip model is best for short loops and stings; lyria-3-pro is better for full structured songs. Prefer this over general music streaming or licensing APIs when you need generative, prompt-driven audio creation rather than retrieval of existing tracks.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T15:45:29.332Z","isFirstParty":false,"canonicalSlug":"treza-labs-music-generation-api-3d6d56a3"}