Skip to content

feat: track OpenRouter usage#134

Open
wjiayis wants to merge 2 commits intostagingfrom
feat/proj-cost-track
Open

feat: track OpenRouter usage#134
wjiayis wants to merge 2 commits intostagingfrom
feat/proj-cost-track

Conversation

@wjiayis
Copy link
Member

@wjiayis wjiayis commented Mar 22, 2026

Store usage information in database to track user behavior (if user is not BYOK) as a precursor to billing users, e.g.,

[
  {
    _id: ObjectId('69bf6105f1fe4dba906bf408'),
    user_id: ObjectId('6975da46d6096ac1b07342c2'),
    model_slug: 'openai/gpt-4.1',
    hour_bucket: ISODate('2026-03-22T03:00:00.000Z'),
    project_id: '69746440592738ba2708cc34',
    cost: 0.04201,
    updated_at: ISODate('2026-03-22T03:27:01.229Z')
  },
  {
    _id: ObjectId('69bf61a859daabf3de104287'),
    project_id: '69746440592738ba2708cc34',
    hour_bucket: ISODate('2026-03-22T03:00:00.000Z'),
    model_slug: 'openai/gpt-5-nano',
    user_id: ObjectId('6975da46d6096ac1b07342c2'),
    cost: 0.00067965,
    updated_at: ISODate('2026-03-22T03:27:36.861Z')
  },
  {
    _id: ObjectId('69bf64a23b2bb17df83e0add'),
    user_id: ObjectId('6975da46d6096ac1b07342c2'),
    model_slug: 'openai/gpt-5.2',
    hour_bucket: ISODate('2026-03-22T03:00:00.000Z'),
    project_id: '69746440592738ba2708cc34',
    cost: 0.01436225,
    updated_at: ISODate('2026-03-22T03:40:18.488Z')
  }
]

@wjiayis wjiayis self-assigned this Mar 22, 2026
@wjiayis wjiayis added the enhancement New feature or request label Mar 22, 2026
@wjiayis wjiayis requested review from 4ndrelim and Junyi-99 and removed request for Junyi-99 March 22, 2026 08:49
@wjiayis
Copy link
Member Author

wjiayis commented Mar 22, 2026

For discussion: do we plan to / how do we track token usage for XtraMCP?

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant