A 100% compatible drop-in fork of Marzban and Marzdar featuring a completed UI plus native reseller quotas, user limits, overselling controls, and inbound restrictions.
English / فارسی / 简体中文 / Русский
Marzyar is the reseller-ready evolution of Marzdar and Marzban.
While Marzdar focuses on completing the missing user interface elements of upstream Marzban, Marzyar integrates native reseller management capabilities directly into the core engine while guaranteeing zero database schema disruption and 100% bidirectional migration safety:
- User Account Limits: Cap the number of user accounts a reseller admin can create.
- Bandwidth Quotas & Oversell Controls:
- Unified Consumed Limit: In all modes, total consumed bandwidth (
∑ active_usage + historical_resets_and_deletions) can never exceed the admin'straffic_limit. - Strict Mode (No Oversell): Additionally limits the sum of allocated user data limits (
∑ user.data_limit ≤ traffic_limit). Resellers cannot over-allocate or create accounts with unlimited bandwidth. - Oversell Mode: Removes the allocation limit. Resellers can allocate user plans freely until actual traffic consumed reaches the quota limit.
- Non-bypassable Accounting: Reseller admins cannot reset or delete users to escape their quota; past usage is securely accumulated into the reseller's historical consumption counter.
- Unified Consumed Limit: In all modes, total consumed bandwidth (
- The "Locked" State Machine:
- When an admin exhausts their quota, their active users are non-destructively marked as
lockedand detached from Xray inbounds (traffic blocked immediately). - Core
userstable records remain untouched. - When Sudo resets or increases the reseller's quota, all locked users are automatically unlocked and restored to Xray in real-time.
- When an admin exhausts their quota, their active users are non-destructively marked as
- Allowed Inbounds: Restrict each reseller to specific protocols and inbounds (e.g., VMess TCP only).
- Dashboard Header Reseller Widget: Compact live indicators displaying remaining slots and quota for logged-in reseller admins.
| Feature | Marzban (Upstream) | Marzdar | Marzyar |
|---|---|---|---|
| Compatibility | Upstream | 100% Drop-in | 100% Drop-in (Zero DB alterations) |
| Complete Web UI | ❌ (CLI/API only for many features) | ✅ Complete | ✅ Complete |
| Reseller User Limits | ❌ None | ❌ None | ✅ Native & UI-managed |
| Bandwidth Quota & Oversell | ❌ None | ❌ None | ✅ Native & Non-bypassable |
| Auto-Lock on Over-Quota | ❌ None | ❌ None | ✅ Real-time Xray detach/restore |
| Allowed Inbounds Filtering | ❌ None | ❌ None | ✅ Admin-level restriction |
| Bidirectional Rollback | Baseline | ✅ Safe | ✅ 100% Safe (No custom Alembic revisions) |
Simply update the image in docker-compose.yml:
services:
marzban:
image: mehrwizard/marzyar:latestThen restart:
marzban updateIn addition to standard upstream Marzban APIs, Marzyar provides dedicated REST endpoints under the /api/marzyar prefix for managing reseller quotas, user slot limits, overselling modes, allowed inbounds, and locked users.
Interactive Swagger/OpenAPI documentation is also available directly at /docs (when enabled via DOCS=true).
All Marzyar endpoints require standard Marzban OAuth2 Bearer authentication. Include the access token in the Authorization HTTP header:
Authorization: Bearer <your_access_token>To obtain an access token:
curl -X POST "https://your-panel-domain:8000/api/admin/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin&password=yourpassword"| Method | Endpoint | Permission | Description |
|---|---|---|---|
GET |
/api/marzyar/admins |
Sudo Only | List settings, limits, quota usage, and lock counts for all admins |
GET |
/api/marzyar/admin/{admin_identifier}/settings |
Sudo Only | Retrieve Marzyar settings and real-time usage for a specific admin |
PUT |
/api/marzyar/admin/{admin_identifier}/settings |
Sudo Only | Modify reseller limits, traffic quota, oversell flag, and allowed inbounds |
POST |
/api/marzyar/admin/{admin_identifier}/reset_quota |
Sudo Only | Reset an admin's accumulated consumed quota counter and unlock their users |
GET |
/api/marzyar/my_limits |
All Admins | Retrieve the currently logged-in admin's own limits and quota status |
GET |
/api/marzyar/locked_users |
All Admins | List currently locked users with lock reasons and timestamps |
- Endpoint:
GET /api/marzyar/admins - Permission: Sudo Admin only (
403 Forbiddenif non-sudo). - Description: Returns an array containing the configuration, real-time user counts, allocated bandwidth, cumulative consumed bandwidth, and lock states for every admin.
curl -X GET "https://your-panel-domain:8000/api/marzyar/admins" \
-H "Authorization: Bearer <token>"[
{
"admin_id": 2,
"username": "reseller1",
"is_sudo": false,
"users_limit": 50,
"traffic_limit": 107374182400,
"oversell_allowed": false,
"allowed_inbounds": ["VLESS TCP REALITY", "VMess TCP"],
"quota_used_traffic": 15000000000,
"current_users_count": 12,
"current_allocated_traffic": 64424509440,
"current_consumed_traffic": 21474836480,
"is_quota_exceeded": false,
"is_user_limit_exceeded": false,
"is_allocation_limit_reached": false,
"locked_users_count": 0
}
]- Endpoint:
GET /api/marzyar/admin/{admin_identifier}/settings - Permission: Sudo Admin only.
- Path Parameters:
admin_identifier(integer or string): Admin numeric ID (e.g.2) or username (e.g.reseller1).
- Response:
200 OKwith singleMarzyarAdminSettingsResponseobject;404 Not Foundif admin does not exist.
curl -X GET "https://your-panel-domain:8000/api/marzyar/admin/reseller1/settings" \
-H "Authorization: Bearer <token>"- Endpoint:
PUT /api/marzyar/admin/{admin_identifier}/settings - Permission: Sudo Admin only.
- Path Parameters:
admin_identifier: Admin numeric ID or username.
- Request Body (
application/json):Field Type Required Description users_limitinteger | null No Max number of user accounts allowed ( nullfor unlimited).traffic_limitinteger | null No Traffic quota in bytes ( nullfor unlimited). Example:107374182400for 100 GB.oversell_allowedboolean No false= Strict mode (sum of allocated limits capped bytraffic_limit);true= Oversell mode (only actual consumed traffic capped).allowed_inboundsarray of strings | null No Array of allowed inbound tags ( nullfor all inbounds). Existing users are automatically restricted to this list.
Note: Updating settings immediately re-audits quotas and allowed inbounds: if limits were raised, locked users are automatically unlocked in real-time; if inbounds were modified, users are re-synced in Xray immediately.
curl -X PUT "https://your-panel-domain:8000/api/marzyar/admin/reseller1/settings" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"users_limit": 100,
"traffic_limit": 214748364800,
"oversell_allowed": true,
"allowed_inbounds": ["VLESS TCP REALITY"]
}'Returns the updated MarzyarAdminSettingsResponse.
- Endpoint:
POST /api/marzyar/admin/{admin_identifier}/reset_quota - Permission: Sudo Admin only.
- Description: Resets the reseller admin's accumulated consumption counter to zero and automatically unlocks and restores all of their locked users in Xray in real-time.
curl -X POST "https://your-panel-domain:8000/api/marzyar/admin/reseller1/reset_quota" \
-H "Authorization: Bearer <token>"Returns the updated MarzyarAdminSettingsResponse with current_consumed_traffic reset and locked_users_count: 0.
- Endpoint:
GET /api/marzyar/my_limits - Permission: Any authenticated admin (Sudo or Reseller).
- Description: Returns the calling admin's own user slot limits, quota consumption, allocated traffic, oversell setting, allowed inbounds, and whether any limits have been reached. Ideal for reseller client apps and bots.
curl -X GET "https://your-panel-domain:8000/api/marzyar/my_limits" \
-H "Authorization: Bearer <token>"{
"username": "reseller1",
"is_sudo": false,
"users_limit": 50,
"traffic_limit": 107374182400,
"oversell_allowed": false,
"allowed_inbounds": ["VLESS TCP REALITY"],
"current_users_count": 12,
"current_allocated_traffic": 64424509440,
"current_consumed_traffic": 21474836480,
"is_quota_exceeded": false,
"is_user_limit_exceeded": false,
"is_allocation_limit_reached": false,
"locked_users_count": 0
}- Endpoint:
GET /api/marzyar/locked_users - Permission: Any authenticated admin.
- Sudo Admin: Views all locked users across all reseller accounts.
- Reseller Admin: Views only locked users created by their own account.
- Description: Lists all user accounts temporarily locked and detached from Xray due to admin quota exhaustion, along with lock timestamps and reasons.
curl -X GET "https://your-panel-domain:8000/api/marzyar/locked_users" \
-H "Authorization: Bearer <token>"[
{
"user_id": 42,
"username": "client_alice",
"admin_username": "reseller1",
"locked_at": "2026-10-20T14:30:00",
"lock_reason": "Admin quota exceeded"
}
]If you find Marzyar useful, you can support its ongoing development:
Marzyar is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).