Skip to navigation

For coding agents

What a coding agent needs to call the Audio Decisions API correctly, and how to set your agent up to use it.

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

1

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.

Shell
npx skills add HumeAI/hume-audio-decisions-skills

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.

2

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:

Agent instructions
Before writing code that calls the Audio Decisions API, read https://dev.hume.ai/audio-decisions/docs/for-coding-agents.md. For any other Audio Decisions page, find it in https://dev.hume.ai/audio-decisions/llms.txt and fetch its Markdown by adding .md to the page URL.
3

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:

Shell
claude mcp add --transport http hume-docs https://dev.hume.ai/_mcp/server

What the API does

  1. 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.
  2. Each answer is numbers, not text. A noul, choice or score answer gives probabilities that estimate the share of human raters who would give each answer. A span answer gives the times where an event may occur. There is no transcript, reply or explanation, so the calling code makes the decision.
  3. 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:

  1. request: a JSON object with questions, each keyed by an ID you choose, and an optional context string that describes the recording.
  2. file: one audio file, MP3 or WAV.
curl https://api.cloud.hume.ai/v0/decisions/file \
-H "X-Hume-Api-Key: $HUME_API_KEY" \
-F 'request={
"context": "A simulated test call in which a voice AI agent helps a caller reschedule an appointment. Both voices are synthetic, and the agent speaks first.",
"questions": {
"talks_over_caller": {
"type": "noul",
"instructions": "Does the agent talk over the caller?"
},
"agent_naturalness": {
"type": "score",
"instructions": "How natural does the agent sound?",
"criteria": ["Not at all", "2", "3", "4", "Extremely"]
}
}
};type=application/json' \
-F file=@test_call.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:

200 OK
{
"run_id": "019a1f3c-7d2e-7b41-9c58-2e6f4a1d8b03",
"answers": {
"talks_over_caller": {
"type": "noul",
"noul": 0.1274
},
"agent_naturalness": {
"type": "score",
"score": 2.7195,
"confidence": 0.4229,
"probabilities": {
"0": 0.0218,
"1": 0.0874,
"2": 0.2463,
"3": 0.4385,
"4": 0.206
},
"legend": {
"0": "Not at all",
"1": "2",
"2": "3",
"3": "4",
"4": "Extremely"
}
}
},
"received": {
"input_tokens": 11234
}
}
SDKInstallClient
Pythonpip install hume-audio-decisions, imported as hume_audio_decisionsDecisionsClient() reads the key from HUME_API_KEY. Each primitive has its own question class, such as Question_Noul.
TypeScriptnpm install @humeai/audio-decisionsnew DecisionsClient() reads the key from HUME_API_KEY. Questions are plain objects with a type field.

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.

TypeAsksCriteriaAnswer fields
noulWhether something is true of the audio.Optional object with true and false strings.noul, the share of raters who would answer yes.
choiceWhich of several unordered options applies.Array of objects, each with a unique name and an optional description.choice, confidence and probabilities keyed by option name.
scoreWhere the audio falls on an ordered scale.Array of unique level strings, lowest first.score, confidence, probabilities and legend, the last two keyed by level index.
spanWhen an event occurs. This primitive is experimental and most reliable for vocal bursts and sound events. Its question and answer formats are stable.None.spans, each with audio_start_ms, audio_end_ms and probability.

Rules for calling code

Audio

  1. 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.
  2. 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.
  3. 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_short and longer audio with audio_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.
  4. Skip silent or nearly silent files. The model can answer silence with high confidence.

Questions

  1. 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.
  2. 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 choice question that lists the reasons.
  3. Give every choice question 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.
  4. Ask about emotions with one noul question per emotion, such as “Does the caller sound angry?”, not one choice question that lists emotions. A choice answer’s probabilities sum to 1, so emotions that mix split the probability, while each noul answer gives its emotion a probability of its own.
  5. Make choice options distinct categories, not narrow number ranges. Ask for “slow”, “normal” or “fast” rather than ranges of words per minute.
  6. Expect span answers 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.
  7. Do not ask questions that need musical understanding, such as where the chorus starts. See Questions the model does not answer well.
  8. 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.
  9. Put the text a question depends on, such as a script or the requested speaking style, in context. Every question in a request shares one context, so questions that need different context go in separate requests.
  10. Name the speaker a question is about, such as “the agent” or “the caller”. Describe each speaker in context.

Answers

  1. A probability is the estimated share of raters, not the model’s certainty. A noul of 0.5 means raters would split, and a noul of 0.6 means 60% would answer yes, not “somewhat yes”.
  2. Read score levels through legend. Level indices start at 0, so on a scale labeled “Not at all”, “2”, “3”, “4”, “Extremely”, index 1 is the level labeled “2”. score is the mean level index, not a label.
  3. Choose thresholds from labeled audio. The API sets no threshold. Compare answers with the known answers for recordings of the kind you will judge.
  4. 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.
  5. Store each answer with its run_id and the questions that produced it. The run endpoints return a run’s status and request, but not its answers.

Requests and errors

  1. Keep the API key on a server you control. To use the API from a browser, relay the audio through your server.
  2. 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 type as unknown rather than as an error.
  3. Branch on the error’s code, and on the status when there is no code. The gateway’s 401, 429 and 404 for a path or method the API does not serve carry no code.
  4. Retry 429 and 503 after the seconds in the Retry-After header, and retry 500. Both SDKs do this, retrying a request twice. Fix a 400, 413 or 415 before resending, since the same request fails again. Do not retry a 403: the organization does not have access to the API, which is requested through the contact form. See Errors.
  5. 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.

Where to go next

ToRead
Check the exact request and response schemasOpenAPI spec (also as YAML), Create decision
Run a first request from a scriptPython quickstart, TypeScript quickstart
Find example questions for a taskUse cases
Choose whose voice and how much audio to sendPreparing your audio
Word questions and criteriaWriting questions
Act on answers and set thresholdsInterpreting answers
Read every field of each question typePrimitives
Estimate the input tokens of a request before sending itEstimate input tokens
Look up past requestsRuns
Check limits and handle errorsLimits, Errors
Evaluate many recordingsEvaluating many files, Evaluating many recordings
Answer live audioLive audio, Answering live audio