diff --git a/internal/web/controller/client.go b/internal/web/controller/client.go index a362d7f78..f52c42a40 100644 --- a/internal/web/controller/client.go +++ b/internal/web/controller/client.go @@ -118,7 +118,14 @@ func (a *ClientController) get(c *gin.Context) { return } rec.Flow = flow - jsonObj(c, gin.H{"client": rec, "inboundIds": inboundIds}, nil) + // Consumed bytes (up+down, including cross-node global overlay) so API + // consumers can pair usage with the client's totalGB quota (#4973). + // Best-effort: a traffic lookup failure must not break the client fetch. + var usedTraffic int64 + if t, tErr := a.inboundService.GetClientTrafficByEmail(email); tErr == nil && t != nil { + usedTraffic = t.Up + t.Down + } + jsonObj(c, gin.H{"client": rec, "inboundIds": inboundIds, "usedTraffic": usedTraffic}, nil) } func (a *ClientController) create(c *gin.Context) {