Limited offer

Build with our iMessage API/MCP. Get our sandbox for free.

Integrations

Send iMessages from the Vercel AI SDK

The short answer

Yes. Define a tool with the AI SDK's tool() helper and a zod schema, point its execute function at the Blue Reacher API, and generateText or streamText can send real blue-bubble iMessages from a dedicated line. Replies arrive as webhooks into a route handler in the same Next.js app. No A2P registration required, unlimited iMessages per line, and the endpoint below is the documented convention. Lines pace at 50 opted-in / 30 cold new contacts a day to stay deliverable; replies are never metered.

$249 per line per month, published No A2P registration required 50 opted-in / 30 cold new contacts a day, unlimited replies
AI and agent stacks

5 tools in this group

Trigger

Vercel AI SDK

Under 9 seconds

Send iMessage

Result

Reply back in Vercel AI SDK

iMessage

Hi Alex, following up on your demo request. Worth a quick chat this week?

Sent from your Vercel AI SDK workflow

Yeah, tomorrow works.

Key takeaways

  • The AI SDK's tool pattern maps cleanly onto a messaging action: a zod schema the model fills, an execute function that makes the call.
  • Post replies, delivery states, and opt-outs to webhooks via an app/api/imessage/route.ts handler.
  • The pattern that works in production is AI-drafted, human-sent or thread-scoped autonomy, not an unsupervised model with a send button.
  • $249 per line per month with unlimited iMessages (50 opted-in / 30 cold new contacts a day) and no per-message fees.

How a message falls back

How a message falls backEvery message is attempted as iMessage first, falls back to RCS if the number cannot receive iMessage, and falls back to SMS if it cannot receive RCS, so the message arrives either way.iMessageBlue bubble, read in minutesRCSIf the number is Android and RCS-...SMSIf neither, so it still arrives
Every message is attempted as iMessage first, falls back to RCS if the number cannot receive iMessage, and falls back to SMS if it cannot receive RCS, so the message arrives either way.

What does the tool definition look like?

The AI SDK's tool pattern maps cleanly onto a messaging action: a zod schema the model fills, an execute function that makes the call.

import { tool } from 'ai';
import { z } from 'zod';

export const sendIMessage = tool({
  description: 'Send an iMessage to a contact. Only for approved outreach.',
  parameters: z.object({
    to: z.string().describe('Contact phone in E.164 format'),
    message: z.string().describe('Message body, short and personal'),
  }),
  execute: async ({ to, message }) => {
    const res = await fetch(
      'https://api.bluereacher.com/v1/messages',
      {
        method: 'POST',
        headers: {
          Authorization: 'Bearer brk_live_your_key',
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({ to, message }),
      },
    );
    return res.json();
  },
});
  • Pass it in generateText or streamText calls so the model texts as part of multi-step runs. URL shape: https://api.bluereacher.com/v1/messages + brk_ key. Onboarding covers all endpoints.

How do replies come back into a Next.js app?

Post replies, delivery states, and opt-outs to webhooks via an app/api/imessage/route.ts handler. Parse the event, load the thread, and notify a human or invoke the model with conversation history.

  • The event stream keeps AI texting honest. Delivery states show whether sends rode iMessage or fell back to RCS or SMS automatically.
  • STOP opt-outs are platform-enforced before your handler sees events, so compliance never depends on your application code.

What should you actually build with it?

The pattern that works in production is AI-drafted, human-sent or thread-scoped autonomy, not an unsupervised model with a send button. Builds we see working:

  • A rep copilot: the model drafts the follow-up text from CRM context, the rep taps approve, the tool sends
  • A reply assistant: inbound webhook triggers streamText over the thread history, draft appears for one-tap send
  • A scheduling flow: the model negotiates times over an iMessage thread and writes the booking when the contact confirms
  • An ops alerter: your app texts the team's own lines on events that matter, same tool, internal recipients

Pricing for product builders

$249 per line per month with unlimited iMessages (50 opted-in / 30 cold new contacts a day) and no per-message fees. $199 per line at 4+, or $1,949 per line per year (about $162.50 a month).

  • No A2P registration required, removing carrier-approval delays. White-glove onboarding sets up lines, API keys, and webhook endpoints.
  • An MCP server is available if your stack prefers Model Context Protocol.

Frequently asked questions

Does this work with streamText and multi-step tool calls?

Yes. The send tool is a standard AI SDK tool, so it participates in multi-step runs like any other: the model can look up context with one tool, then send with another, and your maxSteps setting governs the loop. Nothing about messaging changes the SDK mechanics.

How do I receive replies in my app?

Configure Blue Reacher's webhooks to point at a route handler; each reply, delivery state, and opt-out arrives as an HTTP POST. From there it's your application logic: notify a human, invoke the model over the thread, or write to your database. On Vercel this runs serverless with zero extra infrastructure.

Should the model send without human review?

For first-contact outreach, no: draft-and-approve is the pattern that survives contact with production. Within an existing thread, scoped autonomy works well. Either way STOP suppression and iMessage availability checks are enforced by the platform, not by your prompt.

Is there an MCP option instead of writing the tool by hand?

Yes. Blue Reacher ships an MCP server exposing messaging as typed tools, useful where your stack already loads MCP servers. The hand-written tool() route shown above gives you tighter control over schema descriptions, which is often worth it for steering the model.

What does it cost?

$249/line/month, unlimited iMessages, no per-message metering. Lines pace 50 opted-in / 30 cold daily. $199/line at 4+, $1,949/year (~$162.50/month), $449 activation waived annually. No A2P registration.

Ship the texting feature this sprint

Book a demo with your use case in hand. We'll review the tool schema and webhook flow against your app on the call, and onboarding delivers the line and keys, usually inside a week.