Quick start
- Sign in, create your company and recharge at least $10.
- Create an API token and keep it on your server.
- Send a recording:
curl https://aqvi.aiginy.com/v1/audio/analyze \
-H "Authorization: Bearer $AQVI_TOKEN" \
-F file=@recording.mp3
Then fetch the report from the status_url in the reply, or receive it by webhook.
Authentication
Every request needs Authorization: Bearer YOUR_TOKEN. Never put a token in a web page or app that other people can open. The base address is https://aqvi.aiginy.com/v1.
Submit a recording
POST /v1/audio/analyze
Upload a file
Send multipart/form-data with file and, optionally, request as JSON.
curl https://aqvi.aiginy.com/v1/audio/analyze \
-H "Authorization: Bearer $AQVI_TOKEN" \
-H "Idempotency-Key: rec-123" \
-F file=@recording.mp3 \
-F 'request={
"external_call_id": "rec-123",
"webhook_url": "https://your-server.example/aqvi",
"metadata": {"agent_id": "A17", "campaign_id": "renewals", "call_type": "outbound"},
"options": {"environment_sounds": true, "customer_emotion_analysis": false}
}'
Give a link
Send JSON with an https address that answers with the file itself.
curl https://aqvi.aiginy.com/v1/audio/analyze \
-H "Authorization: Bearer $AQVI_TOKEN" \
-H "Content-Type: application/json" \
-d '{"audio_url": "https://your-server.example/recordings/rec-123.mp3",
"external_call_id": "rec-123"}'
| Field | Meaning |
|---|---|
audio_url | Link to the recording. Use either this or file. |
webhook_url | Where to post the report. If missing, your saved address is used; if there is none, poll the status URL. |
external_call_id | Your own reference number, up to 128 characters. It comes back in the report. |
metadata | agent_id, campaign_id, call_type (inbound, outbound, callback, transfer, internal, unknown), first_speaker_hint (csr, customer), agent_speaker_hint (first, second: which voice heard is the agent), expected_speakers, custom (up to 4 KB) and more. |
options, thresholds | What to analyse and how strictly. See below. |
profile_id | A saved set of options and thresholds. |
priority | low, normal or high within the queue. |
The reply is 202 with analysis_id and status_url. With an Idempotency-Key header, repeating the same request within 24 hours returns the same job. The full request format is at /v1/schema/analyze-request.
Options
Unset options use these defaults.
| Option | Default |
|---|---|
telephony_events | true |
line_quality | true |
environment_sounds | true |
csr_voice | true |
csr_attention | true |
conversation_dynamics | true |
customer_voice | true |
audio_metrics | true |
speaker_detection | true |
feedback_generation | true |
scoring | true |
delivery_metrics | true |
emotion_analysis | true |
speaker_profile | false |
csr_emotion_analysis | true |
customer_emotion_analysis | true |
emotion_in_scoring | false |
speaker_enrollment | false |
dtmf_masking | true |
analyse_hold_segments | false |
include_timeline | true |
evidence_excerpts | true |
language | "auto" |
feedback_locale | "en" |
Also accepted: min_confidence (0 to 1), analysis_window ({"start": 10, "end": 60}; the whole recording is still charged) and detections ({"include": [...], "exclude": [...]}). A module that could not run says why in analysis_quality.module_status; nothing is guessed. Agent and customer modules need to know which voice is the agent: send agent_speaker_hint, call_type or first_speaker_hint when you know it. When the agent stays uncertain, each voice is still measured under speakers[].metrics. Voice and attention results are estimates, not yet calibrated on labelled recordings.
A profile can also set overall_weights, for example {"ai_behavior": 0.6, "objective_audio": 0.2, "customer_sentiment": 0.2}.
Thresholds
| Threshold | Default |
|---|---|
min_confidence | 0.5 |
scoring_min_confidence | 0.7 |
merge_gap_seconds | 1.0 |
continuous_merge_gap_seconds | 3.0 |
min_tone_seconds | 0.1 |
min_sound_seconds | 0.5 |
min_vocal_seconds | 1.0 |
long_pause_seconds | 3.0 |
dead_air_seconds | 5.0 |
dead_air_high_seconds | 10.0 |
response_latency_warning_seconds | 3.0 |
response_latency_high_seconds | 6.0 |
interruption_min_overlap_seconds | 0.5 |
whisper_relative_db | -12.0 |
shout_relative_db | 10.0 |
speaker_baseline_window_seconds | 60.0 |
volume_change_db | 12.0 |
volume_change_window_ms | 500.0 |
clipping_threshold_dbfs | -0.1 |
clipping_warning_percent | 0.5 |
audio_dropout_min_ms | 200.0 |
low_snr_db | 15.0 |
prompting_min_signals | 2 |
csr_role_min_confidence | 0.7 |
fast_speech_sps | 5.5 |
slow_speech_sps | 3.0 |
pace_min_seconds | 10.0 |
low_energy_db | -6.0 |
high_energy_db | 6.0 |
low_energy_min_seconds | 20.0 |
monotone_semitones | 2.0 |
monotone_min_seconds | 20.0 |
varied_pitch_semitones | 4.5 |
too_soft_db | -30.0 |
too_loud_db | -14.0 |
tension_min_seconds | 3.0 |
tension_semitones | 2.0 |
tension_roughness_ratio | 1.25 |
empathy_response_window_seconds | 10.0 |
continuous_speaking_seconds | 45.0 |
late_greeting_seconds | 5.0 |
scoring_min_confidence_by_category | {"csr_voice": 0.5} (other categories use scoring_min_confidence) |
emotion_analysis is the model for both people; csr_emotion_analysis and customer_emotion_analysis switch it off for one of them. speaker_profile adds voice_profile to each speaker: an estimate of how the voice sounds, not a fact about the person. It never affects scores, feedback or severity, and age_band is unknown in this version. Get legal advice before you use it. Where the law limits judging the emotion of people at work, switch csr_emotion_analysis off.
Get the result
GET /v1/audio/analyses/{analysis_id}
status is queued, fetching_audio, processing, completed, partially_completed, failed or cancelled. When it is finished, result holds:
audio | File name, length, format and quality of the recording |
analysis_quality | Warnings, and whether each module ran |
summary | Counts by severity and category |
events | Each event with type, start, end, confidence and severity. When you gave a link to the recording, evidence.excerpt_url plays the moment from your own address; it is valid for 24 hours and renewed each time you fetch the report. For uploads no audio or clips are kept, so there is no such link. |
timeline, metrics | Who speaks when, silence, hold time and loudness. timeline.emotion holds one item per 5 seconds and speaker: label, arousal (0 to 1), valence (-1 to 1) and confidence. metrics.csr and metrics.customer hold speech_rate_sps, pace, energy_level, pitch_variation, loudness_verdict, longest_monologue_seconds, tone, emotion_mix, engagement_percentage and, for the customer, sentiment. metrics.conversation holds first_agent_speech_seconds, talk_listen_ratio and the overlap, silence and hold percentages (hold is a share of the time with hold included). |
scores | overall (0 to 10, with stars and a band), and its parts objective_audio and ai_behavior, 0 to 100, with the points lost per component and the events behind them. ai_behavior is null when it is not certain which speaker is the agent, or the agent speaks for under 30 seconds. |
feedback | Up to 5 positive and 5 improvements, in English, linked to events |
speakers | Each voice with its role (csr is the agent), the confidence of that role, the usual pitch and loudness, and the same metrics as above |
The full format is at /v1/schema/result.
Webhooks
The report is posted as JSON. Answer with any 2xx within 10 seconds. Failures are retried up to 8 times over about two days. Create your secret on the API tokens page and check every delivery:
# Python
import hashlib, hmac, time
def is_from_aqvi(headers, raw_body: bytes, secret: str) -> bool:
ts = headers["X-AQM-Timestamp"]
if abs(time.time() - int(ts)) > 300:
return False
good = "v1=" + hmac.new(secret.encode(), ts.encode() + b"." + raw_body,
hashlib.sha256).hexdigest()
return any(hmac.compare_digest(p.strip(), good)
for p in headers["X-AQM-Signature"].split(","))
// Node.js
import crypto from "node:crypto";
export function isFromAqvi(headers, rawBody, secret) {
const ts = headers["x-aqm-timestamp"];
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
const good = Buffer.from("v1=" + crypto.createHmac("sha256", secret)
.update(ts + ".").update(rawBody).digest("hex"));
return headers["x-aqm-signature"].split(",").some((p) => {
const b = Buffer.from(p.trim());
return b.length === good.length && crypto.timingSafeEqual(b, good);
});
}
The event name is audio.analysis.completed, audio.analysis.partially_completed or audio.analysis.failed. The same report can arrive more than once, so use analysis_id to ignore repeats.
Other endpoints
| GET | /v1/audio/analyses | List analyses. Filters: external_call_id, agent_id, campaign_id, status, created_from, created_to, limit, cursor |
| POST | /v1/audio/analyses/{id}/cancel | Stop a job that has not finished |
| POST | /v1/audio/analyses/{id}/webhook/redeliver | Send the report again |
| DELETE | /v1/audio/analyses/{id} | Delete the report |
| POST | /v1/audio/analyses/{id}/events/{event_id}/review | Confirm or reject an event |
| GET, POST | /v1/profiles | List or create profiles |
| GET, PUT, DELETE | /v1/profiles/{profile_id} | Read, change or delete a profile |
| GET | /v1/usage | Minutes per day. Filters: from, to |
| GET | /v1/balance | Current balance |
| GET | /v1/catalogue | All detection types, no token needed |
| GET | /v1/schema/{name} | JSON Schema: analyze-request, result, event, profile, review |
| GET | /v1/health | Service status, no token needed |
Detection types
Phone system telephony
beepdtmf_tonecall_waiting_beephold_periodhold_music_transitiondisconnect_toneringback_tonerepeated_beepspre_answerivr_segmentplannedivr_toneplannedalert_toneplanned
Line quality line_quality
static_noisecracklingaudio_dropoutdistorted_voicechoppy_audiovolume_dropvolume_spikefrequency_interferencelow_signal_qualityrobotic_audioplannedechoplanned
Background sounds environment
televisionradiomusicconstructiondog_barkingdog_whiningbirdstrafficvehicle_enginevehicle_hornsirenkeyboard_typingmouse_clickingfan_noiseair_conditioningdoorfootstepsbaby_childrenhousehold_noisewindbackground_speechplannedoffice_noiseplannedmicrophone_handlingplannedbackground_noise_otherplanned
Conversation flow conversation
complete_silencedead_airlong_pausecustomer_waitingcsr_waitingsimultaneous_speechinterruptionconversation_inactivitylate_greeting
Agent voice csr_voice
whisperingshoutingloud_speechsoft_speechcalm_voiceangry_voiceexcited_voicemonotone_voicehesitationlaughingsighingcryingcoughingthroat_clearingheavy_breathingfast_speechslow_speechlow_energyvoice_tensionirritated_voiceplannedexcessive_fillersplannedyawningplannedvocal_strainplanned
Agent attention csr_attention
possible_disengagementdelayed_responsepossible_distractionside_conversationsecondary_speaker_detectedpossible_promptingwhispered_secondary_speechmultiple_speakersunnecessary_silenceunnatural_pauselistening_acknowledgementcsr_interruptionpossible_ignored_customerempathy_cuecontinuous_speaking
Customer voice customer_voice
customer_shoutinganger_indicatorsfrustration_indicatorscalm_voicecryinglaughterexcitementemotional_escalationemotional_recoveryvoice_tensionconfusion_indicatorsplanned
Balance and charges
Each minute costs $0.05, rounded up to whole minutes per recording: 3 minutes 5 seconds is charged as 4 minutes, $0.20. The cost is held when you submit and charged when the analysis completes. Failed and cancelled jobs are not charged. GET /v1/balance:
{"currency": "USD", "balance_usd": 25.0, "reserved_usd": 0.2, "available_usd": 24.8,
"price_per_minute_usd": 0.05, "minutes_left": 496}
Errors
{"success": false,
"error": {"code": "INSUFFICIENT_BALANCE", "message": "...", "details": {}, "request_id": "req_..."}}
| HTTP | Code | What to do |
|---|---|---|
| 400 | INVALID_REQUEST | Correct the field named in details |
| 400 | MISSING_AUDIO, MULTIPLE_AUDIO_SOURCES | Send exactly one of file or audio_url |
| 400 | INVALID_WEBHOOK_URL | Use a public https address |
| 400 | UNKNOWN_DETECTION_TYPE | See /v1/catalogue |
| 400 | TRANSCRIPT_NOT_SUPPORTED | AQVI never transcribes |
| 401 | UNAUTHORIZED | Check the token |
| 402 | INSUFFICIENT_BALANCE | Recharge on the billing page |
| 403 | FORBIDDEN | The token does not allow this |
| 404 | NOT_FOUND | Check the id |
| 409 | IDEMPOTENCY_CONFLICT | The key was used with a different request |
| 409 | INVALID_STATE | The job is in a state that does not allow this |
| 413 | FILE_TOO_LARGE | At most 100 MB |
| 415 | UNSUPPORTED_MEDIA_TYPE | Use MP3 or WAV |
| 422 | AUDIO_DECODE_FAILED, AUDIO_TOO_LONG, UNSUPPORTED_CHANNEL_COUNT | Check the recording |
| 429 | RATE_LIMITED, QUOTA_EXCEEDED | Wait for the time in Retry-After |
| 500 | INTERNAL_ERROR | Retry with the same Idempotency-Key |
| 503 | SERVICE_UNAVAILABLE | Retry shortly |
A job can also end as failed with AUDIO_FETCH_FAILED, AUDIO_TOO_SHORT, AUDIO_TOO_LONG, AUDIO_DECODE_FAILED, UNSUPPORTED_MEDIA_TYPE, INSUFFICIENT_BALANCE or INTERNAL_ERROR.
Limits
- MP3 or WAV, at most 100 MB, 5 seconds to 45 minutes.
- Made for phone conversations. Meetings are not recommended.
- 60 submissions a minute per company, with bursts up to 120.
- Audio is deleted when processing ends. If you gave a link, it is kept encrypted with the report so its page can play the recording. Reports are kept for 180 days.