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

# Isolate the caller's voice

> Isolate the caller's voice and suppress background noise before it reaches the agent's speech-to-text, with voice_focus.

Real calls are noisy: keyboard clacks, café chatter, a car engine, room echo. That noise makes the agent mishear words and, worse, can trip false turn-taking and interruptions. `input.voice_focus` isolates the primary speaker and suppresses background audio before it reaches transcription, so the agent responds to the caller and not the room. Set it when you [create](/docs/voice-agents/voice-agent-api/create-agent) or [update](/docs/voice-agents/voice-agent-api/manage-agents) the agent.

| Model      | Value        | Use for                                                                |
| ---------- | ------------ | ---------------------------------------------------------------------- |
| Near field | `near-field` | Headsets, handsets, and other close-talking mics. Default.             |
| Far field  | `far-field`  | Phone speakerphone, conference rooms, drive-thru, laptop and car mics. |

Match the model to how the caller is captured: a browser agent on a headset wants `near-field`; a phone or in-room agent wants `far-field`.

<CodeGroup>
  ```bash cURL {8} theme={null}
  curl -X POST https://agents.assemblyai.com/v1/agents \
    -H "Authorization: $ASSEMBLYAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Drive-thru Assistant",
      "system_prompt": "You take drive-thru orders.",
      "voice": { "voice_id": "alba" },
      "input": { "voice_focus": "far-field", "voice_focus_threshold": 0.8 }
    }'
  ```

  ```python Python {12} theme={null}
  # pip install requests
  import os
  import requests

  resp = requests.post(
      "https://agents.assemblyai.com/v1/agents",
      headers={"Authorization": os.environ["ASSEMBLYAI_API_KEY"]},
      json={
          "name": "Drive-thru Assistant",
          "system_prompt": "You take drive-thru orders.",
          "voice": {"voice_id": "alba"},
          "input": {"voice_focus": "far-field", "voice_focus_threshold": 0.8},
      },
  )
  resp.raise_for_status()
  print(resp.json())
  ```

  ```javascript Node.js {12} theme={null}
  // Node 18+ has fetch built in
  const res = await fetch("https://agents.assemblyai.com/v1/agents", {
    method: "POST",
    headers: {
      Authorization: process.env.ASSEMBLYAI_API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      name: "Drive-thru Assistant",
      system_prompt: "You take drive-thru orders.",
      voice: { voice_id: "alba" },
      input: { voice_focus: "far-field", voice_focus_threshold: 0.8 },
    }),
  });
  const data = await res.json();
  console.log(data);
  ```
</CodeGroup>

| Field                         | Type   | Required | Notes                                                                                       |
| ----------------------------- | ------ | -------- | ------------------------------------------------------------------------------------------- |
| `input.voice_focus`           | string | No       | `near-field` (default) or `far-field`.                                                      |
| `input.voice_focus_threshold` | number | No       | `0.0` to `1.0`, default `0.7`. Higher suppresses more aggressively. Requires `voice_focus`. |

<Note>
  Voice Focus is applied when the speech-to-text connection opens, so set it at agent-create or connect time. For how the models and threshold behave under the hood, see [Voice Focus](/docs/streaming/voice-focus) in the Streaming docs.
</Note>
