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

# Run Your First Audio Analysis Request with Dolva API

> Step-by-step guide to uploading an audio file and receiving cognitive or emotion signal results from the Dolva API for the first time.

This guide walks you through a complete end-to-end example: uploading an audio file to Dolva and receiving analysis results. By the end, you'll have made a real API call and understand the shape of the response.

## What You Need

* A Dolva API token (from your dashboard at [dolva.ai](https://dolva.ai))
* An audio file to analyze (WAV, MP3, or similar — see [Audio Requirements](/concepts/audio-requirements))
* `curl`, Python 3, or Node.js

## Step 1: Pick Your Analysis Type

Dolva offers two analysis endpoints:

* **`/v1/analyze/cognitive`** — for cognitive load, clarity, and processing signals
* **`/v1/analyze/emotion`** — for emotional state and valence signals

You can call both on the same audio file. Start with whichever is most relevant to your use case.

## Step 2: Make the Request

Replace `dv-xxxxxxxx` with your token and `/path/to/audio.wav` with your file path:

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://api.dolva.ai/v1/analyze/cognitive \
    -H "Authorization: Bearer dv-xxxxxxxx" \
    -F "audio=@/path/to/audio.wav"
  ```

  ```python Python theme={null}
  import requests
  import os

  token = os.environ["DOLVA_API_TOKEN"]

  with open("/path/to/audio.wav", "rb") as audio_file:
      response = requests.post(
          "https://api.dolva.ai/v1/analyze/cognitive",
          headers={"Authorization": f"Bearer {token}"},
          files={"audio": audio_file}
      )

  if response.status_code == 200:
      result = response.json()
      print(result)
  else:
      print(f"Error {response.status_code}: {response.text}")
  ```

  ```javascript Node.js theme={null}
  import fetch from "node-fetch";
  import FormData from "form-data";
  import fs from "fs";

  const form = new FormData();
  form.append("audio", fs.createReadStream("/path/to/audio.wav"));

  const response = await fetch("https://api.dolva.ai/v1/analyze/cognitive", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.DOLVA_API_TOKEN}`,
      ...form.getHeaders(),
    },
    body: form,
  });

  const result = await response.json();
  console.log(result);
  ```
</CodeGroup>

## Step 3: Read the Response

A successful request returns HTTP `200` with a JSON body containing the analysis signals:

```json Example Response theme={null}
{
  "status": "ok",
  "signals": {
    "cognitive_load": 0.68,
    "clarity": 0.81
  }
}
```

<Note>
  The exact fields returned depend on the Dolva model version and the content of your audio. See [Interpreting Results](/guides/interpreting-results) for a detailed explanation of each field.
</Note>

## Step 4: Try Emotion Analysis

Repeat the same request against the emotion endpoint to see affective signals:

```bash curl theme={null}
curl -X POST https://api.dolva.ai/v1/analyze/emotion \
  -H "Authorization: Bearer dv-xxxxxxxx" \
  -F "audio=@/path/to/audio.wav"
```

## What's Next

<CardGroup cols={2}>
  <Card title="Interpreting Results" icon="chart-line" href="/guides/interpreting-results">
    Understand what each signal value means.
  </Card>

  <Card title="Error Handling" icon="triangle-exclamation" href="/guides/error-handling">
    Handle errors and edge cases in production.
  </Card>
</CardGroup>
