Skip to main content
The AgentFlow Bot Platform lets you build chat bots, mini-apps, and games for chat.agentflow.website without learning the Matrix Client-Server API. If you’ve used the Telegram Bot API or Discord bots, you’ll feel at home. The platform wraps the underlying Matrix protocol with friendly REST endpoints, webhook delivery, and helpers for widgets and games.

How it compares

TelegramAgentFlow
@BotFather → /newbotPOST /api/v1/bots
BOT:TOKENaf_bot_<hex>
api.telegram.org/bot.../sendMessagebots.agentflow.website/api/v1/sendMessage
setWebhook / getUpdatessame names, same shape
Mini AppsMatrix Widget API + our @agentflowx/miniapp SDK
Telegram Games/api/v1/games/*

Quick start (60 seconds)

# 1. Create a bot (you need an AgentFlow session cookie)
curl -X POST https://bots.agentflow.website/api/v1/bots \
  -H "Cookie: af_session=<your session>" \
  -H "Content-Type: application/json" \
  -d '{"slug":"my-first-bot","display_name":"My First Bot"}'

# → { "bot_token": "af_bot_...", "matrix_user_id": "@bot_my-first-bot:agentflow.website" }

# 2. Invite the bot to a Matrix room (Element → room settings → invite → paste the matrix_user_id)

# 3. Send a message
curl -X POST https://bots.agentflow.website/api/v1/sendMessage \
  -H "X-AgentFlow-Bot-Token: af_bot_..." \
  -H "Content-Type: application/json" \
  -d '{"room_id":"!abc:agentflow.website","text":"Hello from my bot 👋"}'

SDKs

Examples (open source on GitHub)

Where bots live

Bots run on the chat.agentflow.website Matrix homeserver. Each provisioned bot gets:
  • A reserved Matrix user id @bot_<slug>:agentflow.website
  • Its own access_token (managed by the platform, never exposed to you)
  • A bot token (af_bot_<hex>) for the REST API
  • Optional webhook URL for event delivery
You host the bot’s logic anywhere — Cloudflare Workers, Fly, Render, your laptop, k8s. We only need an HTTPS URL to push events to.

Next steps

Quickstart

Full step-by-step — bot replies in your Matrix room in 5 minutes.

API Reference

Every endpoint, every header, every error.

TypeScript SDK

npm install @agentflowx/bot-sdk — recommended starting point.

Build a game

Walk-through of game-coinflip — commit-reveal RNG, pro-rata payouts.