[GH-ISSUE #4035] Add remainingTraffic field to client traffic API #2735

Closed
opened 2026-10-31 20:27:34 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Avishka-55 on GitHub (Apr 18, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4035

The panel UI already calculates and displays the remaining traffic for each client (e.g. Remained 59.93 GB), but the API endpoint GET /panel/api/inbounds/getClientTraffics/:email does not return this value.

The only way to get remaining traffic via API right now is:

remaining = total - (up + down)

But this doesn't match what the panel shows because up/down accumulate as all-time traffic even after resets, making external calculations incorrect.

Describe the solution you'd like

Please add a remaining (or remainingTraffic) field to the response of:

  • GET /panel/api/inbounds/getClientTraffics/:email
  • GET /panel/api/inbounds/getClientTrafficsById/:id

Since the panel already computes this value internally and displays it in the UI, exposing it in the API response would be straightforward and extremely useful for developers building external tools/bots on top of 3x-ui.

Expected Response

{
  "up": 7959552,
  "down": 161734656,
  "total": 107374182400,
  "remaining": 64357523456,
  "enable": true
}

Thank you!###

Describe alternatives you've considered

No response

Checklist

  • This feature report is written entirely in English.
Originally created by @Avishka-55 on GitHub (Apr 18, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4035 ### Is your feature request related to a problem? The panel UI already calculates and displays the remaining traffic for each client (e.g. `Remained 59.93 GB`), but the API endpoint `GET /panel/api/inbounds/getClientTraffics/:email` does not return this value. The only way to get remaining traffic via API right now is: ``` remaining = total - (up + down) ``` But this doesn't match what the panel shows because `up`/`down` accumulate as all-time traffic even after resets, making external calculations incorrect. ### Describe the solution you'd like Please add a `remaining` (or `remainingTraffic`) field to the response of: - `GET /panel/api/inbounds/getClientTraffics/:email` - `GET /panel/api/inbounds/getClientTrafficsById/:id` Since the panel already computes this value internally and displays it in the UI, exposing it in the API response would be straightforward and extremely useful for developers building external tools/bots on top of 3x-ui. ### Expected Response ```json { "up": 7959552, "down": 161734656, "total": 107374182400, "remaining": 64357523456, "enable": true } ``` Thank you!### ### Describe alternatives you've considered _No response_ ### Checklist - [x] This feature report is written entirely in English.
bsakaguchi 2026-10-31 20:27:34 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#2735
No description provided.