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

# Bolna + Cartesia

> Cartesia Sonic の音声で話す Bolna の音声 AI 電話エージェントを作成します

> [!TIP]
>
> 最終確認日：2026年10月30日

## 概要

[Bolna](https://www.bolna.ai/docs/introduction) は、電話上で音声 AI エージェントを実行します。各通話では、音声認識（STT）のトランスクライバー、LLM、音声合成（TTS）のシンセサイザーを連結して処理します。エージェントのシンセサイザーに [Sonic](https://docs.cartesia.ai/ja-jp/build-with-cartesia/tts-models/latest.md) を設定すると、すべての応答を Cartesia の音声で読み上げられます。

## 前提条件

* ウォレットにクレジットがある [platform.bolna.ai](https://platform.bolna.ai) の Bolna アカウント（通話でクレジットが消費されるため）
* [Generate an API key](https://www.bolna.ai/docs/api-reference/introduction) で取得した Bolna API キー（`BOLNA_API_KEY`）
* 発信先の電話番号（[E.164](https://en.wikipedia.org/wiki/E.164) 形式。例：`+919876543210`）
* [Cartesia API キー](https://play.cartesia.ai/keys)（`sk_car_...` のような形式）。Bolna アカウントに含まれる Cartesia の利用枠を使う場合は不要です
* 次のいずれか：`curl`、`requests` をインストールした Python 3.9 以降（`pip install requests`）、または TypeScript の例を実行するための Node.js 18 以降（`npx tsx` で実行）

## クイックスタート

### 1. Cartesia API キーを接続する

Bolna ダッシュボードで **Settings** > [**Integrations**](https://platform.bolna.ai/providers) を開き、**TTS** で絞り込みます。**Cartesia** カードの **Connect** をクリックし、Cartesia API キーを貼り付けます。Bolna アカウントに含まれる Cartesia の利用枠を使う場合は、この手順を省略できます。

### 2. 環境変数を設定する

```bash theme={null}
export BOLNA_API_KEY="bn-your-key"
export RECIPIENT_PHONE_NUMBER="+919876543210"
```

### 3. Sonic の音声でエージェントを作成する

`synthesizer` ブロックで Cartesia を選択します。Bolna は `model` と `voice_id` の組み合わせを自社の音声カタログと照合して検証します。また、Cartesia を使う場合は `provider_config` 内に `language` が必須です。

> [tab] cURL
>
> ```bash theme={null}
> curl https://api.bolna.ai/v2/agent \
>   -H "Authorization: Bearer $BOLNA_API_KEY" \
>   -H "Content-Type: application/json" \
>   --data @- <<'EOF'
> {
>   "agent_config": {
>     "agent_name": "Cartesia Sonic Agent",
>     "agent_welcome_message": "Hi! This is a test call from a Bolna agent speaking with a Cartesia voice. How is your day going?",
>     "tasks": [{
>       "task_type": "conversation",
>       "toolchain": { "execution": "sequential", "pipelines": [["transcriber", "llm", "synthesizer"]] },
>       "tools_config": {
>         "synthesizer": {
>           "provider": "cartesia",
>           "provider_config": {
>             "voice": "Brooke - Big Sister",
>             "voice_id": "e07c00bc-4134-4eae-9ea4-1a55fb45746b",
>             "model": "sonic-3.6",
>             "language": "en"
>           },
>           "stream": true,
>           "buffer_size": 250,
>           "audio_format": "wav"
>         },
>         "llm_agent": {
>           "agent_type": "simple_llm_agent",
>           "agent_flow_type": "streaming",
>           "llm_config": { "provider": "openai", "model": "gpt-5.4-mini", "max_tokens": 150, "temperature": 1 }
>         },
>         "transcriber": { "provider": "deepgram", "model": "nova-3", "language": "en", "stream": true, "encoding": "linear16", "sampling_rate": 16000, "endpointing": 250 },
>         "input": { "provider": "plivo", "format": "wav" },
>         "output": { "provider": "plivo", "format": "wav" }
>       },
>       "task_config": { "call_terminate": 90, "hangup_after_silence": 10 }
>     }]
>   },
>   "agent_prompts": {
>     "task_1": { "system_prompt": "You are a friendly assistant making a short test call. Keep every reply under two sentences. Ask how their day is going, thank them, then end the call politely." }
>   }
> }
> EOF
> ```

> [tab] Python
>
> `create_agent.py` として保存し、`python create_agent.py` を実行します。
>
> ```python theme={null}
> import os
>
> import requests
>
> agent_config = {
>     "agent_name": "Cartesia Sonic Agent",
>     "agent_welcome_message": "Hi! This is a test call from a Bolna agent speaking with a Cartesia voice. How is your day going?",
>     "tasks": [{
>         "task_type": "conversation",
>         "toolchain": {"execution": "sequential", "pipelines": [["transcriber", "llm", "synthesizer"]]},
>         "tools_config": {
>             "synthesizer": {
>                 "provider": "cartesia",
>                 "provider_config": {
>                     "voice": "Brooke - Big Sister",
>                     "voice_id": "e07c00bc-4134-4eae-9ea4-1a55fb45746b",
>                     "model": "sonic-3.6",
>                     "language": "en",
>                 },
>                 "stream": True,
>                 "buffer_size": 250,
>                 "audio_format": "wav",
>             },
>             "llm_agent": {
>                 "agent_type": "simple_llm_agent",
>                 "agent_flow_type": "streaming",
>                 "llm_config": {"provider": "openai", "model": "gpt-5.4-mini", "max_tokens": 150, "temperature": 1},
>             },
>             "transcriber": {"provider": "deepgram", "model": "nova-3", "language": "en", "stream": True, "encoding": "linear16", "sampling_rate": 16000, "endpointing": 250},
>             "input": {"provider": "plivo", "format": "wav"},
>             "output": {"provider": "plivo", "format": "wav"},
>         },
>         "task_config": {"call_terminate": 90, "hangup_after_silence": 10},
>     }],
> }
> agent_prompts = {
>     "task_1": {"system_prompt": "You are a friendly assistant making a short test call. Keep every reply under two sentences. Ask how their day is going, thank them, then end the call politely."}
> }
>
> response = requests.post(
>     "https://api.bolna.ai/v2/agent",
>     headers={"Authorization": f"Bearer {os.environ['BOLNA_API_KEY']}"},
>     json={"agent_config": agent_config, "agent_prompts": agent_prompts},
> )
> response.raise_for_status()
> print(response.json())
> ```

> [tab] TypeScript
>
> `create-agent.ts` として保存し、`npx tsx create-agent.ts` を実行します。
>
> ```typescript theme={null}
> const agentConfig = {
>   agent_name: "Cartesia Sonic Agent",
>   agent_welcome_message: "Hi! This is a test call from a Bolna agent speaking with a Cartesia voice. How is your day going?",
>   tasks: [{
>     task_type: "conversation",
>     toolchain: { execution: "sequential", pipelines: [["transcriber", "llm", "synthesizer"]] },
>     tools_config: {
>       synthesizer: {
>         provider: "cartesia",
>         provider_config: {
>           voice: "Brooke - Big Sister",
>           voice_id: "e07c00bc-4134-4eae-9ea4-1a55fb45746b",
>           model: "sonic-3.6",
>           language: "en",
>         },
>         stream: true,
>         buffer_size: 250,
>         audio_format: "wav",
>       },
>       llm_agent: {
>         agent_type: "simple_llm_agent",
>         agent_flow_type: "streaming",
>         llm_config: { provider: "openai", model: "gpt-5.4-mini", max_tokens: 150, temperature: 1 },
>       },
>       transcriber: { provider: "deepgram", model: "nova-3", language: "en", stream: true, encoding: "linear16", sampling_rate: 16000, endpointing: 250 },
>       input: { provider: "plivo", format: "wav" },
>       output: { provider: "plivo", format: "wav" },
>     },
>     task_config: { call_terminate: 90, hangup_after_silence: 10 },
>   }],
> };
> const agentPrompts = {
>   task_1: { system_prompt: "You are a friendly assistant making a short test call. Keep every reply under two sentences. Ask how their day is going, thank them, then end the call politely." },
> };
>
> async function main() {
>   const response = await fetch("https://api.bolna.ai/v2/agent", {
>     method: "POST",
>     headers: {
>       Authorization: `Bearer ${process.env.BOLNA_API_KEY}`,
>       "Content-Type": "application/json",
>     },
>     body: JSON.stringify({ agent_config: agentConfig, agent_prompts: agentPrompts }),
>   });
>   if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);
>   console.log(await response.json());
> }
>
> main();
> ```

Bolna は新しいエージェントの ID を返します。

```json theme={null}
{
  "agent_id": "123e4567-e89b-12d3-a456-426655440000",
  "state": "created",
  "version_id": "9f1d950f-a4ae-4ba6-bf27-19d1b7b8d32e"
}
```

次の手順で使うため、ID を保存します。

```bash theme={null}
export BOLNA_AGENT_ID="your-agent-id"
```

### 4. 発信する

Bolna がデフォルトの番号から `RECIPIENT_PHONE_NUMBER` に発信します。

> [tab] cURL
>
> ```bash theme={null}
> curl https://api.bolna.ai/call \
>   -H "Authorization: Bearer $BOLNA_API_KEY" \
>   -H "Content-Type: application/json" \
>   --data @- <<EOF
> {
>   "agent_id": "$BOLNA_AGENT_ID",
>   "recipient_phone_number": "$RECIPIENT_PHONE_NUMBER"
> }
> EOF
> ```

> [tab] Python
>
> `place_call.py` として保存し、`python place_call.py` を実行します。
>
> ```python theme={null}
> import os
>
> import requests
>
> response = requests.post(
>     "https://api.bolna.ai/call",
>     headers={"Authorization": f"Bearer {os.environ['BOLNA_API_KEY']}"},
>     json={
>         "agent_id": os.environ["BOLNA_AGENT_ID"],
>         "recipient_phone_number": os.environ["RECIPIENT_PHONE_NUMBER"],
>     },
> )
> response.raise_for_status()
> print(response.json())
> ```

> [tab] TypeScript
>
> `place-call.ts` として保存し、`npx tsx place-call.ts` を実行します。
>
> ```typescript theme={null}
> async function main() {
>   const response = await fetch("https://api.bolna.ai/call", {
>     method: "POST",
>     headers: {
>       Authorization: `Bearer ${process.env.BOLNA_API_KEY}`,
>       "Content-Type": "application/json",
>     },
>     body: JSON.stringify({
>       agent_id: process.env.BOLNA_AGENT_ID,
>       recipient_phone_number: process.env.RECIPIENT_PHONE_NUMBER,
>     }),
>   });
>   if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);
>   console.log(await response.json());
> }
>
> main();
> ```

```json theme={null}
{ "message": "done", "status": "queued", "execution_id": "123e4567-e89b-12d3-a456-426614174000" }
```

数秒以内に電話が鳴り、エージェントが Sonic の音声で挨拶します。

コードを書かずに同じエージェントを設定するには、Bolna ダッシュボードでエージェントの [Languages タブ](https://www.bolna.ai/docs/agent-setup/audio-tab)を開き、音声プロバイダーとして Cartesia を選択します。

## 設定

Cartesia の設定は `tools_config.synthesizer.provider_config` で指定します。

| パラメーター | 型 | デフォルト | 説明 |
| - | - | - | - |
| `model` | `string` | 必須 | `sonic-3.6`、`sonic-3.5`、または `sonic-3` |
| `voice` | `string` | 必須 | 音声の表示名（例：`"Brooke - Big Sister"`） |
| `voice_id` | `string` | 必須 | Bolna の音声カタログにある音声 ID（下記参照） |
| `language` | `string` | 必須 | 音声合成に使う言語コード（例：`"en"`、`"hi"`） |
| `speed` | `number` | `1` | 話す速度 |

Bolna は `model` と `voice_id` をセットで検証します。エージェントを作成する前に、[List TTS providers](https://www.bolna.ai/docs/api-reference/voice/get_providers) と [List voices](https://www.bolna.ai/docs/api-reference/voice/get_all) を使って有効な組み合わせを確認してください。音声選びのヒントについては、[音声の選び方](https://docs.cartesia.ai/ja-jp/build-with-cartesia/capability-guides/choosing-a-voice)を参照してください。

## リソース

* [Bolna の Cartesia ガイド](https://www.bolna.ai/docs/cartesia)
* [Bolna のエージェント作成 API](https://www.bolna.ai/docs/api-reference/agent/v2/create)
* [Bolna の発信 API](https://www.bolna.ai/docs/api-reference/calls/make)
* [Bolna のプロバイダー認証情報](https://www.bolna.ai/docs/providers)
* [Sonic TTS モデル](https://docs.cartesia.ai/ja-jp/build-with-cartesia/tts-models/latest.md)
* [Cartesia 音声ライブラリ](https://play.cartesia.ai/voices)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.