{"id":49575145,"url":"https://github.com/rollecode/open-webui-simple-cost-tracker","last_synced_at":"2026-05-03T16:10:54.715Z","repository":{"id":303648349,"uuid":"1016118804","full_name":"rollecode/open-webui-simple-cost-tracker","owner":"rollecode","description":" A minimalist cost tracking function that tracks token usage and costs per model","archived":false,"fork":false,"pushed_at":"2025-08-14T10:34:34.000Z","size":98,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-02T13:33:31.274Z","etag":null,"topics":["ai","open-webui","openai","openai-api","openai-functions"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rollecode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-08T14:12:20.000Z","updated_at":"2025-12-07T16:53:40.000Z","dependencies_parsed_at":"2025-07-08T18:29:20.002Z","dependency_job_id":"cfd6ab30-500a-4880-adc5-4963c2b0506e","html_url":"https://github.com/rollecode/open-webui-simple-cost-tracker","commit_stats":null,"previous_names":["ronilaukkarinen/open-webui-simple-cost-tracker","rollecode/open-webui-simple-cost-tracker"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/rollecode/open-webui-simple-cost-tracker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollecode%2Fopen-webui-simple-cost-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollecode%2Fopen-webui-simple-cost-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollecode%2Fopen-webui-simple-cost-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollecode%2Fopen-webui-simple-cost-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rollecode","download_url":"https://codeload.github.com/rollecode/open-webui-simple-cost-tracker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollecode%2Fopen-webui-simple-cost-tracker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32575390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","open-webui","openai","openai-api","openai-functions"],"created_at":"2026-05-03T16:10:54.025Z","updated_at":"2026-05-03T16:10:54.699Z","avatar_url":"https://github.com/rollecode.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💰 Open WebUI Simple Cost Tracker\n\n### Minimalist cost tracking function for [Open WebUI](https://github.com/open-webui/open-webui)\n\n![Open WebUI](https://img.shields.io/badge/Open%20WebUI-222222?style=for-the-badge\u0026logo=data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjZmZmZmZmIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGhlaWdodD0iMWVtIiBzdHlsZT0iZmxleDpub25lO2xpbmUtaGVpZ2h0OjEiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjFlbSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNy42OTcgMTJjMCA0Ljk3LTMuOTYyIDktOC44NDkgOUMzLjk2MiAyMSAwIDE2Ljk3IDAgMTJzMy45NjItOSA4Ljg0OC05YzQuODg3IDAgOC44NDkgNC4wMyA4Ljg0OSA5em0tMy42MzYgMGMwIDIuOTI4LTIuMzM0IDUuMzAxLTUuMjEzIDUuMzAxLTIuODc4IDAtNS4yMTItMi4zNzMtNS4yMTItNS4zMDFTNS45NyA2LjY5OSA4Ljg0OCA2LjY5OWMyLjg4IDAgNS4yMTMgMi4zNzMgNS4yMTMgNS4zMDF6Ij48L3BhdGg+PHBhdGggZD0iTTI0IDNoLTMuMzk0djE4SDI0VjN6Ij48L3BhdGg+PC9zdmc+Cg==)\n![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54) ![Version](https://img.shields.io/badge/version-1.1.2-blue?style=for-the-badge)\n\nA simple, lightweight cost tracking function that monitors token usage and calculates costs for different AI models in Open WebUI. Track your monthly and daily spending with minimal configuration.\n\n## ✨ What it does\n\nSimple Cost Tracker automatically monitors your AI conversations and provides real-time cost information including:\n\n- **Monthly cost tracking** - Automatically resets each month\n- **Daily cost tracking** - Shows today's spending\n- **Per-message costs** - Individual message cost breakdown\n- **Token usage** - Input and output token counts\n- **Multi-provider support** - Works with OpenAI, Anthropic, Gemini, and more\n\n## 🚀 Features\n\n- 📊 **Real-time cost tracking** with status messages\n- 🗓️ **Automatic monthly/daily reset** - No manual maintenance\n- 🔧 **Easy configuration** via JSON valve\n- 💾 **Persistent storage** in simple JSON file\n- 🎯 **Accurate token estimation** including memories and system prompts\n- 🏷️ **Provider prefix support** (openai., anthropic., gemini., etc.)\n\n## 📋 Installation\n\n1. Download `simple_cost_tracker.py`\n2. In Open WebUI, go to **Admin Panel \u003e Functions**\n3. Click **Import Function** and upload the file\n4. Enable the function\n\n## ⚙️ Configuration\n\nThe function includes pre-configured costs for popular models. Update the **Model Costs JSON** valve to add or modify pricing:\n\n```json\n{\n  \"openai.gpt-4.1-mini\": {\"input\": 0.40, \"output\": 1.6},\n  \"anthropic.claude-3-5-haiku-latest\": {\"input\": 0.80, \"output\": 4.0},\n  \"google.gemini-2.5-flash\": {\"input\": 0.30, \"output\": 2.50}\n}\n```\n\n**Important:** Use the exact model name as shown in **Settings \u003e Models**. Include connection prefixes if you use them.\n\nFor initial costs, edit `cost_tracker_data.json` file manually, costs will add up as you use the function.\n\n## 💡 Usage\n\nOnce enabled, the cost tracker automatically displays status messages after each AI response:\n\n```\n0.0052 € this message, 0.47 € today, 13.20 € this month. 11746 tokens used (11313 in, 433 out)\n```\n\n## 📁 Data Storage\n\nCosts are stored in `cost_tracker_data.json` with automatic:\n\n- Monthly reset on the 1st of each month\n- Daily reset at midnight\n- Persistent tracking across sessions\n\n## 🛠️ Technical Details\n\n- **Input token estimation** includes memories, system prompts, and full context\n- **Output token estimation** based on assistant response content  \n- **Costs calculated** using standard pricing per 1M tokens (EUR)\n- **Unknown models** default to 0 cost (for local models)\n\n## 🆚 Comparison\n\nUnlike complex cost trackers that require API keys and external connections, Simple Cost Tracker:\n\n- ✅ **No API keys required**\n- ✅ **No external dependencies** \n- ✅ **Automatic operation**\n- ✅ **Minimal configuration**\n- ✅ **Local storage only**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollecode%2Fopen-webui-simple-cost-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frollecode%2Fopen-webui-simple-cost-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollecode%2Fopen-webui-simple-cost-tracker/lists"}