Skip to main content
AlpacaRelay has two developer interfaces, and they do different amounts:

REST API

POST /api/v1/emails does one thing: generate a complete, ready-to-send email from a prompt. Call it from your own code. The result streams over Server-Sent Events.

MCP server

46 tools for Claude, ChatGPT, Cursor, VS Code, Codex, and other MCP clients. Generate and edit emails, manage contacts and segments, read analytics, and build campaigns.
Generation is the same in both: same engine as the app, same credits, same output. Everything beyond generation is MCP-only. Both use the same workspace, so they also share one set of rules. Essentials (Authentication, Credits and limits, and Errors) applies to both. The REST API and MCP sections only cover what differs.

What it is not

Here’s the scope up front, so you don’t go looking for endpoints that aren’t there:
Neither interface sends a campaign. Over MCP an assistant can build a campaign up to the point of sending, but sending is done in the app. The REST API generates emails and nothing else. It has no endpoints for contacts, campaigns, or analytics.
To send what you generate, export the design to your ESP or send a campaign from AlpacaRelay.

Base URL and reference

The interactive reference is generated from the OpenAPI spec, so it’s always in step with the running API. Use it to read exact schemas and try calls; use these pages for the surrounding explanation.

Generate a client

The spec is OpenAPI 3.1 and served publicly, so you can generate a typed client rather than hand-rolling one:
A generated client will model the request correctly, but most generators treat the response as a plain string, because it’s an SSE stream rather than a JSON body. You’ll still want to parse the event stream yourself — see Generate an email for a worked example.

Get started

1

Get credentials

For REST, create an API key under Settings → API keys (workspace owners only). For MCP, you can sign in with OAuth instead. See Authentication.
2

Make your first call

3

Know the limits

One credit per generation, 60 calls a minute, three concurrent generations per workspace. See Credits and limits.