> ## 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](https://assemblyai.com/docs/voice-agents/voice-agent-api/create-agent.md) or [update](https://assemblyai.com/docs/voice-agents/voice-agent-api/manage-agents.md) 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`.

```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);
```

| 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.85`. 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](https://assemblyai.com/docs/streaming/voice-focus.md) in the Streaming docs.
