GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Cache write tokens not accounted for when using OpenRouter, causing cost underestimation · Issue #18440 · anomalyco/opencode Closed DescriptionDescriptionWhen a cache miss occurs via OpenRouter, opencode displays a near-zero cost even though the actual billing is much higher. This causes the in-app cost tracker to be way off from what OpenRouter bills. The root cause: "usage_response": { "prompt_tokens_details": { "cached_tokens": 10318, "cache_write_tokens": 0 } } The fix would be to also read const cacheWriteInputTokens = safe( input.metadata?.["anthropic"]?.["cacheCreationInputTokens"] ?? input.metadata?.["bedrock"]?.["usage"]?.["cacheWriteInputTokens"] ?? input.metadata?.["venice"]?.["usage"]?.["cacheCreationInputTokens"] ?? input.usage?.cacheWriteInputTokens ?? // OpenRouter 0 ) The exact field name on PluginsN/A OpenCode version1.2.27 Steps to reproduce
Screenshot and/or share linkDon't have it there. Operating SystemNo response TerminalNo response Activity
MetadataMetadataAssigneesLabelsTypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |