AQVI

Quick start

  1. Sign in, create your company and recharge at least $10.
  2. Create an API token and keep it on your server.
  3. 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"}'
FieldMeaning
audio_urlLink to the recording. Use either this or file.
webhook_urlWhere to post the report. If missing, your saved address is used; if there is none, poll the status URL.
external_call_idYour own reference number, up to 128 characters. It comes back in the report.
metadataagent_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, thresholdsWhat to analyse and how strictly. See below.
profile_idA saved set of options and thresholds.
prioritylow, 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.

OptionDefault
telephony_eventstrue
line_qualitytrue
environment_soundstrue
csr_voicetrue
csr_attentiontrue
conversation_dynamicstrue
customer_voicetrue
audio_metricstrue
speaker_detectiontrue
feedback_generationtrue
scoringtrue
delivery_metricstrue
emotion_analysistrue
speaker_profilefalse
csr_emotion_analysistrue
customer_emotion_analysistrue
emotion_in_scoringfalse
speaker_enrollmentfalse
dtmf_maskingtrue
analyse_hold_segmentsfalse
include_timelinetrue
evidence_excerptstrue
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

ThresholdDefault
min_confidence0.5
scoring_min_confidence0.7
merge_gap_seconds1.0
continuous_merge_gap_seconds3.0
min_tone_seconds0.1
min_sound_seconds0.5
min_vocal_seconds1.0
long_pause_seconds3.0
dead_air_seconds5.0
dead_air_high_seconds10.0
response_latency_warning_seconds3.0
response_latency_high_seconds6.0
interruption_min_overlap_seconds0.5
whisper_relative_db-12.0
shout_relative_db10.0
speaker_baseline_window_seconds60.0
volume_change_db12.0
volume_change_window_ms500.0
clipping_threshold_dbfs-0.1
clipping_warning_percent0.5
audio_dropout_min_ms200.0
low_snr_db15.0
prompting_min_signals2
csr_role_min_confidence0.7
fast_speech_sps5.5
slow_speech_sps3.0
pace_min_seconds10.0
low_energy_db-6.0
high_energy_db6.0
low_energy_min_seconds20.0
monotone_semitones2.0
monotone_min_seconds20.0
varied_pitch_semitones4.5
too_soft_db-30.0
too_loud_db-14.0
tension_min_seconds3.0
tension_semitones2.0
tension_roughness_ratio1.25
empathy_response_window_seconds10.0
continuous_speaking_seconds45.0
late_greeting_seconds5.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:

audioFile name, length, format and quality of the recording
analysis_qualityWarnings, and whether each module ran
summaryCounts by severity and category
eventsEach 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, metricsWho 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).
scoresoverall (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.
feedbackUp to 5 positive and 5 improvements, in English, linked to events
speakersEach 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/analysesList analyses. Filters: external_call_id, agent_id, campaign_id, status, created_from, created_to, limit, cursor
POST/v1/audio/analyses/{id}/cancelStop a job that has not finished
POST/v1/audio/analyses/{id}/webhook/redeliverSend the report again
DELETE/v1/audio/analyses/{id}Delete the report
POST/v1/audio/analyses/{id}/events/{event_id}/reviewConfirm or reject an event
GET, POST/v1/profilesList or create profiles
GET, PUT, DELETE/v1/profiles/{profile_id}Read, change or delete a profile
GET/v1/usageMinutes per day. Filters: from, to
GET/v1/balanceCurrent balance
GET/v1/catalogueAll detection types, no token needed
GET/v1/schema/{name}JSON Schema: analyze-request, result, event, profile, review
GET/v1/healthService status, no token needed

Detection types

Phone system telephony

  • beep
  • dtmf_tone
  • call_waiting_beep
  • hold_period
  • hold_music_transition
  • disconnect_tone
  • ringback_tone
  • repeated_beeps
  • pre_answer
  • ivr_segment planned
  • ivr_tone planned
  • alert_tone planned

Line quality line_quality

  • static_noise
  • crackling
  • audio_dropout
  • distorted_voice
  • choppy_audio
  • volume_drop
  • volume_spike
  • frequency_interference
  • low_signal_quality
  • robotic_audio planned
  • echo planned

Background sounds environment

  • television
  • radio
  • music
  • construction
  • dog_barking
  • dog_whining
  • birds
  • traffic
  • vehicle_engine
  • vehicle_horn
  • siren
  • keyboard_typing
  • mouse_clicking
  • fan_noise
  • air_conditioning
  • door
  • footsteps
  • baby_children
  • household_noise
  • wind
  • background_speech planned
  • office_noise planned
  • microphone_handling planned
  • background_noise_other planned

Conversation flow conversation

  • complete_silence
  • dead_air
  • long_pause
  • customer_waiting
  • csr_waiting
  • simultaneous_speech
  • interruption
  • conversation_inactivity
  • late_greeting

Agent voice csr_voice

  • whispering
  • shouting
  • loud_speech
  • soft_speech
  • calm_voice
  • angry_voice
  • excited_voice
  • monotone_voice
  • hesitation
  • laughing
  • sighing
  • crying
  • coughing
  • throat_clearing
  • heavy_breathing
  • fast_speech
  • slow_speech
  • low_energy
  • voice_tension
  • irritated_voice planned
  • excessive_fillers planned
  • yawning planned
  • vocal_strain planned

Agent attention csr_attention

  • possible_disengagement
  • delayed_response
  • possible_distraction
  • side_conversation
  • secondary_speaker_detected
  • possible_prompting
  • whispered_secondary_speech
  • multiple_speakers
  • unnecessary_silence
  • unnatural_pause
  • listening_acknowledgement
  • csr_interruption
  • possible_ignored_customer
  • empathy_cue
  • continuous_speaking

Customer voice customer_voice

  • customer_shouting
  • anger_indicators
  • frustration_indicators
  • calm_voice
  • crying
  • laughter
  • excitement
  • emotional_escalation
  • emotional_recovery
  • voice_tension
  • confusion_indicators planned

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_..."}}
HTTPCodeWhat to do
400INVALID_REQUESTCorrect the field named in details
400MISSING_AUDIO, MULTIPLE_AUDIO_SOURCESSend exactly one of file or audio_url
400INVALID_WEBHOOK_URLUse a public https address
400UNKNOWN_DETECTION_TYPESee /v1/catalogue
400TRANSCRIPT_NOT_SUPPORTEDAQVI never transcribes
401UNAUTHORIZEDCheck the token
402INSUFFICIENT_BALANCERecharge on the billing page
403FORBIDDENThe token does not allow this
404NOT_FOUNDCheck the id
409IDEMPOTENCY_CONFLICTThe key was used with a different request
409INVALID_STATEThe job is in a state that does not allow this
413FILE_TOO_LARGEAt most 100 MB
415UNSUPPORTED_MEDIA_TYPEUse MP3 or WAV
422AUDIO_DECODE_FAILED, AUDIO_TOO_LONG, UNSUPPORTED_CHANNEL_COUNTCheck the recording
429RATE_LIMITED, QUOTA_EXCEEDEDWait for the time in Retry-After
500INTERNAL_ERRORRetry with the same Idempotency-Key
503SERVICE_UNAVAILABLERetry 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.