Documentation

External Access

v1.1.11 2026-11

Use External Access to let Telegram, Discord, DingTalk, or Feishu bots call the local agent, or to call the gateway HTTP API from this machine or the LAN. See HTTP API.

A bot chat must be paired first. Unpaired sources cannot send tasks.

Expand More in the main menu and choose External.

Table of Contents


Supported Platforms

PlatformCredentials RequiredPairing Method
TelegramBot Token/start <pairing_code>
DiscordBot Token/start <pairing_code>
DingTalkClient ID + Client Secret/start <pairing_code>
FeishuApp ID + App Secret/start <pairing_code>

Quick Start

Step 1: Configure Platform Credentials

  1. Create a bot on the target platform (e.g., Telegram) and obtain the Bot Token.
  2. Open the External Access page and select the corresponding platform in "Chat Bot."
  3. Enter the credentials (Bot Token or App ID + App Secret).
  4. Click Save Settings.

Step 2: Start the Service

Click Start Connection and wait for the status to show Connected. If the connection fails, check the platform credentials and network.

Step 3: Pair a Device

After starting, the page displays a pairing command in the format:

/start <pairing_code>

Send the above command to the bot on the target platform to complete pairing. After pairing, that chat/channel/session can interact with the agent.

Step 4: Start Chatting

After successful pairing, send messages directly on the platform to trigger agent responses. Responses follow the roles, models, and tool strategies configured in your Agent Workbench.


Platform Configuration

Telegram

ItemDescription
Bot TokenToken obtained from @BotFather

Discord

ItemDescription
Bot TokenToken obtained from the Discord Developer Portal

DingTalk

ItemDescription
Client ID / RobotCodeDingTalk enterprise internal robot Client ID
Client SecretDingTalk enterprise internal robot Client Secret

Note: DingTalk credentials (Client ID and Client Secret) must be filled in as a pair. An error is shown if only one is provided.

Feishu

ItemDescription
App IDFeishu enterprise self-built robot App ID
App SecretFeishu enterprise self-built robot App Secret

Note: Feishu credentials (App ID and App Secret) must be filled in as a pair. An error is shown if only one is provided.


Pairing & Security

Pairing Process

  1. After you start the service on the External Access page, the system automatically generates a pairing code.
  2. The page displays the pairing command /start <pairing_code>. Click the Copy button to copy it.
  3. Send /start <pairing_code> to the bot on the target platform.
  4. On successful pairing, the bot replies with a confirmation message.
  5. That chat/channel/session is added to the allowlist, and messages can be sent directly afterward.

Security Mechanism: Only successfully paired sources can send messages to the agent. Messages from unpaired sources are ignored.


Control Commands

After pairing, you can send commands starting with / to the bot to control behavior. Commands are divided into Public Commands and Admin Commands.

Parameter format: <required> [optional]

Public Commands

The following commands require no admin privileges:

CommandDescription
/helpShow help for all available commands
/statusDisplay current session status (role, model, tool configuration, etc.)
/stopStop the currently generating response
/listList all sub-sessions under the current control source
/list_rolesList all roles and their model configurations
/list_modelsList available local and online models
/list_tools [role]List tool groups and their enabled status, optionally for a specific role

Admin Commands

Enter admin mode with /admin <password> to execute:

Session Management:

CommandDescription
/new [name]Create a new sub-session and switch to it
/change <id|name>Switch to the specified sub-session
/rename <name>Rename the current session
/delete <name>Delete the specified sub-session
/clearClear the current session context

Parameter Configuration:

CommandDescription
/model <id|Provider/Model> [role]Set a model for a role
/system [role] <text>Set the system prompt for a role
/temperature <value> [role]Set the temperature parameter
/max_tokens <value> [role]Set the maximum output token count
/thinking <on|off> [role]Enable/disable thinking mode
/role_timeout <seconds> [role]Set inference timeout
/tools_rounds <value> [role]Set the maximum number of tool call rounds

Tool Control:

CommandDescription
/switch_tools <on|off> [role]Enable/disable tool calling
/auto_tools <on|off> [role]Enable/disable automatic tool selection
/tools <id|all> <on|off> [role]Enable/disable tools by group
/allow_risky_tools <on|off>Toggle high-risk tool policy

Workspace & Execution:

CommandDescription
/dir <relative_path>Set the workspace subdirectory
/yolo <on|off>Enable/disable auto approval
/switch_role <summary|memory|security|evaluate> <on|off>Toggle built-in roles
/approveApprove the currently pending operation
/rejectReject the currently pending operation

Admin Authentication

Enter the administrator password again after restarting the connection service.

CommandDescription
/admin <password>Enter admin password to enter admin mode
/admin exitExit admin mode

Initial Setup: If no admin password has been configured, the system automatically generates an invisible password on first startup. You can modify it in "More Settings."


Session Management (Admin)

Sub-session Mechanism

Each external platform source (chat/channel/session) can manage multiple sub-sessions:

  • Default session: Automatically created after pairing; send and receive messages directly.
  • Sub-sessions: Created via /new; can be independently configured and switched.
  • /list lists all sub-sessions; switch by ID.

Lazy Start

A sub-session created with /new stores its configuration first (role, model, tools, and so on). The agent session is created when the first body message is sent. You can run /model, /system, and similar commands before that message.

Model Setting

  • /model <id> picks a model from the local model list.
  • /model <Provider/Model> uses an online model, for example deepseek/deepseek-chat.
  • The optional [role] argument selects a role. If you omit it, the command applies to the primary role.

Note: The memory role must use a local model. Online and LAN backends are not supported for it.


Advanced Settings

The "More Settings" panel contains:

ParameterDefaultDescription
Listen Address0.0.0.0Address the gateway binds to
Local Port18092Gateway port, from 1024 to 65535
Reply Wait (seconds)600How long to wait for the agent to respond
Startup Timeout (seconds)60How long to wait for the gateway health check
Admin PasswordGeneratedUsed by the /admin command

For this computer only, set the listen address to 127.0.0.1. Set 0.0.0.0 only when LAN devices must connect. Do not publish that port on the public internet. Bot requests still require pairing. Admin commands still require the admin password.


HTTP API

  1. Open External Access.
  2. Create an Access Key and start the gateway using the connection instructions on that page. HTTPS is optional.
  3. Call the HTTP API with the curl, Python, or Node example on that page.

127.0.0.1 accepts only this computer. 0.0.0.0 opens the LAN. Do not publish that port on the public internet. There is no separate command-line installer.


Notes

Service Dependency

  • Keep the ModxAI service running while using a bot.
  • Stopping the ModxAI service also stops the bot connection.
  • Every enabled platform needs valid credentials, or startup fails.

Credential Safety

  • After you save a token or secret, the input is cleared. The page does not keep the plaintext.
  • The page shows a mask such as ****abc123, not the full credential.
  • To replace a credential, type the new value and save.

Tool Policy

  • The high-risk tool policy for channel sessions follows the Studio setting.
  • /allow_risky_tools applies to every sub-session under the current control source.
  • Tools blocked by the high-risk tool policy are unavailable.

Connection Status

  • The top of the page shows whether the service is connected or stopped.
  • Refresh reloads gateway status and configuration.
  • Reset restores the form to the last saved configuration.

One Platform at a Time

Only one bot platform can be enabled. To switch, select the new platform, save, and start the connection again.