Skip to main content

User & Subscription API

QuicProxy is released under the permissive MIT license — modify it freely, even keep your changes closed source. The core API provides user management, traffic accounting, and subscription distribution for free, for trojan / anytls / shadowquic inbounds.

Our promise

None of our projects will ever include ads that send your users to competing airports, VPNs, VPS services, or IP proxy sellers.

Authentication​

These endpoints are served by the core API (api config) and authenticate with an Authorization: <password> header. /sub is public and needs no API password.

User Management​

MethodPathDescription
GET/usersList every user with traffic usage
POST/usersAdd or update a user, body {"username":"alice","password":"secret"}
DELETE/users?username=aliceRemove a user and close its connections
GET/users/stats?username=alice&clear=trueFetch one user's usage; clear=true atomically reads and zeroes the counters (omit username for all users)

Users can be seeded through the top-level users list or an inbound's users. Runtime additions and traffic counters persist to the observe cache.

PASS="your-api-password"
BASE="http://127.0.0.1:<api-port>"

# Add a user
curl -X POST ${BASE}/users \
-H "Authorization: ${PASS}" \
-H "Content-Type: application/json" \
-d '{"username":"alice","password":"secret"}'

# Read and reset alice's traffic
curl "${BASE}/users/stats?username=alice&clear=true" -H "Authorization: ${PASS}"

Subscription Distribution​

Node links are generated dynamically by each inbound, so there is nothing to maintain by hand.

MethodPathAuthDescription
GET/sub?username=alice&password=secretNo API passwordReturns the user's sq / anytls / trojan nodes and reports used traffic in the subscription-userinfo header
GET/qr?text=<url>RequiredRenders text as a terminal QR code (half-block glyphs sized for an 80-column terminal)

Traffic and time are unlimited by default (total=0; expire=0), while consumption keeps being counted.

The subscription Config​

subscription supplies the public host and metadata embedded in node links:

"subscription": {
"host": "1.2.3.4", // public address in node links; string or array
"name": "MyNode", // optional node name prefix
"update_interval": 24, // optional profile-update-interval header (hours)
"web_page_url": "https://..." // optional profile-web-page-url header
}

host may also be an array to publish several addresses at once. IPv6 nodes come first, and each node name gets a -IPv4 / -IPv6 suffix:

"subscription": {
"host": ["2001:db8::1", "1.2.3.4"]
}