Skip to content

Add remainingTraffic field to client traffic API #4035

Description

@Avishka-55

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

{
  "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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions