How to Track Claude Code, Codex and OpenCode Usage on Copilot with totals_by_client and model_selection_mode
Use the Copilot usage metrics API's totals_by_client array to see which tools (claude_code, codex, opencode, copilot_cli, vscode) send model traffic through your Copilot seats, and model_selection_mode to split user-picked models from Auto and product-chosen ones. Endpoints, permissions, NDJSON parsing with jq, and the caveats that make the numbers easy to misread.