3x-ui3x-ui

Subscription Balancers

Client-side balancers for the JSON subscription: each enabled balancer is emitted as one extra config document whose members are the proxy outbounds of the selected inbounds (routing.balancers + burstObservatory). Managed in Settings → Sub Balancers.

GET
/panel/api/sub-balancers

Authorization

headerAuthorizationBearer <token>

API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?array<>
curl -X GET "https://example.com/panel/api/sub-balancers"
{  "success": true,  "obj": [    {      "createdAt": 1710000000000,      "enabled": true,      "id": 1,      "inboundIds": [        1,        3      ],      "memberWeights": {},      "remark": "auto-fastest",      "sortOrder": 1,      "strategy": "random",      "updatedAt": 1710000000000    }  ]}
POST
/panel/api/sub-balancers

Authorization

headerAuthorizationBearer <token>

API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Request Body

application/x-www-form-urlencoded
  1. body
remark*string

Display label, used as the config remarks (required).

strategy?string

Balancer strategy: "leastLoad", "leastPing", "roundRobin" or "random". Default "random".

Default"random"
inboundIds*array<integer>

Repeated form keys selecting the member inbounds (required, at least one).

memberWeights?

leastLoad only: JSON object mapping inbound id to a static weight > 0, e.g. {"3":0.2}. Lower weight = picked more often; absent ids weigh 1. Rejected for other strategies; entries for unselected inbounds are dropped.

sortOrder?integer

1-based position in the subscription list. Default 1.

Default1
enabled?boolean

Whether the balancer is emitted. Default true on create; unchanged when omitted on update.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?

SubBalancer is one extra JSON-subscription config document whose members are the selected inbounds' proxy outbounds. SortOrder shares SubSortIndex semantics.

curl -X POST "https://example.com/panel/api/sub-balancers" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'remark=string&inboundIds=0'
{  "success": true,  "obj": {    "createdAt": 1710000000000,    "enabled": true,    "id": 1,    "inboundIds": [      1,      3    ],    "memberWeights": {},    "remark": "auto-fastest",    "sortOrder": 1,    "strategy": "random",    "updatedAt": 1710000000000  }}
POST
/panel/api/sub-balancers/{id}

Authorization

headerAuthorizationBearer <token>

API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Path Parameters

id*integer

Balancer id.

Request Body

application/x-www-form-urlencoded
  1. body
remark*string

Display label, used as the config remarks (required).

strategy?string

Balancer strategy: "leastLoad", "leastPing", "roundRobin" or "random". Default "random".

Default"random"
inboundIds*array<integer>

Repeated form keys selecting the member inbounds (required, at least one).

memberWeights?

leastLoad only: JSON object mapping inbound id to a static weight > 0, e.g. {"3":0.2}. Lower weight = picked more often; absent ids weigh 1. Rejected for other strategies; entries for unselected inbounds are dropped.

sortOrder?integer

1-based position in the subscription list. Default 1.

Default1
enabled?boolean

Whether the balancer is emitted. Default true on create; unchanged when omitted on update.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?

SubBalancer is one extra JSON-subscription config document whose members are the selected inbounds' proxy outbounds. SortOrder shares SubSortIndex semantics.

curl -X POST "https://example.com/panel/api/sub-balancers/0" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'remark=string&inboundIds=0'
{  "success": true,  "obj": {    "createdAt": 1710000000000,    "enabled": true,    "id": 1,    "inboundIds": [      1,      3    ],    "memberWeights": {},    "remark": "auto-fastest",    "sortOrder": 1,    "strategy": "random",    "updatedAt": 1710000000000  }}

Delete a balancer by id.

DELETE
/panel/api/sub-balancers/{id}

Authorization

headerAuthorizationBearer <token>

API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Path Parameters

id*integer

Balancer id.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?

SubBalancer is one extra JSON-subscription config document whose members are the selected inbounds' proxy outbounds. SortOrder shares SubSortIndex semantics.

curl -X DELETE "https://example.com/panel/api/sub-balancers/0"
{  "success": true,  "obj": {    "createdAt": 1710000000000,    "enabled": true,    "id": 1,    "inboundIds": [      1,      3    ],    "memberWeights": {},    "remark": "auto-fastest",    "sortOrder": 1,    "strategy": "random",    "updatedAt": 1710000000000  }}
POST
/panel/api/sub-balancers/{id}/del

Authorization

headerAuthorizationBearer <token>

API token from Settings → Security → API Token. Send as Authorization: Bearer <token>.

Path Parameters

id*integer

Balancer id.

Response Body

Successful response

application/json
  1. response
success?boolean
msg?string
obj?

SubBalancer is one extra JSON-subscription config document whose members are the selected inbounds' proxy outbounds. SortOrder shares SubSortIndex semantics.

curl -X POST "https://example.com/panel/api/sub-balancers/0/del"
{  "success": true,  "obj": {    "createdAt": 1710000000000,    "enabled": true,    "id": 1,    "inboundIds": [      1,      3    ],    "memberWeights": {},    "remark": "auto-fastest",    "sortOrder": 1,    "strategy": "random",    "updatedAt": 1710000000000  }}