Voice is being upgraded

可编程语音,以 JSON 定义。通话、IVR、录音、TTS。

面向开发者的语音服务 — 覆盖 140 多个国家、1,500 多个电话号码前缀、号码隐藏通话、虚拟号码。与 Email 和 SMS 共享同一 API 接口 — 通话只是另一种资源。

place-call.ts
201 · 0.4s
import { BirdClient } from "@messagebird/sdk";

const bird = new BirdClient({ apiKey: process.env.BIRD_API_KEY! });

const { data, error } = await bird.voice.calls.create({
  to:   "+15005550010",
  from: "+14155550199",
  flow: [
    { say:    "Your verification code is..." },
    { say:    "4. 2. 9. 1. 7." },
    { gather: { digits: 1, timeout: 5 } },
    { record: { transcribe: true } },
  ],
}).safe();

if (error) throw error;
console.log(data.id);
// → "call_7tQ04Lp2n..."

从安装到首次通话仅需 5 分钟

用你熟悉的编程语言发起通话。

SDK 覆盖所有主流运行时。首次通话将拨打指定测试号码 (+15005550010),让你在配置正式号码前即可在 CI 中验证。

1
2
3
4
5
6
7
8
9
import { BirdClient } from "@messagebird/sdk";

const bird = new BirdClient({ apiKey: process.env.BIRD_API_KEY! });

const { data, error } = await bird.voice.calls.create({
  to:   "+15005550010",
  from: "+14155550199",
  flow: [{ say: "Hello from Node." }],
}).safe();

Ten parts of voice you'd rather not write yourself.

Carrier routing, call control, and observability primitives — named and audit-able.

  1. 01

    呼出与呼入通话

    通过 REST 或 SIP 发起和接听通话 — 相同的认证模型,相同的幂等性契约。

  2. 02

    JSON 声明式通话流程

    将 say、play、gather、record、transfer 和 dial 组合为一个扁平 JSON 数组。

  3. 03

    录音与转写

    任意通话段可选录音;自动生成 40 多种语言的转写文本。

  4. 04

    流式 TTS,延迟低于 250ms

    通过 HTTP 分块传输或 WebSocket 输出首字节音频 — 按字符计费。

  5. 05

    语音 OTP 验证

    与 SMS OTP 共用同一 bird.verifications 资源;只需切换 channel 字段。

  6. 06

    100 多个国家的虚拟号码

    通过控制台或 numbers API 在数秒内配置长号码。

  7. 07

    号码隐藏通话

    主叫与被叫号码彼此不可见 — 通过路由实现隐私保护。

  8. 08

    每次通话智能路由

    每段通话实时选择最低成本运营商,故障时自动重选路由。

  9. 09

    按通话触发的 Webhook 事件

    call.ringing、call.answered、call.completed 等事件 — HMAC 签名,防重放保护。

  10. 10

    WebRTC 客户端 SDK

    仅需一个 npm 包即可实现浏览器到 PSTN 的桥接;兼容任何现代运行时。

我们为何打造 Voice

语音是所有人都轻视的渠道。我们没有。

语音很难 — 亚秒级延迟、真实运营商路由、录音合规 — 这正是大多数供应商为其单独设计认证、SDK 和 Webhook 契约的原因。我们花时间将其统一为与每个 Bird 端点一致的形态:相同的认证、相同的幂等性、相同的错误封装。通话控制就是 JSON。

place-call.ts
201 · 0.4s
import { BirdClient } from "@messagebird/sdk";

const bird = new BirdClient({ apiKey: process.env.BIRD_API_KEY! });

const { data, error } = await bird.voice.calls.create({
  to:   "+15005550010",
  from: "+14155550199",
  flow: [
    { say:    "Your verification code is..." },
    { say:    "4. 2. 9. 1. 7." },
    { gather: { digits: 1, timeout: 5 } },
    { record: { transcribe: true } },
  ],
}).safe();

if (error) throw error;
console.log(data.id);
// → "call_7tQ04Lp2n..."

每次状态变更都是一个 Webhook。

HMAC 签名载荷,防重放,幂等。所有 Bird 渠道共用同一封装格式 — 学会一个,即通晓全部。

POST /webhooks/bird
signed
{
  "type": "call.completed",
  "id":   "evt_8qC42v...",
  "created_at": "2026-05-19T15:42:01.221Z",
  "data": {
    "call_id":    "call_7tQ04Lp2n",
    "from":       "+14155550199",
    "to":         "+15005550010",
    "direction":  "outbound",
    "status":     "completed",
    "duration_s": 42,
    "answered_at": "2026-05-19T15:41:18.402Z",
    "ended_at":    "2026-05-19T15:42:00.117Z",
    "price":       { "amount": 0.014, "currency": "USD" }
  }
}

重试计划:5 秒、30 秒、5 分钟、30 分钟、2 小时、6 小时、12 小时。最终尝试后进入死信队列;所有死信事件均可通过控制台或 API 重放。

  • call.queued已被 API 接受并加入拨号队列。
  • call.ringing对方线路正在响铃 — 应答前状态。
  • call.answered被叫已接听;计费从此事件开始。
  • call.completed通话正常结束 — 载荷中包含时长和费用。
  • call.failed永久性失败(忙线、无人接听、运营商拒绝),附带类型化原因。
  • call.recording.ready录音已编码,可通过载荷中的签名 URL 访问。
  • call.transcript.ready转写完成;载荷包含语言和分段信息。

语音 OTP 与 SMS OTP 共用同一资源。

发起自定义通话或将验证交给运行时处理。相同的认证、相同的幂等性、相同的错误封装 — 唯一变化的只是 channel 字段。

自定义通话。

voice.calls.create
await bird.voice.calls.create({
  to:   "+15005550010",
  flow: [
    { say: `Your code is ${code}.` },
  ],
});

自由编排任意流程 — say、gather、transfer — 适用于需要在代码中定义脚本的场景。

验证。

verifications.start
await bird.verifications.start({
  to:      "+15005550010",
  channel: "voice",
});

一行代码。Bird 选择路由、执行反欺诈检查、下发语音提示。所有渠道共用同一代码。

按分钟计费,因国家而异。

流式 TTS 按字符计费。达到常用阈值时自动享受批量折扣。无席位费,无功能锁定在年付套餐之后。

从一个渠道开始。
准备好后,再添加其他渠道。

测试 API 密钥即刻可用。添加支付方式并验证发送者身份后,即可解锁生产环境。

Using Claude Code, Cursor, or Codex? Copy a setup prompt and your agent installs the Bird CLI and skills for you. Pick yours: