explaingit

izzzzzi/py3xui

Analysis updated 2026-08-08 · repo last pushed 2025-05-22

1PythonAudience · developerComplexity · 2/5StaleSetup · moderate

TLDR

A Python library that lets your code control a 3x-ui proxy/VPN panel, automating tasks like adding users, setting traffic limits, and generating QR codes instead of using the web interface.

Mindmap

mindmap
  root((repo))
    What it does
      Controls 3x-ui servers
      Adds and manages users
      Generates QR codes
    How it works
      Sync and async modes
      Login with credentials
      Returns Python objects
    Use cases
      Telegram VPN bots
      Traffic quota management
      Auto provision accounts
    Requirements
      Python
      3x-ui version 2.3.7 plus
      Server address and login
    Limitations
      Not affiliated with 3x-ui
      Breaking changes possible
      Not production guaranteed

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a Telegram bot that automatically creates a proxy account when a user subscribes and sends them a QR code to connect.

USE CASE 2

Set and update traffic data caps for users when they renew their VPN subscription.

USE CASE 3

List existing connection setups on a 3x-ui server and find users by email to manage their accounts programmatically.

What is it built with?

Pythonasyncio3x-ui

How does it compare?

izzzzzi/py3xui0xallam/posthog0xustaz/streamgate
Stars111
LanguagePythonPythonPython
Last pushed2025-05-222026-03-26
MaintenanceStaleMaintained
Setup difficultymoderatemoderatehard
Complexity2/53/54/5
Audiencedeveloperpm founderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a running 3x-ui server (version 2.3.7 or newer) with login credentials accessible from your Python environment.

The explanation does not mention a license, so the terms of use are unknown.

In plain English

py3xui is a Python toolkit that lets you programmatically control a 3x-ui server. 3x-ui is a popular panel for managing proxy connections, the kind of thing you might use to run a personal VPN or proxy service. Instead of clicking around a web interface to add users, set traffic limits, or configure connection rules, this library lets your Python code do it automatically. You could use it to build a bot that provisions new proxy accounts for users, manage traffic quotas, or generate connection strings and QR codes that users scan to connect. The library gives you two ways to talk to a 3x-ui server: a standard synchronous mode and an asynchronous mode. Both expose the same capabilities, so you pick whichever fits your project. You create a connection object with your server address and credentials, call a login step, and then you can start doing things like listing existing connection setups (called "inbounds"), adding new ones, finding users by email, updating their traffic limits, or creating new client accounts. The data comes back as structured Python objects rather than raw JSON, which makes it easier to work with. Someone running a proxy or VPN service would find this useful. For example, if you run a Telegram bot where users pay for VPN access, you could use this library to automatically create a new client when someone subscribes, set their data cap to 100 GB, generate a QR code they can scan to connect, and update their limits when they renew. Without a library like this, you'd be writing raw HTTP requests and parsing JSON responses yourself. One practical note: the 3x-ui app itself is still under active development, and the library author isn't affiliated with that project, so compatibility isn't guaranteed with every version. The SDK requires 3x-ui version 2.3.7 or newer. The README doesn't go into detail about what happens when newer versions of 3x-ui introduce breaking changes, so if you're building something production-critical, that's worth keeping in mind.

Copy-paste prompts

Prompt 1
I have a 3x-ui server running. Write a Python script using py3xui that logs in, creates a new client with a 100GB traffic limit, and prints out a QR code connection string the user can scan.
Prompt 2
Using py3xui, help me list all inbounds on my 3x-ui server and find a specific client by their email address, then update their traffic limit to 200GB.
Prompt 3
Create an async Python function using py3xui that provisions a new proxy client when called, sets a data cap, and returns the connection string for a Telegram bot to send to the user.

Frequently asked questions

What is py3xui?

A Python library that lets your code control a 3x-ui proxy/VPN panel, automating tasks like adding users, setting traffic limits, and generating QR codes instead of using the web interface.

What language is py3xui written in?

Mainly Python. The stack also includes Python, asyncio, 3x-ui.

Is py3xui actively maintained?

Stale — no commits in 1-2 years (last push 2025-05-22).

What license does py3xui use?

The explanation does not mention a license, so the terms of use are unknown.

How hard is py3xui to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is py3xui for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.