This function calculates API interaction pricing in Open WebUI and records user model usage for OpenRouter models. Based on maki's edit of bgeneto's cost tracker. See https://github.com/bgeneto/open-webui-cost-tracker for usage.
"""
title: Cost Tracker for OpenRouter
description: This function is designed to manage and calculate the costs associated with user interactions and model usage in a Open WebUI based on OpenRouters pricings. See https://github.com/bgeneto/open-webui-cost-tracker & https://openwebui.com/f/makimaki/cost_tracker/edit
author: Kkoolldd (maki & bgeneto)
author_url: https://github.com/bgeneto/open-webui-cost-tracker
funding_url: https://github.com/bgeneto/open-webui-cost-tracker
version: 0.3.2
license: MIT
requirements: requests, tiktoken, cachetools, pydantic
environment_variables:
disclaimer: This function is provided as is without any guarantees.
It is your responsibility to ensure that the function meets your requirements. This function calculates API interaction pricing in Open WebUI and records user model usage for OpenRouter models. Based on maki's edit of bgeneto's cost tracker. See https://github.com/bgeneto/open-webui-cost-tracker for usage.
We use optional analytics to improve our websites, and advertising cookies on this site. Privacy Policy.