conversation-metrics/
oh-metrics is a zero-dependency CLI tool that fetches cost and token usage for an OpenHands conversation. It automatically detects whether the conversation uses the V0 or V1 API and applies the appropriate retrieval strategy.
Installation
Usage
Example Output
JSON Output
Pass--json for programmatic use:
Features
- Auto-detects conversation version (V0 vs V1) and uses the appropriate API
- Graceful fallback chain — tries multiple endpoints until one succeeds
- JSON output for integration with dashboards or alerting pipelines
- API call logging with
--verbosefor debugging - Zero dependencies — uses only the Python standard library
- Fixture-based testing — high test coverage via recorded API responses
Getting a Conversation ID
Conversation IDs appear in the URL when you open a conversation:See Also
- Conversation Tags — Attach metadata to conversations for tracking and filtering

