# AssemblyAI (/en/ai/platform/models/asr/assembly-ai)

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

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


AssemblyAI provides advanced automatic speech recognition with high accuracy and support for multiple languages, designed for real-time conversational AI applications.

## Sample configuration

The following example shows how to configure AssemblyAI as the agent's ASR when you create or update an agent. For a complete example, see [Create an agent and start a session](/en/ai/platform/get-started/start-stop-agent#create-an-agent).

AssemblyAI supports BYOK only. It isn't available in managed mode. Store your AssemblyAI API key in a secret set, and refer to it from the agent. For details, see [Use your own provider keys](/en/ai/platform/build/use-your-own-keys).

**Python SDK**

```python
from agora_agent import Agent, AssemblyAISTT, secret_ref

# client is your configured Agora client
agent = (
    Agent(client=client)
    .with_stt(
        AssemblyAISTT(
            api_key=secret_ref("support_prod", "assemblyai"),
            language="en-US",
        )
    )
    .with_llm(...)  # configure your LLM vendor
    .with_tts(...)  # configure your TTS vendor
)
```

**TypeScript SDK**

```ts
import { Agent, AssemblyAISTT, secretRef } from 'agora-agents';

// client is your configured Agora client
const agent = new Agent({ client })
  .withStt(
    new AssemblyAISTT({
      apiKey: secretRef('support_prod', 'assemblyai'),
      language: 'en-US',
    }),
  )
  .withLlm(/* configure your LLM vendor */)
  .withTts(/* configure your TTS vendor */);
```

**Go SDK**

```go
// client is your configured Agora client
agent := agentkit.NewAgent(client).
	WithStt(vendors.NewAssemblyAISTT(vendors.AssemblyAISTTOptions{
		APIKey:   agentkit.SecretRef("support_prod", "assemblyai"),
		Language: "en-US",
	})).
	WithLlm( /* configure your LLM vendor */ ).
	WithTts( /* configure your TTS vendor */ )
```

**REST API**

Set `credential.mode` to `byok` and `credential.fields.api_key` to a reference to your AssemblyAI API key in a secret set. In the following example, the key is stored as `assemblyai` in the `support_prod` set:

```json
"asr": {
  "credential": {
    "mode": "byok",
    "fields": {
      "api_key": "$secrets.support_prod.assemblyai"
    }
  },
  "vendor": "assemblyai",
  "language": "en-US",
  "url": "wss://streaming.assemblyai.com/v3/ws",
  "params": {
    "language": "en-US"
  }
}
```

## Key parameters

The `asr` block takes the following fields. In the SDKs, `AssemblyAISTT` sets them from its options, and passes any other AssemblyAI parameters from its additional parameters option to `params`.

**asr required**

**`vendor` (string) required**

Set to `assemblyai`.

**`credential` (object) required**

How the agent authenticates with AssemblyAI. Set `mode` to `byok` and `fields.api_key` to a `$secrets.<set>.<key>` reference to your AssemblyAI API key. Get your API key from the [AssemblyAI Dashboard](https://www.assemblyai.com/dashboard/signup).

**`language` (string) required**

The language code for speech recognition.

**`url` (string) optional**

The WebSocket URL for AssemblyAI's streaming API. Specify this to target a particular region, for example, `wss://streaming.assemblyai.com/v3/ws`. Omit it to use the default endpoint.

> **Caution**
>
> The parameters listed on this page are validated for use with the Conversational AI Platform. Required parameters must be provided as documented. Any additional parameters in `params` are passed through directly to AssemblyAI without validation. For a full list of supported options, refer to the [AssemblyAI official documentation](https://www.assemblyai.com/docs/universal-streaming).

This integration is fully supported for use with the Conversational AI Platform. 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.
