How to Use Gemini Audio Vision
-
Provide an audio URL: Host your audio at a publicly reachable URL (e.g. an S3 or CDN link) and pass it as audio_url.
-
Write a prompt: Describe what you want analyzed — a transcript, a structured JSON breakdown, or a specific question about the audio's content (tone, speakers, background sounds).
-
Optionally set a system prompt: Use system_prompt to control output format, e.g. "Respond with structured JSON only, no prose."
-
Choose a model: gemini-2.5-flash is the currently supported option — fast and accurate for most transcription, QA, and summarization tasks.
-
Submit and poll: Like all Muapi endpoints, submit the request and poll /predictions/{request_id}/result until status is completed.
Python:
import requests, time
API_KEY = "your_api_key_here"
headers = {"x-api-key": API_KEY, "Content-Type": "application/json"}
r = requests.post("https://api.muapi.ai/api/v1/gemini-audio-vision", headers=headers,
json={
"prompt": "Transcribe this audio and describe the speaker's tone and any background sounds.",
"audio_url": "https://example.com/my-audio.mp3"
})
request_id = r.json()["request_id"]
while True:
result = requests.get(f"https://api.muapi.ai/api/v1/predictions/{request_id}/result", headers=headers).json()
if result["status"] == "completed":
print(result["output"]["text"])
break
time.sleep(3)
cURL:
curl -X POST https://api.muapi.ai/api/v1/gemini-audio-vision \
-H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"prompt": "Transcribe and describe this audio in detail.", "audio_url": "https://example.com/my-audio.mp3"}'
Longer audio files take longer to process since Gemini uploads and ingests the full file before analysis — expect responses to take anywhere from several seconds to about a minute depending on audio length.