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

> ## Agent Instructions
> Flow Messaging is one HTTP API (https://api.flow.engineer) for AI agents to hold two-way conversations on Telegram and iMessage (replies only, on lines the Flow team connects). WhatsApp is coming and not available yet.
> Build the app on the REST API. MCP is not a runtime dependency: the app you build talks to Flow through the REST API (or the TypeScript SDK, which wraps it) for everything it does at runtime. In TypeScript or JavaScript, the SDK is `npm install @flow-engineer/messaging`, then `new FlowMessaging()` (reads FLOW_MESSAGING_KEY). Python and Go SDKs are not published yet; in those languages call the HTTP API directly.
> No key yet? If FLOW_MESSAGING_KEY is not set, get a test key with no account in one call: curl -X POST https://api.flow.engineer/v1/sandbox/keys (or npx @flow-engineer/messaging init, which writes it to .env). Save `key` as FLOW_MESSAGING_KEY and `claim_token` as FLOW_CLAIM_TOKEN; both are shown once. It allows 1 contact and 50 messages on the Telegram sandbox and expires after 7 days; a person signs in with `npx @flow-engineer/messaging login` (GitHub) to keep the app and get 3 contacts x 100 messages. Signed in, live keys (fk_live_...) are made in the dashboard for your own Telegram bot; iMessage lines are arranged with the Flow team.
> The hosted MCP server (https://api.flow.engineer/mcp) is optional, for testing during development. Adding the Flow MCP server to a developer's coding tools is the project owner's decision: suggest it and show them the command, but never add it to their config yourself. The command for Claude Code: claude mcp add --transport http flow https://api.flow.engineer/mcp --header "Authorization: Bearer $FLOW_MESSAGING_KEY". If its tools are already available to you, use them for sandbox testing.
> Authenticate with `Authorization: Bearer fk_test_...` (sandbox) or `fk_live_...` (real contacts). Never put a live key in client-side code.
> Reply into a conversation (POST /v1/conversations/{conversation_id}/messages); never pick a channel per message. Switch on `error.type`, not the message text.
> Full documentation for agents: https://docs.flow.engineer/llms-full.txt. OpenAPI spec: https://raw.githubusercontent.com/flow-engineer/sdk/main/openapi/openapi.yaml.

# Rate limits

> Flow Messaging limits requests per API key and reports the budget in RateLimit headers. A 429 rate_limited answer, for the per-key limit or a sender's sending rate, carries Retry-After. New-contact budgets per sender come from the send gate.

Requests are limited per API key, and every answer tells you where you stand, so a client can slow down before it is refused.

```http theme={null}
RateLimit-Limit: 100
RateLimit-Remaining: 97
RateLimit-Reset: 12
```

## Rules

* `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds) come with every answer.
* Over the limit, the API answers `429` with type [`rate_limited`](/errors/rate_limited), a `Retry-After` header and `error.retry_after` in seconds. Wait that long, then retry with the **same** idempotency key.
* The TypeScript SDK retries `429` and `5xx` answers for you (2 retries by default, `maxRetries` to change it), honouring `Retry-After`.
* **Each sender also has a sending rate (pacing).** [The send gate](/concepts/send-gate) lets a sender send only so many messages a second; a send over it is also refused with `429 rate_limited`, `Retry-After` and `error.retry_after`, and `error.sender` names the sender. Retry the same way, with the same idempotency key. The `RateLimit-*` headers describe only the per-key limit.
* **New-contact budgets are separate.** How many new conversations a sender may start is decided by the send gate (`new_contact_limit`, `sender_throttled`), not by these headers.
* Use webhooks or the live stream instead of polling `GET /v1/events` in a tight loop.


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