> ## Documentation Index
> Fetch the complete documentation index at: https://developers.heygen.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Decision from audio

> Ask HeyGen Decision 1 about up to 10 audio clips of 30 minutes each: route calls and voicemails, check what was said, and score delivery.

Add up to 10 clips, each at most 30 minutes long, under `assets.audios` to decide on what something sounds like: the intent of a voicemail, whether a call followed a script, or how clearly a voiceover is delivered.

The model hears the audio itself. You do not need a transcript. Use `state` to say what each clip is.

## Route a voicemail

```bash theme={null}
curl -X POST https://api.heygen.com/v3/models/decisions \
  -H "X-Api-Key: $HEYGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "heygen-decision-1-turbo",
    "state": "The clip is a voicemail left on the support line.",
    "assets": {
      "audios": {
        "voicemail": { "type": "url", "url": "https://example.com/voicemail.mp3" }
      }
    },
    "questions": {
      "team": {
        "type": "choice",
        "instructions": "Which team should call the customer back?",
        "criteria": {
          "billing": "Payments, invoices, or refunds",
          "technical": "Something in the product is broken",
          "sales": "Questions about plans or buying more"
        }
      },
      "urgent": {
        "type": "noul",
        "instructions": "Does the caller say that their work is blocked today?"
      }
    }
  }'
```

Illustrative response for a 40-second voicemail:

```json Response theme={null}
{
  "data": {
    "id": "decision-0123456789abcdef",
    "request_id": "0123456789abcdef0123456789abcdef",
    "model": "heygen-decision-1-turbo",
    "answers": {
      "team": {
        "type": "choice",
        "choice": "technical",
        "probabilities": { "billing": 0.04, "technical": 0.93, "sales": 0.03 },
        "confidence": 0.895
      },
      "urgent": { "type": "noul", "noul": 0.81 }
    },
    "usage": { "input_tokens": 1290, "output_tokens": 0 }
  }
}
```

## Check a call against a script

Use a JSON `state` to give the script with the recording. This example also scores delivery.

```bash theme={null}
curl -X POST https://api.heygen.com/v3/models/decisions \
  -H "X-Api-Key: $HEYGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "heygen-decision-1-turbo",
    "state": {
      "clip": "A recorded sales call. The agent speaks first.",
      "required_disclosure": "This call may be recorded for quality and training."
    },
    "assets": {
      "audios": {
        "call": { "type": "asset_id", "asset_id": "AUDIO_ASSET_ID" }
      }
    },
    "questions": {
      "disclosure_given": {
        "type": "noul",
        "instructions": "Does the agent say the required disclosure, or the same meaning, in the first minute?"
      },
      "clarity": {
        "type": "score",
        "instructions": "How clearly does the agent speak?",
        "criteria": [
          "Hard to understand for most of the call",
          "Understandable, with some unclear parts",
          "Clear for the whole call"
        ]
      }
    }
  }'
```

## Audio inputs

| | |
| - | - |
| Field | `assets.audios`, keyed by name |
| Per request | Up to 10 clips, on both models. You can add images and videos in the same request. |
| Length | At most 30 minutes (1,800 s) per clip. The API reads each clip's length before the model runs. A longer clip returns `400`: `An audio clip can be at most 1,800 s; assets.audios.call is 1,931.4 s.` |
| Formats | WAV, MP3, FLAC, OGG, M4A, AAC, and WebM. For inline base64, set `media_type`, such as `audio/wav`, `audio/mpeg` or `audio/mp4`. |
| Sources | `asset_id`, HTTPS `url`, or `base64` with an `audio/*` `media_type`. See [Choose an asset source](https://developers.heygen.com/docs/models/heygen-decision.md#choose-an-asset-source). |
| Size | 32 MiB per URL download, 16 MiB per decoded base64 clip, within the 32 MiB request body |

For long recordings, upload with the [direct upload flow](https://developers.heygen.com/docs/direct-upload.md) and pass the `asset_id`. A 30-minute WAV file is larger than the URL and base64 caps. MP3 at 128 kbps is about 29 MB for 30 minutes.

## How much audio fits

If a request does not fit the context window, the API returns `400` with `context_length_exceeded`. See [Context window](https://developers.heygen.com/docs/models/heygen-decision.md#context-window).

## Audio with video

The model hears the soundtrack of each video in `assets.videos`. Send a video's sound as a separate clip only when you have it apart from the video.

The response has the same `data.answers` and `data.usage` fields as a [text request](https://developers.heygen.com/docs/models/decision/text.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.