Skip to content

OneBot V11 Protocol Configuration

Complete configuration guide for OneBot V11 protocol.

Configuration Location

Can be set in general as default values, or configured individually at account level:

yaml
# Global default configuration
general:
  onebot.v11:
    use_http: true
    use_ws: false

# Account level configuration (overrides general)
{platform}.{account_id}:
  onebot.v11:
    use_http: true
    use_ws: true

Configuration Fields

FieldTypeRequiredDescriptionDefault
use_httpbooleanNoWhether to enable HTTP APItrue
use_wsbooleanNoWhether to enable forward WebSocketfalse
use_ws_reversebooleanNoWhether to enable reverse WebSocketfalse
access_tokenstringNoAPI access token for authentication-
secretstringNoSHA1 signature key for reported data-
post_timeoutnumberNoHTTP POST request timeout (milliseconds)5000
post_message_formatstringNoMessage report format: string (CQ code) or array (message segment array)string
enable_heartbeatbooleanNoWhether to enable heartbeattrue
heartbeat_intervalnumberNoHeartbeat interval (milliseconds)15000
enable_corsbooleanNoWhether to allow CORStrue
ws_reverse_urlstringNoReverse WebSocket connection URL-
ws_reverse_api_urlstringNoReverse WebSocket API connection URL (optional)-
ws_reverse_event_urlstringNoReverse WebSocket event connection URL (optional)-
ws_reverse_reconnect_intervalnumberNoReverse WebSocket reconnection interval (milliseconds)3000
http_reversestring[]NoHTTP Webhook report URL list[]
ws_reversestring[]NoReverse WebSocket connection URL list[]

Communication Methods

HTTP API

When HTTP API is enabled, provides HTTP POST interface for API calls.

Access URL: http://localhost:6727/{platform}/{account_id}/onebot/v11/{action}

Configuration Example:

yaml
onebot.v11:
  use_http: true
  access_token: 'your_token'  # Optional, API authentication
  post_timeout: 5000          # Request timeout (milliseconds)

Forward WebSocket

Client actively connects to onebots to receive events in real-time.

Access URL: ws://localhost:6727/{platform}/{account_id}/onebot/v11