lightseekorg/tokenspeed added reasoning token usage aggregation in the commit of November 8, 2026, `7b21034` (PR #3182, feat(engine): report reasoning token usage). The engine directly counts the cumulative number of tokens that an inference model spent thinking (reasoning tokens), attaches it to the output batch as a `reasoning_tokens` field, and passes it through unchanged all the way to the Rust client and the Python runtime. Source: https://github.com/lightseekorg/tokenspeed/commit/7b21034
The counting method is specific. The engine calculates the cumulative reasoning token count by subtracting block markers from the committed token IDs, and treats DeepSeek V4.1 as an implicit boundary that has no closing indicator for the tool block start marker. The aggregation is independent of grammar constraints (grammar constraint), so a value still appears even with `--grammar-backend none`, and a parser that knows no block markers reports 0. PD (Prefill/Decode) bootstrap tokens are included as well. The new field is attached at the tail of the output batch (wire tail), so output produced by earlier producers is read as an empty list.
That said, this number does not extend to external gateway responses. This change deliberately left the response mappings of the SMG gateway and Dynamo untouched, and the verification states only the number of passing Rust and Python tests without presenting any performance figures. The limitation that meaningful values appear only in requests that use a parser which knows the block markers remains as it is. If you want to measure inference cost, looking directly at the engine output path is the right thing to do, and expecting aggregated values through the gateway is premature.