GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — OpenAI reasoning tokens double-counted in cost calculation · Issue #17566 · anomalyco/opencode

OpenAI reasoning tokens double-counted in cost calculation #17566

New issue
Copy link
New issue
Copy link
Closed
Closed
OpenAI reasoning tokens double-counted in cost calculation#17566
Copy link
Assignees
rekram1-node

Description

@killerdejavu
killerdejavu
opened on Mar 15, 2026
Issue body actions

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.

Reacted by xieqingxing

Activity

  1. github-actions
    assigned
    rekram1-node
    on Mar 15, 2026
  2. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 15, 2026
  3. thdxr
    removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  4. rekram1-node commented on May 27, 2026

    @rekram1-node
    rekram1-node
    on May 27, 2026
    Member
    More actions

    believe this is fixed

  5. rekram1-node
    closed this as completedon May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue 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.