A Redmine plugin to track costs booked by AI agents on issues, modelled directly on Redmine's built-in time tracking.
- AI costs are booked against an issue (or a project) as integer amounts in the currency's smallest unit (cents).
- The AI agent is represented by a regular Redmine user:
user_idis the agent the cost is attributed to,author_idis whoever recorded it (the agent's own user when booked via the API). - The total cost is shown on the issue page right next to Spent time. Clicking it opens the full AI cost report for the project, filtered to that issue — with the same Details and Report tabs, filters, grouping, sortable columns, totals, saved queries and CSV export as the time report.
- It is its own AI cost tracking project module, enabled per project independently, with its own permission section (separate from Time tracking).
- A JSON REST API lets AI agents book costs autonomously using a Redmine API key.
Granted per role inside the AI cost tracking module:
| Permission | Allows |
|---|---|
view_ai_costs |
See the total and the drill-down list |
log_ai_costs |
Book new AI costs (new, create) |
edit_ai_costs |
Edit/delete any AI cost |
edit_own_ai_costs |
Edit/delete own AI costs |
Book a cost on issue 1234 (amount in cents):
curl -X POST https://redmine.example.com/issues/1234/ai_costs.json \
-H "Content-Type: application/json" \
-H "X-Redmine-API-Key: $REDMINE_API_KEY" \
-d '{"ai_cost": {"amount_cents": 1250, "comments": "Code review"}}'List costs for an issue: GET /issues/1234/ai_costs.json.
List costs for a project: GET /projects/IDENT/ai_costs.json.
cd redmine
git clone <repo> plugins/redmine_ai_cost_tracking
bundle exec rake redmine:plugins:migrate RAILS_ENV=productionRestart Redmine afterwards.
The steps to upgrade this gem to new versions of Redmine is specified in the CLAUDE.md file.
The gem is available as open source under the terms of the MIT License.