专为需要快速交付的开发者打造的 SMS API

设置时长:
Cursor

150+ countries, 240 direct-to-carrier connections, one auth model. About 40% of the world's commercial SMS volume transits the Bird network. We've been at this a decade. 95% of messages delivered in under 2.5 seconds.

send-otp.ts
200 · 0.4s
import { BirdClient } from "@messagebird/sdk";

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

const code = generateOtp();

const { data, error } = await bird.sms.send({
  from:     "Bird",
  to:       "+15005550006",
  text:     `Your Bird verification code is ${code}. Reply STOP to opt out.`,
  category: "authentication",
}).safe();

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

Today at 2:14 PM

Hey Ada, your Bird sign-in code is 482917. It'll expire in 10 minutes. Don't share it with anyone.
482917
Delivered

从 npm install 到首次发送仅需 5 分钟

用您熟悉的编程语言发送 SMS。

支持所有主流运行时的 SDK。首次发送将发往指定测试接收号码(+15005550006),因此您可以在分配号码之前先完成 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.sms.send({
  to:       "+15005550006",
  text:     "Hello from Node.",
  category: "transactional",
}).safe();

我们代您处理十项申报、配置和路由工作。

路由、合规与入站基础能力,命名清晰、可审计。

  1. 01

    覆盖 150 多个国家

    One unified API, one billing relationship. No per-region contracts to chase down.

  2. 02

    240 条运营商直连线路

    我们与移动运营商之间没有中间聚合商抽取利润或丢失回执。

  3. 03

    运营商级路由

    当运营商路径质量下降时实时重新选路;故障切换在您察觉之前已完成。

  4. 04

    双向 SMS 入站

    入站消息以 HMAC 签名的 webhook 形式送达到您已分配的号码上。

  5. 05

    各种类型的号码

    Long codes, short codes, toll-free, and alphanumeric sender IDs, provisioned via one endpoint.

  6. 06

    A2P 10DLC 控制台内注册

    品牌和活动注册在控制台中完成;状态可通过 API 查询。

  7. 07

    发送前 MNP 查询

    我们在每次发送时解析接收方的当前运营商,确保路由始终正确。

  8. 08

    STOP / HELP 合规

    自动按接收方识别退订关键词;退订列表可通过 API 查询。

  9. 09

    以 webhook 形式接收送达回执

    Every state transition fires a signed event: sms.accepted through sms.delivered or sms.failed.

  10. 10

    分段与 Unicode 安全

    SDK 在发送前计算分段数,并在编码切换可能导致消息拆分时发出警告。

SMS 只是更大工具集中的一个渠道。通过 验证 用一次性密码验证用户,发送前用 号码查询 检查号码的线路类型和运营商,或通过 RCS 用富媒体卡片触达同一部手机。

我们为何构建 SMS

SMS 是最复杂的通信渠道。我们构建了让它变得简单可控的 API。

每个国家有不同的规则,每家运营商有不同的路由,每个地区有不同的发送者 ID 规范。我们运营 SMS 已有十年,所有这些知识都整合在一个端点、一个认证模型、一套 Webhook 契约之后。无论上游如何变化,您调用的 bird.sms.send 接口始终不变。

send-otp.ts
200 · 0.4s
import { BirdClient } from "@messagebird/sdk";

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

const code = generateOtp();

const { data, error } = await bird.sms.send({
  from:     "Bird",
  to:       "+15005550006",
  text:     `Your Bird verification code is ${code}. Reply STOP to opt out.`,
  category: "authentication",
}).safe();

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

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

HMAC-signed payloads, replay-protected, idempotent. The same envelope on every Bird channel: learn one, you've learned them all.

POST /webhooks/bird
signed
{
  "type": "sms.delivered",
  "timestamp": "2026-05-19T15:42:01.221Z",
  "data": {
    "sms_id":       "sms_4kT01Lq2m",
    "workspace_id": "ws_8KQ2",
    "to":           "+15005550006",
    "from":         "Bird",
    "tags":         [{ "name": "campaign", "value": "otp" }],
    "metadata":     { "user_id": "usr_12345" },
    "carrier":      "Verizon",
    "mcc_mnc":      "311480"
  }
}

重试策略:5 秒、30 秒、5 分钟、30 分钟、2 小时、6 小时、12 小时。最终尝试失败后进入死信队列;每个死信事件均可通过控制台或 API 重新发送。

  • sms.accepted已被 API 接受并排队等待运营商交接。
  • sms.sent已提交至目标运营商的 SMSC。
  • sms.delivered已收到运营商的送达回执(DLR)。
  • sms.rejectedRejected before carrier hand-off: invalid destination, suppression, or a content policy guard.
  • sms.undelivered运营商报告了一个非永久性投递失败。
  • sms.failedTerminal failure: the message will not be delivered.

集成了 SMS,就等于集成了 WhatsApp。

相同的鉴权模型、相同的幂等性约定、相同的错误信封、相同的 webhook 结构。区别在于各自能做什么,而不是你如何调用。

SMS

一个动词。纯文本。数字格式的收发号码。每位开发者都已形成肌肉记忆的格式。

otp.ts
await bird.sms.send({
  to:       "+15005550006",
  text:     `Your code is ${code}.`,
  category: "authentication",
});

WhatsApp

Same verb. Different payload: templated, opted-in, in the channel two billion people open daily.

otp.ts
await bird.whatsapp.send({
  from: "+15551234567",
  to:   "+15005550006",
  template: { name: "otp", variables: { code } },
});

SMS API 常见问题

我多快能发送第一条 SMS?
Install the SDK and send to the sanctioned test recipient +15005550006 in about five minutes. You can ship a CI check before you provision a number.
Bird 的 SMS API 包含哪些功能?
One send endpoint, two-way inbound, number provisioning (long codes, short codes, toll-free, and alphanumeric sender IDs), A2P 10DLC and opt-out compliance, direct-to-carrier routing, and delivery analytics, all on one API.
我可以向哪些国家/地区发送?
Bird 通过 240 条直连运营商连接覆盖 150 多个国家/地区,并在运营商路径质量下降时进行运营商级路由重选。
你们处理 STOP 和 HELP 关键词吗?
是的,按收件人自动处理。STOP 会将收件人退订并加入可查询的抑制列表,HELP 会返回自动帮助回复,START 则让其重新订阅。
我需要注册 A2P 10DLC 吗?
如果要向美国号码发送应用到个人(A2P)流量,则需要。品牌和活动注册在控制台中完成,并且可通过 API 查询状态。

定价

每条分段从不足一分到几美分不等

按用量和目的地国家/地区计费。完整的分国家/地区价目表见定价页面,批量折扣会在账户层面自动应用。无平台费、无席位费,也没有锁定在年度承诺背后的分级功能。

每天受到众多构建世界级软件的团队的信赖

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

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

正在使用 Claude Code、Cursor 或 Codex?复制一条设置提示,您的智能代理即可自动安装 Bird CLI 和相关技能。选择您的工具:

Cursor