# YouTube Music Video Analyzer (Lyria-Ready)

> YouTube Music Video Analyzer (Lyria-Ready) is a paid API for AI agents from audio.withzero.xyz, paid per call via MPP, $0.02/call, status unknown (last checked 2026-10-12, last successful call 2026-08-05).

Analyzes a bounded window of a public YouTube music video to extract tempo, key, groove, instrumentation, production details, timestamped sections, and outputs a ready-to-use Google Lyria music generation request.

## Facts

- Endpoint: POST https://audio.withzero.xyz/api/v1/music-analyses?utm_source=zero.xyz
- Price: $0.02/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-12
- Last successful call: 2026-08-05
- Success rate: 58% of calls made through Zero
- Rating: 4.7 / 5 from 2 reviews
- Activations on Zero: 12
- Provider: audio.withzero.xyz
- Website: https://audio.withzero.xyz
- Canonical page: https://www.zero.xyz/c/audio-withzero-xyz-youtube-music-video-analyzer-lyria-ready-057de1a8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cGyx03-bYTSnkWzIgCGx7

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 audio-withzero-xyz-youtube-music-video-analyzer-lyria-ready-057de1a8 -d '<json body>'
```

Example prompt: Analyze the first 3 minutes of this YouTube track https://www.youtube.com/watch?v=dQw4w9WgXcQ — I want the tempo, key, drum and bass groove breakdown, and a compiled instrumental Lyria request I can use to generate something similar.

## When to prefer this

Choose this endpoint when you need a deep, structured musical analysis of a specific reference track on YouTube — especially when your goal is to generate an original Lyria song inspired by that track. It is superior to generic audio analysis when you want timestamped section breakdowns, drum/bass/lead decompositions, and a production-ready Lyria prompt all in one call. Prefer this over manual music analysis when you need structured JSON output usable for downstream AI music generation pipelines.

## Known failure modes

- Private or unlisted YouTube videos return an error — only public videos are supported
- Video window shorter than 30 seconds is rejected
- endSec must be at least 30 seconds greater than startSec
- Target duration outside 30–300 second range is rejected
- Videos with no detectable music (e.g. speech-only) may return low confidence scores and sparse analysis
- YouTube URL parsing failures if URL is malformed
- Network or Gemini model errors may cause transient failures
- Analysis confidence may be low for heavily mixed, live, or distorted recordings

## How this service works

Analyze a public YouTube or direct-audio music reference, optionally combine Gemini semantics with local BPM/key/downbeat/loudness DSP, and return bar-aware sections plus a ready-to-generate original Lyria request.

## Output

Returns a structured JSON object containing: source metadata (URL, window, analysis method), full music analysis (BPM with confidence and feel, key/mode with confidence, time signature, genres, moods, drum/bass/lead/harmony descriptions, instrumentation list, production characteristics, energy arc, signature traits, timestamped section breakdown, overall confidence score, and warnings), plus a compiled ready-to-use Google Lyria generation request that mirrors the analyzed track's musical character, and pricing metadata.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "example": {
  "focus": "prioritize the drum pattern, bass movement, and energy changes",
  "endSec": 240,
  "startSec": 0,
  "youtubeUrl": "https://www.youtube.com/watch?v=example",
  "barAlignment": "4-bars",
  "instrumental": true,
  "tailReserveSec": 5,
  "targetDurationSec": 180,
  "sectionTargetCount": 8,
  "instrumentalLeadMode": "piano-led"
 },
 "required": [
  "startSec",
  "endSec",
  "instrumental",
  "analysisDepth",
  "barAlignment",
  "instrumentalLeadMode",
  "instrumentalLeadContinuity",
  "tailReserveSec"
 ],
 "properties": {
  "seed": {
   "type": "integer",
   "maximum": 9007199254740991,
   "minimum": -9007199254740991,
   "description": "Optional best-effort Lyria seed copied into the compiled request."
  },
  "audio": {
   "type": "string",
   "maxLength": 21000000,
   "minLength": 1,
   "description": "Base64 MP3 or WAV for hybrid semantic + DSP analysis (15 MiB decoded maximum)."
  },
  "focus": {
   "type": "string",
   "maxLength": 500,
   "minLength": 1,
   "description": "Optional analysis emphasis, for example \"prioritize the drums, bass groove, and chorus lift\"."
  },
  "endSec": {
   "type": "integer",
   "default": 300,
   "maximum": 21600,
   "minimum": 30,
   "description": "End of the analyzed video window in whole seconds. Defaults to 300."
  },
  "audioUrl": {
   "type": "string",
   "format": "uri",
   "maxLength": 2048,
   "description": "Public HTTPS MP3/WAV/M4A/OGG/FLAC URL for hybrid semantic + DSP analysis."
  },
  "startSec": {
   "type": "integer",
   "default": 0,
   "maximum": 21600,
   "minimum": 0,
   "description": "Start of the analyzed video window in whole seconds. Defaults to 0."
  },
  "mastering": {
   "type": "object",
   "required": [
    "targetLufs",
    "truePeakDb",
    "fadeOutSec"
   ],
   "properties": {
    "fadeOutSec": {
     "type": "number",
     "default": 1,
     "maximum": 10,
     "minimum": 0,
     "description": "Final fade duration in seconds."
    },
    "targetLufs": {
     "type": "number",
     "default": -14,
     "maximum": -8,
     "minimum": -24,
     "description": "Target integrated loudness in LUFS."
    },
    "truePeakDb": {
     "type": "number",
     "default": -1,
     "maximum": -0.1,
     "minimum": -6,
     "description": "Maximum true peak in dBTP."
    }
   },
   "description": "Optional mastering controls copied into the ready-to-generate Lyria request.",
   "additionalPropert
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "source",
  "analysis",
  "lyriaRequest",
  "limitations",
  "model",
  "price_usdc"
 ],
 "properties": {
  "model": {
   "type": "string"
  },
  "source": {
   "type": "object",
   "required": [
    "startSec",
    "endSec",
    "analysisMethod"
   ],
   "properties": {
    "endSec": {
     "type": "integer",
     "maximum": 9007199254740991,
     "minimum": -9007199254740991
    },
    "audioUrl": {
     "type": "string",
     "format": "uri"
    },
    "startSec": {
     "type": "integer",
     "maximum": 9007199254740991,
     "minimum": -9007199254740991
    },
    "youtubeUrl": {
     "type": "string",
     "format": "uri"
    },
    "audioUpload": {
     "type": "boolean"
    },
    "analysisMethod": {
     "enum": [
      "gemini-video-semantic",
      "gemini-audio-plus-dsp"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "analysis": {
   "type": "object",
   "required": [
    "durationSec",
    "clipMusicStartSec",
    "clipMusicEndSec",
    "tempo",
    "key",
    "timeSignature",
    "genres",
    "moods",
    "drums",
    "bass",
    "harmony",
    "lead",
    "instrumentation",
    "production",
    "energyArc",
    "signatureTraits",
    "sections",
    "overallConfidence",
    "warnings"
   ],
   "properties": {
    "key": {
     "type": "object",
     "required": [
      "tonic",
      "mode",
      "confidence"
     ],
     "properties": {
      "mode": {
       "type": "string",
       "maxLength": 32,
       "minLength": 1,
       "description": "Estimated mode such as major, minor, dorian, or mixolydian."
      },
      "tonic": {
       "type": "string",
       "maxLength": 8,
       "minLength": 1,
       "description": "Estimated tonic, using a note name such as C, F#, or Bb."
      },
      "confidence": {
       "type": "number",
       "maximum": 1,
       "minimum": 0
      }
     },
     "additionalProperties": false
    },
    "bass": {
     "type": "string",
     "maxLength": 600,
     "minLength": 1,
     "description": "Bass timbre, register, articulation, rhythm, and interaction with the kick."
    },
    "lead": {
     "type": "string",
     "maxLength": 600,
     "minLength": 1,
     "description": "Lead timbres, melodic contour, phrasing density, and call-and-response without quoting the melody."
    },
    "drums": {
     "type": "string",
     "maxLength": 600,
     "minLength": 1,
     "
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/audio-withzero-xyz-youtube-music-video-analyzer-lyria-ready-057de1a8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from audio.withzero.xyz](https://www.zero.xyz/host/audio.withzero.xyz/llms.txt)
