# voice

Canonical URL: https://developers.iagenify.com/sdk/ref/tools/voice/
Language: en

`tools: { voice: api.tools.voice }, model: { main, voice }`

Lets a run read text aloud. A declaration resolved against a session named voice — and the text it speaks is the text it was given, word for word.

Status: declaration only · needs a voice session · declared cost 8

Nothing to call. The audio comes from a [model session](/sdk/ref/models/create) handed to the run under the name `voice`.

## Declaring it {#declaring}

```javascript
const writer = await api.models.create({ model: "gemini-3.5-flash" });
const speaker = await api.models.create({
  model: "gemini-3.5-flash-tts",
  settings: { voice: "Kore" },
});

const agent = api.agents.create({
  model: { main: writer, voice: speaker },
  tools: { voice: api.tools.voice },
});
```

## What the model sends {#arguments}

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `text` | string | required | **The exact words to speak.** Not a description of them. |

> **This is the one tool whose argument is the output**
>
> Every other media tool takes a description and invents the rest. Here the argument is read out as it is, so « summarise the report and read it » means the model must write the summary into text — and the description says exactly that, because a model given a vague parameter would narrate instead.

## Where the audio goes {#result}

```javascript
const [sound] = run.artifacts.filter((a) => a.type === "audio");
await pc.files.write("Audio/summary.wav", Buffer.from(sound.content, "base64"));
```

## The declared cost is 8 {#cost}

The cheapest of the four, and it is still an over-estimate: speech is priced on the characters spoken, and the guard has to decide before the text exists. A long reading costs more than one call's worth of the default — set `cost` higher when a run is meant to read whole documents.

```javascript
tools: {
  voice: { run: api.tools.voice, cost: 20, options: { voice: "Puck" } },
}
```

## The voice is the session's {#settings}

Which voice, and anything else the model takes, is in the session's settings — or pinned per call with `options`. The model chooses the words, never the speaker.

## Break a long reading up {#length}

One call carries one block of text through the turn. For a long document, have the run read it section by section and join the clips yourself — which also gives you a file per section rather than one you cannot navigate.

- [music](/sdk/ref/tools/music): A clip with no words.
- [create_voice](/sdk/agent/tools/create-voice): The local engine's version.
- [api.tools](/sdk/ref/tools): The fifteen, and the two ways to use them.

```python
writer = api.models.create(model="gemini-3.5-flash")
speaker = api.models.create(
    model="gemini-3.5-flash-tts",
    settings={"voice": "Kore"},
)

agent = api.agents.create(
    model={"main": writer, "voice": speaker},
    tools={"voice": api.tools.voice},
)
```

```python
import base64

sound = next(a for a in run["artifacts"] if a["type"] == "audio")
pc.files.write("Audio/summary.wav", base64.b64decode(sound["content"]))
```

```python
tools = {
    "voice": {"run": api.tools.voice, "cost": 20, "options": {"voice": "Puck"}},
}
```
