Koto bots in
any language
The Bot API is plain HTTP + JSON. The Koto gateway handles the bot's E2E identity and decryption, while you write the logic in anything you like: Python, JavaScript, Go, Rust or Luna. Ready-made bot client libraries work too.
# Send a message — it's a single HTTP request
curl -X POST https://api.koto.run/sendMessage \
-H "Authorization: Bearer kbot_…" \
-H 'content-type: application/json' \
-d '{"chat_id":"KOTO-…","text":"Hello from Koto!"}'
# → { "ok": true, "result": { "message_id": "…" } }A bot in three steps
From token to a working bot — no SDK and no wrestling with cryptography.
Get a token
Open @BotKoto in the app, send /newbot and get a token kbot_….
Call the API
Send HTTP requests to {GATEWAY}/{method}. The token goes in an Authorization: Bearer header. Any language, no SDK.
Receive updates
Poll getUpdates (long-poll) or set up a webhook — the bot reacts to messages.
What the Bot API can do
Messages and media
Text, photos, documents and polls. The full conversation lifecycle.
Inline buttons
Keyboards beneath a message and tap handling via callback_query.
Mini apps
A web page inside the chat with a side launch button and the KotoWebApp bridge.
Webhooks and long-poll
Receive updates via webhook in real time or poll getUpdates.
Command menu
A public list of "/" commands via setMyCommands.
Edits and reactions
Editing, deleting, pinning, reactions and forwarding of messages.
No SDK — just HTTP
A bot is code that makes HTTP requests. Anything works: Python, JavaScript, Go, Rust, bash or Luna. The gateway handles end-to-end encryption and the bot's identity — you never touch cryptography.
import requests
API = "https://api.koto.run"
HEADERS = {"Authorization": "Bearer kbot_…"}
# long-poll and echo back
r = requests.get(f"{API}/getUpdates", headers=HEADERS, params={"timeout": 20}).json()
for u in r["result"]:
m = u.get("message")
if m and m.get("text"):
requests.post(f"{API}/sendMessage", headers=HEADERS, json={
"chat_id": m["chat"]["id"],
"text": "Echo: " + m["text"],
})Koto API methods
Calls go to {GATEWAY}/{method}, the token rides in an Authorization header, and the response is a JSON envelope { ok, result }. Below are a few core methods; the full reference is in the docs.
Build your first bot in minutes
Open @BotKoto, get a token and send your first message through the API.