For coding agents
This page gives a coding agent what it needs to build with the Audio Decisions API: what the API does, one complete request and response, and the rules that code most often gets wrong.
Set up your agent
Install the skill
The Audio Decisions skill works with Claude Code, Codex, Cursor and other agents. Your agent loads it when it works with this API, and it covers choosing which audio to send, writing and breaking down questions, and reading answers.
The CLI asks which agents to install the skill for, and installs it in the current project unless you pass -g. It needs Node.js 22.20 or later. Without Node.js, copy the audio-decisions-api folder from the repository into the folder your agent loads skills from, such as .claude/skills/ in Claude Code.
Point your agent at the docs
Add this to your project’s agent instructions, such as CLAUDE.md or AGENTS.md, so your agent checks the current docs:
Connect the docs MCP server
To let your agent search all of dev.hume.ai, add the docs MCP server. Its tool returns an answer with links to its sources, and your agent can fetch a cited page’s .md for exact field names and request shapes. In other MCP clients, add https://dev.hume.ai/_mcp/server as an HTTP server. In Claude Code, run:
What the API does
- A request sends one audio file and your questions about it, written in plain language. All the questions in a request are answered in one model inference.
- Each answer is numbers, not text. A
noul,choiceorscoreanswer gives probabilities that estimate the share of human raters who would give each answer. Aspananswer gives the times where an event may occur. There is no transcript, reply or explanation, so the calling code makes the decision. - The API is HTTP only, with one file per request. To evaluate many recordings, send one request per file. To evaluate live audio, send clips as they are captured: at least 1 second, and at least each question’s recommended minimum (5 seconds for most; see Use cases).
Make a request
A request is a multipart/form-data POST to https://api.cloud.hume.ai/v0/decisions/file, with the API key in the X-Hume-Api-Key header and two parts, sent in this order:
request: a JSON object withquestions, each keyed by an ID you choose, and an optionalcontextstring that describes the recording.file: one audio file, MP3 or WAV.
The response keys each answer by the ID of its question. It also carries the run_id of the model run, and received, which holds the input tokens the request is billed:
Question types
Each question’s type names its primitive, which sets the criteria it takes and the fields of its answer. One request can mix types.
Rules for calling code
Audio
- Send the speakers mixed together in one file. To judge one person apart from the others, send that person’s audio as its own file instead. The model hears audio as one channel at 16 kHz and does not hear which side or channel a sound comes from.
- Send MP3 or WAV. Other formats, such as WebM from a browser recorder or M4A, are rejected with
audio_format_unsupported, so convert them first. - Send 1 second to 5 minutes of audio, in a request body of at most 25,000,000 bytes. Shorter audio is rejected with
audio_too_shortand longer audio withaudio_too_long. Split long recordings into one request per part, and convert large WAV files to 16 kHz mono, since a higher sample rate or a second channel does not improve answers. See Limits. - Skip silent or nearly silent files. The model can answer silence with high confidence.
Questions
- Ask each question for one judgment a listener could make from the audio, and combine the answers in code. For a broad decision such as “Did the agent handle the call well?”, ask about the agent’s tone, the caller’s frustration and whether the caller asks to cancel, then combine those answers. If a person listening to the audio would find a question hard to answer, the model is likely to find it hard too.
- List the possible answers instead of asking an open question. Answers are probabilities over the options you give, or time spans. To find why someone called, ask a
choicequestion that lists the reasons. - Give every
choicequestion an option for audio that fits none of the others. Add “unsure” to yes and no, and “none of these” to any list that might not cover every recording. - Ask about emotions with one
noulquestion per emotion, such as “Does the caller sound angry?”, not onechoicequestion that lists emotions. Achoiceanswer’s probabilities sum to 1, so emotions that mix split the probability, while eachnoulanswer gives its emotion a probability of its own. - Make
choiceoptions distinct categories, not narrow number ranges. Ask for “slow”, “normal” or “fast” rather than ranges of words per minute. - Expect
spananswers to be most reliable for vocal bursts and sound events, such as laughs, sighs, coughs or a phone ringing. For other events, such as a word being spoken, check the spans against audio where you know the answer before relying on them. - Do not ask questions that need musical understanding, such as where the chorus starts. See Questions the model does not answer well.
- Send the same questions in the same order for every recording you compare. An answer can change when other questions in the request are added, removed or reordered, so a threshold holds only for the request it was set on.
- Put the text a question depends on, such as a script or the requested speaking style, in
context. Every question in a request shares onecontext, so questions that need different context go in separate requests. - Name the speaker a question is about, such as “the agent” or “the caller”. Describe each speaker in
context.
Answers
- A probability is the estimated share of raters, not the model’s certainty. A
noulof 0.5 means raters would split, and anoulof 0.6 means 60% would answer yes, not “somewhat yes”. - Read
scorelevels throughlegend. Level indices start at 0, so on a scale labeled “Not at all”, “2”, “3”, “4”, “Extremely”, index 1 is the level labeled “2”.scoreis the mean level index, not a label. - Choose thresholds from labeled audio. The API sets no threshold. Compare answers with the known answers for recordings of the kind you will judge.
- Do not repeat a request to average its answers. The same request with the same file returns the same answers. Answers can change when the model is updated.
- Store each answer with its
run_idand the questions that produced it. The run endpoints return a run’s status and request, but not its answers.
Requests and errors
- Keep the API key on a server you control. To use the API from a browser, relay the audio through your server.
- Send only documented fields. Requests are validated strictly and an unrecognized field is rejected. In responses, ignore unrecognized fields, and treat an answer with an unrecognized
typeas unknown rather than as an error. - Branch on the error’s
code, and on the status when there is nocode. The gateway’s401,429and404for a path or method the API does not serve carry nocode. - Retry
429and503after the seconds in theRetry-Afterheader, and retry500. Both SDKs do this, retrying a request twice. Fix a400,413or415before resending, since the same request fails again. Do not retry a403: the organization does not have access to the API, which is requested through the contact form. See Errors. - Stay under 600 requests per minute. The rate limit is shared by every API key in the organization, and an input token estimate counts toward it like any other request. See Limits.