Insurgently

Obsidian plugin· Active · beta · not yet released

Model Hub

Named roles mapped to provider and model, keys kept in secret storage, and a cost ledger with the billed cost of every call. Other plugins call it for their AI.

Beta. Model Hub is not released yet. These pages describe the build in progress.

See what you spent

Read the usage view, and understand listed cost, billed cost and flagged calls.

Open the usage view

Run the command Model Hub: Open usage and costs, or select Open under Settings → Model Hub → Usage.

Read it

  • Choose a period at the top: Today, 7 days, 30 days or All. The refresh button reloads it.
  • The summary line gives the number of calls and the total spend, then how many were billed above list, refused, failed or answered by a fallback.
  • The tables break spend down by group, with Calls, Spend, Tokens in / out, Flagged and Refused.
  • Recent calls lists each call: When, Role, Model, Cost and Result. A refused or failed call shows its reason code.

Listed and billed

  • Listed cost is the call's tokens at the model's published price.
  • Billed cost is what the provider says it charged. OpenRouter reports this for every call.
  • A call is flagged when it was billed more than 1.5 times the listed cost and more than $0.0005 over it.

Refused and failed calls are recorded too, at a cost of zero, so you can see what was stopped and why.

Where the ledger is kept

Every call is one line in ledger.jsonl in Model Hub's plugin folder, inside your vault's configuration folder (usually .obsidian/plugins/model-hub/). It holds the role, model, tokens and cost of each call, and never your text. Uninstalling the plugin deletes it; copy the file out first if you want to keep the history.

Related