MiniMax-AI/skills · error · SystemExit
No audio in response: {json.dumps(data, indent=2)}
Error message
No audio in response: {json.dumps(data, indent=2)} What it means
A defensive guard: the response passed the status==2 check but data.data.audio is empty or missing, so there is nothing to decode (hex) or download (url). The full response JSON is dumped so you can see what the API actually returned.
Source
Thrown at skills/frontend-dev/scripts/minimax_music.py:87
},
json=payload,
timeout=timeout,
)
resp.raise_for_status()
data = resp.json()
# Check API-level error
base_resp = data.get("base_resp", {})
if base_resp.get("status_code", 0) != 0:
raise SystemExit(f"API Error [{base_resp.get('status_code')}]: {base_resp.get('status_msg')}")
status = data.get("data", {}).get("status")
if status != 2:
raise SystemExit(f"Generation incomplete (status={status}): {json.dumps(data, indent=2)}")
audio_data = data.get("data", {}).get("audio", "")
if not audio_data:
raise SystemExit(f"No audio in response: {json.dumps(data, indent=2)}")
extra = data.get("extra_info", {})
if output_format == "hex":
audio_bytes = bytes.fromhex(audio_data)
else:
# URL mode — audio_data is a URL string
audio_bytes = None
return {
"audio_bytes": audio_bytes,
"audio_url": audio_data if output_format == "url" else None,
"duration": extra.get("music_duration"),
"sample_rate": extra.get("music_sample_rate"),
"channels": extra.get("music_channel"),
"bitrate": extra.get("bitrate"),
"size": extra.get("music_size"),
}View on GitHub (pinned to 60aaae52bb)
Solutions
- Retry the identical request once — empty-audio-on-success is almost always transient.
- Re-read the dumped JSON to confirm where the audio actually lives (it may have moved to a sibling field).
- Try the alternate output_format (url vs hex) to see if the other mode populates the field.
- If reproducible, capture the full JSON and report it with the model/region, since status==2 + empty audio is not an expected contract.
Example fix
// before: assumes audio is always present on success
audio_data = data.get("data", {}).get("audio", "")
// after: search common locations and retry once
audio_data = (data.get("data", {}).get("audio")
or data.get("data", {}).get("audio_url")
or data.get("audio", ""))
if not audio_data:
data = retry_request() # one retry
audio_data = data.get("data", {}).get("audio", "") Defensive patterns
Strategy: retry
Validate before calling
def extract_audio(data: dict, output_format: str):
"""Return audio string from any plausible location, or None."""
for path in (("data", "audio"), ("data", "audio_url"), ("audio",)):
v = data
for k in path:
v = v.get(k, {}) if isinstance(v, dict) else None
if v:
return v
return None Type guard
def has_music_audio(data: dict) -> bool:
"""True when a success response actually carries an audio payload."""
return bool(extract_audio(data, data.get("output_format", "hex"))) Try / catch
for attempt in range(2):
data = call_music_api(payload)
if data.get("data", {}).get("status") == 2:
audio = extract_audio(data, output_format)
if audio:
return audio
time.sleep(3)
raise RuntimeError("music success but no audio after retry") Prevention
- Treat status==2 with empty audio as transient — retry once before surfacing.
- Search alternate field locations (data.audio_url, audio) in case the schema diverged.
- Capture and log the full response when audio is missing so schema drift is visible.
- Consider switching output_format (url vs hex) if one mode reliably yields empty payloads.
When it happens
Trigger: An edge response where status reports success but the audio payload is absent — a rare backend/serialization issue, an output_format the endpoint filled differently, or a response shape that diverged from the assumed `data.audio` location.
Common situations: Backend hiccup returning a success-shaped but empty payload; using an output_format value the account/model doesn't fully populate; an API version that moved the audio field; intermittent partial responses under load.
Related errors
- ERROR: MINIMAX_API_BASE is not set.
- API Error [{base_resp.get('status_code')}]: {base_resp.get('
- Generation incomplete (status={status}): {json.dumps(data, i
- No audio in response: {json.dumps(data, indent=2)}
- No task_id in response: {json.dumps(data, indent=2)}
AI-assisted analysis of MiniMax-AI/skills@60aaae52bb (2026-08-13).
Data as JSON: /api/errors/302eedbc70f387da.
Report an issue: GitHub.