OpenAI Audio Decisions
deepeval supports using OpenAI's audio models as the audio decision model for its voice metrics under the hybrid voice eval mode. An audio decision model is a decision model that listens instead of reads: it hears a recording and answers a yes/no question about it, along with how sure it is. To get started, you'll need to set up your OpenAI API key.
Voice metrics such as Echo or Abrupt Cut-off detect events in a call recording with signal processing, which is fast but can flag things a person wouldn't call a problem. In hybrid mode, the audio decision model hears a short clip around each flagged event and dismisses the ones it judges not real before the metric is scored.
Setting Up Your API Key
DeepEval autoloads .env.local then .env at import time (process env -> .env.local -> .env).
Recommended (local dev):
# .env.local
OPENAI_API_KEY=<your-openai-api-key>Alternative (Shell/CI):
export OPENAI_API_KEY=<your-openai-api-key>Alternative (notebook):
If you're working in a notebook environment (Jupyter or Colab), set your OPENAI_API_KEY in a cell:
%env OPENAI_API_KEY=<your-openai-api-key>Command Line
Voice metrics run in the deterministic voice eval mode by default, which calls no model. To double-check flagged events in every voice metric, run:
deepeval set-voice-eval-mode hybridIn Code
To use an OpenAI audio model for the check, define an OpenAIAudioDecisionModel and pass it as the voice metric's audio_decision_model. By default, the model is set to gpt-audio.
from deepeval.metrics import EchoMetric
from deepeval.models import OpenAIAudioDecisionModel
model = OpenAIAudioDecisionModel(model="gpt-audio")
echo = EchoMetric(
audio_decision_model=model,
eval_mode="hybrid",
)There are ZERO mandatory and THREE optional parameters when creating an OpenAIAudioDecisionModel:
- [Optional]
model: A string specifying the name of the OpenAI audio model to use. Defaulted togpt-audio. - [Optional]
api_key: A string specifying your OpenAI API key. Defaults toOPENAI_API_KEYif not passed; raises an error when the model is created if neither is set. - [Optional]
base_url: A string specifying a custom endpoint to reach the OpenAI API through.
First set your API key and the voice eval mode:
# .env.local
OPENAI_API_KEY=<your-openai-api-key>
DEEPEVAL_VOICE_EVAL_MODE=hybriddeepeval set-voice-eval-mode hybrid writes DEEPEVAL_VOICE_EVAL_MODE for you. Voice metrics then run the check without eval_mode, but still need the OpenAIAudioDecisionModel passed in code, since a hybrid metric with no audio_decision_model uses Hume's audio decision model and needs HUME_API_KEY:
from deepeval.metrics import EchoMetric
from deepeval.models import OpenAIAudioDecisionModel
echo = EchoMetric(audio_decision_model=OpenAIAudioDecisionModel())An eval_mode passed to the metric wins over DEEPEVAL_VOICE_EVAL_MODE. In deterministic mode, an audio_decision_model you pass is not used.
Supported Metrics
These voice metrics accept an audio_decision_model and an eval_mode:
| Metric | Class | Question asked about each flagged clip |
|---|---|---|
| Abrupt Cut-off | AbruptCutoffMetric | Does the speaker's voice cut off abruptly, mid-word or mid-sentence? |
| Audio Dropout | AudioDropoutMetric | Does the speaker's audio suddenly drop out or go silent mid-word, then come back? |
| Dead Stream | DeadStreamMetric | Does the speaker's audio go completely dead partway through, as if the line dropped? |
| Echo | EchoMetric | Can the AI agent's own voice be heard echoed back on this caller's line? |
| Background Noise | BackgroundNoiseMetric | Is there distracting background noise behind the speaker? |
| Abrupt Pitch Jump | AbruptPitchJumpMetric | Does the speaker's voice suddenly jump to a different pitch, as if it glitched or cracked? |
| Pauses | PausesMetric | Does the speaker stop for an unnaturally long time in the middle of what they are saying? Is most of this clip silence where the speaker should be talking? |
| Pitch Variation | PitchVariationMetric | Does the speaker sound flat and monotone, like a robot reading? Does the speaker's pitch swing up and down erratically, in a way that sounds unnatural? |
| Speaking Rate | SpeakingRateMetric | Is the speaker talking unnaturally slowly? Is the speaker talking unnaturally fast? |
| Failed Response | FailedResponseMetric | Does the AI agent stay silent here instead of answering? |
| Silent Reply | SilentReplyMetric | Is the AI agent silent here, saying no words? |
| Agent Interruption | AgentInterruptionMetric | Is a person speaking in this clip, rather than only background noise, breathing or silence? |
| User Interruption | UserInterruptionMetric | Is a person speaking in this clip, rather than only background noise, breathing or silence? |
For each flagged event, deepeval cuts a clip of at least 5 seconds around it, or the whole reply for an event judged on a whole reply, and asks the question above. Events the model gives less than a 50% yes are dropped before scoring. A clip that can't be cut, or a check that fails, keeps the event, so an API error never makes a metric more lenient. The exception is an event only flagged for the model to confirm, which doesn't count when it can't be heard. Speaking Rate and Abrupt Pitch Jump also send borderline replies to the model, so in hybrid they can flag a reply the deterministic check would pass.
Composite metrics that include any of these, such as Voice Naturalness, take audio_decision_model and eval_mode too, and pass them to those parts.
Available OpenAI Audio Models
gpt-audio(default)gpt-audio-1.5gpt-audio-2025-08-28gpt-audio-minigpt-audio-mini-2025-10-06gpt-audio-mini-2025-12-15