Bug: For OpenAI reasoning models (e.g. gpt-4o, o1, o3), getUsage in session/index.ts adds reasoning tokens as a separate cost term on top of output tokens. But OpenAI's reasoning tokens are already a subset of completion_tokens — so they get billed twice.
Example with gpt-5.4-pro:
- Input: 14,746 tokens @ $30/M = $0.44238
- Output: 1,944 tokens @ $180/M = $0.34992
- Reasoning: 1,360 tokens (subset of output)
Actual charge: $0.7923. OpenCode reports: ~$1.04 (overstated).
Anthropic bills thinking tokens separately (not included in outputTokens), so that provider is correct. The extra reasoning cost term should only apply to Anthropic/Bedrock.
Bug: For OpenAI reasoning models (e.g. gpt-4o, o1, o3),
getUsageinsession/index.tsadds reasoning tokens as a separate cost term on top of output tokens. But OpenAI's reasoning tokens are already a subset ofcompletion_tokens— so they get billed twice.Example with gpt-5.4-pro:
Actual charge: $0.7923. OpenCode reports: ~$1.04 (overstated).
Anthropic bills thinking tokens separately (not included in outputTokens), so that provider is correct. The extra reasoning cost term should only apply to Anthropic/Bedrock.