Visitar URL original
enh: analytics · Issue #21675 · open-webui/open-webui · GitHub
Skip to content

enh: analytics #21675

Open
Open

Description

@tjbck
No description provided.

Activity

  1. pinned this issue on Feb 23, 2026
  2. KevinRossiTC commented on Feb 27, 2026

    @KevinRossiTC

    I would love this also. Perhaps with a dropdown for Both / UI / API.

  3. godlobster6 commented on Mar 8, 2026

    @godlobster6

    Great direction. To make this actionable and contributor-friendly, I suggest locking a minimal v1 scope:

    • Metrics: request count (UI/API split), tokens in/out/total, error rate, p95 latency
    • Filters: 24h / 7d / 30d + per-model breakdown
    • Event schema: timestamp, source(ui|api), model, tokens_in, tokens_out, latency_ms, status
    • UX: Both/UI/API toggle + sortable per-model table

    Suggested rollout:

    1. event schema + ingestion
    2. aggregation endpoint
    3. dashboard cards/charts
    4. docs/migration notes

    If maintainers agree, I can draft a concrete PR plan (API contract + test cases + docs checklist) so contributors can pick this up with less ambiguity.

  4. zaakiy commented on Mar 9, 2026

    @zaakiy

    ...minimal v1 scope...

    Not a maintainer but I'm happy with this.

    Would like to stress the urgency because we don't know which users are causing the most usage ($$$).

  5. zaakiy commented on Mar 11, 2026

    @zaakiy

    Correction: Would like to stress the urgency because we don't know which users API consumers are causing the most usage ($$$).

  6. Classic298 commented on Mar 11, 2026

    @Classic298
    SponsorMember

    If you have the urgency, you can add a filter to track their usage for now.

  7. zaakiy commented on Mar 11, 2026

    @zaakiy

    If you have the urgency, you can add a filter to track their usage for now.

    I don't see a way to do this @Classic298. Could you please elaborate?

    Image

    I've already put the API user into a group

    Image

    And I can confirm that the API user is definitely within this group even though no users are showing up in the Analytics view for this group

  8. Classic298 commented on Mar 11, 2026

    @Classic298
    SponsorMember
  9. zaakiy commented on Mar 15, 2026

    @zaakiy

    That's too complex for me. Is it really that difficult to add API usage in the analytics dashboard?

    In my opinion, this would have been the obvious thing to do in the first place.

  10. Classic298 commented on Mar 15, 2026

    @Classic298
    SponsorMember

    @zaakiy

    If it's too complex for you, ask AI to do it. Give it the docs and tell it you want to track all requests in the inlet() filter.
    (API-only requests don't reach the outlet(), so can only track the request itself)

    And yes, it is not trivial.

  11. SFL79 commented on Mar 23, 2026

    @SFL79

    Been following this issue for a while as it's an extremely important enterprise feature.
    @tjbck Is this something the maintainers are planning to do in your roadmap?

    Or, perhaps following @godlobster6 's suggestion, is there any agreed upon, pending plan for implementation, or are you looking for the community to go ahead and implement it how they see fit?

  12. zaakiy commented on Mar 24, 2026

    @zaakiy

    @Classic298 I honestly would not know where to begin how to ask AI this

  13. zaakiy commented on Mar 24, 2026

    @zaakiy

    @Classic298 I don't see how you giving me the same link that you did before is going to be of any benefit.

    I'm not coming here as a contributor. Just because I'm on github following this issue doesn't mean I have infinite time or infinite AI credits to work on something

  14. 81 remaining items

  15. TGtongga commented on Aug 18, 2026

    @TGtongga

    @leon-fans it's already released and live. I was talking about the ability to run outlet() methods of a filter on all requests including api requests and that is already a thing now.

    I am also running the latest open-webui docker image and token usage statistics for API Requests do not seem to be appearing. Can you please check for this issue? Thank you very much!

  16. leon-fans commented on Aug 21, 2026

    @leon-fans

    Is there any update regarding this isusse?

  17. Classic298 commented on Aug 21, 2026

    @Classic298
    SponsorMember

    I specifically said what i said: "the ability to run outlet() methods of a filter on all requests including api requests and that is already a thing now."

    not that the analytics page measures api calls

  18. Classic298 commented on Aug 21, 2026

    @Classic298
    SponsorMember

    Specifically, tim, above, even wrote that this needs to be targeted in the future

  19. xyonium commented on Aug 21, 2026

    @xyonium
    Contributor

    Now the API have passthrough mode, when using this mode e.g. in /messages out /messages under anthropic protocol, API quota function is now completely impossible to implemented right?

  20. xyonium commented on Aug 22, 2026

    @xyonium
    Contributor

    Hi all — I've been following this thread and built something that covers most of what's being asked for here, so sharing in case it helps anyone who needs this now rather than waiting on the core roadmap. It's a pair of plugin Functions (no fork, no db migration, paste-into-Admin-Panel-and-enable): Quota Keeper.

    To @Classic298's repeated (and correct) point that "a Filter can do this in a dozen lines" — yes, and this is that filter, just already written, with the rough edges handled (dedup by response id, stream topups, the orphan-adoption race, etc.). And to @zaakiy's very fair pushback that not everyone has the time/AI-credits to write their own — you shouldn't have to. This is paste-two-files-and-enable, no code to write.

    Mapping to what people asked for:

    • API-only usage (the original ask): API calls that bypass the web UI and pure-passthrough routes (/api/v1/messages, /openai/responses) that never even trigger the Filter are metered via a small startup middleware that reads the usage object off the response. @KevinRossiTC's Both/UI/API split is there — every record is channel-tagged webui vs api.
    • Per-user / per-group quotas (@amirparsadd): per-user and per-group caps with a clear resolution order (user > max(group) > default > unlimited), enforced pre-request with a friendly block message. Daily/weekly/monthly periods.
    • Cost-based, not just tokens (@smorello87 — you called this the better-but-harder option): it converts tokens → USD via a pricing table that auto-refreshes from LiteLLM/models.dev (so no manual price maintenance — your OpenRouter/Bedrock script concern is handled by the upstream feed), with fuzzy model-id matching + per-model overrides/aliases/discount-multipliers. credits_per_usd lets you bill in abstract "credits" if you'd rather not expose dollars.
    • Per-user self dashboard (@jijunwu): each user gets their own /quota card (own usage only, server-enforced) — quota-remaining bar, today/7d/30d stats, per-model breakdown. There's a users-ranking table on the admin side if you want the leaderboard angle.
    • Read-only analytics without granting admin (@gaby): exactly the role split above — non-admins get the self-service card, no admin rights needed.

    It's MIT, single-file-per-function, state lives in JSON under the data dir (never touches the OWUI db). README is in Chinese but the code/comments are English and it's a quick translate. Requires OWUI ≥ 0.10 for the Event function.

    Happy to answer questions or take issues/PRs on the repo. And to be clear: I'd still love to see this land in core properly (the proposals from @godlobster6 / @SamirMoustafa are the right long-term shape) — this is just for people who can't wait.

  21. paucabrerah commented on Aug 23, 2026

    @paucabrerah

    I specifically said what i said: "the ability to run outlet() methods of a filter on all requests including api requests and that is already a thing now."

    not that the analytics page measures api calls

    Yeah, but issues specifically regarding API Key usage being reflected in the "Usage" section have been marked as duplicated to this one, which looks like should have not been the case since they are different things.

  22. Classic298 commented on Aug 23, 2026

    @Classic298
    SponsorMember

    No it's not different things. This is the aggregate for analytics.

  23. leon-fans commented on Aug 31, 2026

    @leon-fans

    I specifically said what i said: "the ability to run outlet() methods of a filter on all requests including api requests and that is already a thing now."
    not that the analytics page measures api calls

    Yeah, but issues specifically regarding API Key usage being reflected in the "Usage" section have been marked as duplicated to this one, which looks like should have not been the case since they are different things.

    Yes, me too. I'm using a script filter within a function to extract the usage of each user accessing the model via the API, but I've encountered some issues. For example, over time, the data written to the SQLite database affects the web UI's API interface, causing the entire service to become unavailable. This design needs serious consideration.

  24. iwasinnam2 commented on Sep 24, 2026

    @iwasinnam2

    Reading this thread end to end, the same structural discovery keeps resurfacing in different words: UI-side capture can't see API traffic. outlet() doesn't fire for API calls, filters only observe the inlet, passthrough bypasses both. Any analytics built at that layer will permanently undercount exactly the traffic @zaakiy is asking about — the API consumers spending the money.

    The durable shape is to flip where the record is born: one usage record per call, written at the model boundary (the point where the response actually completes, including the terminal usage chunk for streams), with a provenance marker distinguishing measured usage from estimated. The analytics page then becomes a query over that store rather than an observer trying to watch calls go by — and UI vs API vs passthrough become filter dimensions on complete data instead of blind spots.

    That also scopes the v1 @godlobster6 proposed more sharply: write the record first, dashboards second. @xyonium's Functions pair is a reasonable bridge for UI-path traffic today, but it structurally can't cover passthrough — the record has to live below the layer where the divergence happens, or the gap reopens with every new protocol surface (the Anthropic /messages passthrough being the latest example).

  25. PR-JF commented on Oct 14, 2026

    @PR-JF

    Just want to add this would be extremely helpful to have. Currently our company devs use openwebui almost exclusively via the API and opencode with local models, while others depts favor using the webpage. We really could use visibility into how the API is being used. Thank you!

  26. gaby commented on Oct 15, 2026

    @gaby
    Contributor

    @iwasinnam2 No way I'm clicking that link.

  27. iwasinnam2 commented on Oct 15, 2026

    @iwasinnam2

    @gaby Thanks for informing me.

  28. deleted a comment from iwasinnam2 on Oct 15, 2026
  29. Eee622 commented on Oct 24, 2026

    @Eee622

    28. Just want to add this would be extremely helpful to have. Currently our company devs use openwebui almost exclusively via the API and opencode with local models, while others depts favor using the webpage. We really could use visibility into how the API is being used. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions