Gateway Mode
Gateway mode runs Ante as a long-lived bot reachable from Slack, Discord, or both at the same time. Each conversation — a channel thread or DM — gets its own isolated agent session, so multiple users and teams can talk to Ante in parallel without crossing state.
Basic usage
ante gateway
This reads ~/.ante/channels.json, connects to every platform you've enabled, and starts listening for messages.
Configuration
Create ~/.ante/channels.json. You can enable just Slack, just Discord, or both.
{
"slack": {
"enabled": true,
"bot_token": "env:SLACK_BOT_TOKEN",
"app_token": "env:SLACK_APP_TOKEN",
"allow_from": "open"
},
"discord": {
"enabled": true,
"bot_token": "env:DISCORD_BOT_TOKEN",
"allow_from": ["123456789012345678"]
}
}
Values beginning with env: are read from the environment at startup, so tokens stay out of the file.
Access control
The allow_from field decides who the bot will respond to:
| Value | Who can talk to the bot |
|---|---|
"open" | Anyone on the workspace / server |
["U123", "U456"] | Only the listed user IDs |
| (omitted) | Deny-all (safe default) |
Setting up Slack
- Create an app at api.slack.com/apps → From scratch.
- Settings → Socket Mode: enable it and create an App-Level Token with
connections:write. Copy thexapp-…token — this is yourapp_token. - Features → OAuth & Permissions → Bot Token Scopes: add
chat:write,app_mentions:read,channels:history,im:history,im:write. - Features → Event Subscriptions: enable events and subscribe to
message.channelsandmessage.im. - Features → App Home: enable the Messages Tab and allow users to send messages there.
- Settings → OAuth & Permissions → Install to Workspace. Copy the
xoxb-…Bot User OAuth Token — this is yourbot_token. - In each channel you want the bot in:
/invite @your-bot-name.
export SLACK_BOT_TOKEN="xoxb-..."
export SLACK_APP_TOKEN="xapp-..."
Using the bot in Slack: @mention it in a channel, or just DM it. Replies always come in a thread.
Anytime you change scopes or event subscriptions, you must Reinstall to Workspace for them to take effect.
Setting up Discord
- Create an application at discord.com/developers/applications → New Application.
- Bot: copy the token — this is your
bot_token. Under Privileged Gateway Intents, enable Message Content Intent (required). - OAuth2 → URL Generator: under Scopes check
bot; under Bot Permissions checkSend Messages,Read Message History,View Channels. Open the generated URL to invite the bot to your server.
export DISCORD_BOT_TOKEN="..."
Using the bot in Discord: @mention it in a server channel, or just DM it. The bot replies as a reference to your message — reply to the bot's message to continue the conversation.
Talking to the bot
Once the bot is in your workspace or server and the gateway is running, you chat with it like any other bot. A couple of replies have special meaning.
You can interrupt the bot at any time by sending:
| Command | Effect |
|---|---|
stop | Cancel the current task (like Ctrl+C in the TUI) |
When the bot asks permission to run a tool, reply with one of:
| Reply | Effect |
|---|---|
yes (or y) | Approve this tool call |
no (or n) | Skip this tool call |
always | Approve and allow this tool for the rest of the session |
See Approvals for more on tool approval flows.
CLI reference
ante gateway [--config PATH] [--model MODEL] [--provider PROVIDER] [--output-format FORMAT] [--offline-model PATH]
| Flag | Default | Description |
|---|---|---|
--config | ~/.ante/channels.json | Path to the channels config file |
--model | local | LLM model to use for every session |
--provider | local | Provider for the chosen model |
--output-format | minimal | Gateway stdout format: minimal, human, or json |
--offline-model | — | Path to a local GGUF file. Boots a shared llama-server before accepting messages and routes every conversation through it (forces --provider local --model local) |
The defaults assume a local llama-server. To use a hosted provider, pass --provider and --model explicitly (e.g. ante gateway --provider anthropic --model claude-sonnet-4-6).
Output formats
| Format | Shows |
|---|---|
minimal | Agent messages, info, and errors only |
human | All events with colored formatting (useful for debugging) |
json | All events as JSON lines (useful for piping to another tool) |
Troubleshooting
Slack: "Sending messages to this app has been turned off" Enable the Messages Tab under App Home and allow users to send messages from it, then Reinstall to Workspace.
Slack: bot doesn't respond to @mentions in a channel
Make sure the bot is invited to that channel (/invite @bot-name) and that message.channels is in your Event Subscriptions. Reinstall after changing events or scopes.
Discord: bot doesn't respond
Confirm Message Content Intent is enabled on the bot and that it has Send Messages and Read Message History permissions in the channel.
Gateway shows no output after a message
Run with --output-format human to see every event, and check ~/.ante/logs/ for error details.