X-Majordomo-* headers. This metadata is stored with the request log and queryable in the dashboard and directly in Postgres.
Adding metadata
Any header prefixed withX-Majordomo- (except -Key and -Provider) is stored as metadata:
Recommended dimensions
Start with the dimensions you’ll actually query. You can add more over time — new keys are stored immediately without any schema changes.
Querying spend
By feature
By team (monthly)
By model
Top spenders this week
Indexed metadata
High-cardinality metadata keys (user IDs, experiment names) can be activated for GIN indexing in the dashboard. Activated keys are copied to theindexed_metadata JSONB column, which supports fast @> queries.
raw_metadata — just without the index. Activate keys for dimensions you query frequently.
Grouping an agent’s calls
Metadata attributes cost across dimensions (feature, team, user). To instead group the multiple LLM calls of one conversation or agent run into a single run — with a rolled-up cost and a nested waterfall — use Agent Run Tracking. The two compose: tag a run with a trace id and anX-Majordomo-Feature to both drill into one run and roll
runs up by feature.