# Fish Audio (/en/ai/models/tts/fish-audio)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

> Documentation: Conversational AI.
> Documentation version: Main.
> This document describes only this version. [Version index](/llms/doc-versions-convoai-guides-v1.txt).


Fish Audio provides text-to-speech (TTS) with flexible models and high-quality synthetic voices.

### Sample configuration

The following examples show how to configure Fish Audio TTS when starting a conversational AI agent.

**Python SDK**

```python
from agora_agent import Agent
from agora_agent.agentkit.vendors import FishAudioTTS

# client is your configured Agora client
agent = (
    Agent(client)
    .with_stt(...)  # configure your STT vendor
    .with_llm(...)  # configure your LLM vendor
    .with_tts(FishAudioTTS(
        key='your-fishaudio-key',  # omit key and set credential_mode='managed' to use Agora-managed mode
        reference_id='<voice_model_id>',
        backend='speech-1.5',
    ))
)
```

**TypeScript SDK**

```typescript
import { Agent, FishAudioTTS } from 'agora-agents';

// client is your configured Agora client
const agent = new Agent({ client })
  .withStt(/* configure your STT vendor */)
  .withLlm(/* configure your LLM vendor */)
  .withTts(new FishAudioTTS({
    key: 'your-fishaudio-key', // omit key and set credentialMode: CredentialMode.Managed to use Agora-managed mode
    referenceId: '<voice_model_id>',
    backend: 'speech-1.5',
  }));
```

**Go SDK**

```go
import (
    "github.com/AgoraIO/agora-agents-go/v2/agentkit"
    "github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"
)

// client is your configured Agora client
agent := agentkit.NewAgent(client).WithStt(/* configure your STT vendor */).
  WithLlm(/* configure your LLM vendor */).
  WithTts(
    vendors.NewFishAudioTTS(vendors.FishAudioTTSOptions{
        Key:         "your-fishaudio-key", // omit Key and set CredentialMode: agentkit.CredentialModeManaged to use Agora-managed mode
        ReferenceID: "<voice_model_id>",
        Backend:     "speech-1.5",
    }),
)
```

**REST API**

- **Managed mode**

  To use Fish Audio TTS with Agora-managed credentials, set `credential_mode` to `"managed"` in the `tts` block. When using managed mode, `params.api_key` is not required. Set `params.backend` to `s2.1-pro`. For more information, see [Use managed mode](/en/ai/build/managed-mode).

  ```json
  "tts": {
    "credential_mode": "managed",
    "vendor": "fishaudio",
    "params": {
      "reference_id": "<voice_model_id>",
      "backend": "s2.1-pro"
    }
  }
  ```


- **BYOK**

  ```json
  "tts": {
    "vendor": "fishaudio",
    "params": {
      "api_key": "<fishaudio_key>",
      "reference_id": "<voice_model_id>",
      "backend": "speech-1.5"
    }
  }
  ```

### Key parameters

The following parameters are required when using your own API key (BYOK). When using managed mode, `api_key` is not required. For more information, see [Use managed mode](/en/ai/build/managed-mode).

**params required**

**`api_key` (string) optional**

The Fish Audio API key used to authenticate requests. Required when using your own API key (BYOK).

**`reference_id` (string) required**

The identifier of the voice model to use for speech synthesis.

**`backend` (string) required**

The backend model version to use. For example, `speech-1.5`. For managed mode, use `s2.1-pro`.

> **Caution**
>
> The parameters listed on this page are validated for use with Conversational AI Engine. Required parameters must be provided as documented. Any additional parameters are passed through directly to the underlying vendor without validation. For a full list of supported options, refer to the [Fish Audio documentation](https://docs.fish.audio/sdk-reference/python/api-reference).

This integration is fully supported for use with Conversational AI Engine. While it has completed functional validation, it is newer to the platform, and additional provider-specific edge cases may be identified as usage scales across a broader range of applications and workloads.
