Very high input token usage with Cerebras (GLM 4.7) #7745

Open
opened 2026-02-16 18:08:06 -05:00 by yindo · 6 comments
Owner

Originally created by @azais-corentin on GitHub (Jan 27, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Hi,
Token usage as reported (and billed) by Cerebras is completely different from the usage report in opencode.

This is the usage report in opencode for the past day:

┌────────────────────────────────────────────────────────┐
│                      MODEL USAGE                       │
├────────────────────────────────────────────────────────┤
│ cerebras/zai-glm-4.7                                   │
│  Messages                                           62 │
│  Input Tokens                                   168.6K │
│  Output Tokens                                   14.3K │
│  Cost                                          $0.0000 │
└────────────────────────────────────────────────────────┘

For the same period, Cerebras reports 63 total requests, 2.56M total tokens (2.55M input tokens and 14.39k output tokens).

This is a 15x difference!

In normal usage, with a single opencode instance I hit the 500k tokens/min limit a few times in about 10 minutes of usage.

Plugins

opencode-antigravity-auth@latest, @mohak34/opencode-notifier@latest

OpenCode version

1.1.36

Steps to reproduce

  1. Use opencode with cerebras/zai-glm-4.7 model
  2. Notice very high input token usage

Screenshot and/or share link

No response

Operating System

Ubunut 25.10

Terminal

Alacritty and vscode terminal

Originally created by @azais-corentin on GitHub (Jan 27, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description Hi, Token usage as reported (and billed) by Cerebras is completely different from the usage report in opencode. This is the usage report in opencode for the past day: ``` ┌────────────────────────────────────────────────────────┐ │ MODEL USAGE │ ├────────────────────────────────────────────────────────┤ │ cerebras/zai-glm-4.7 │ │ Messages 62 │ │ Input Tokens 168.6K │ │ Output Tokens 14.3K │ │ Cost $0.0000 │ └────────────────────────────────────────────────────────┘ ``` For the same period, Cerebras reports 63 total requests, 2.56M total tokens (2.55M input tokens and 14.39k output tokens). This is a 15x difference! In normal usage, with a single opencode instance I hit the 500k tokens/min limit a few times in about 10 minutes of usage. ### Plugins `opencode-antigravity-auth@latest`, `@mohak34/opencode-notifier@latest` ### OpenCode version 1.1.36 ### Steps to reproduce 1. Use opencode with `cerebras/zai-glm-4.7` model 2. Notice very high input token usage ### Screenshot and/or share link _No response_ ### Operating System Ubunut 25.10 ### Terminal Alacritty and vscode terminal
yindo added the bugperfzen labels 2026-02-16 18:08:06 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 27, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #5951: Token count is way off
  • #8945: Mismatch between token spent and billing against my account
  • #10066: Excessive input token usage with Sonnet on AWS Bedrock
  • #6728: High Token Consumption Observed with Opus 4.5 in OpenCode
  • #7463: When using the cerebras api i am frequently getting 'Tokens per minute limit exceeded'
  • #8005: GLM 4.7 from Cerebras not working
  • #3322: web and tui reports token usage differently

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 27, 2026): This issue might be a duplicate of existing issues. Please check: - #5951: Token count is way off - #8945: Mismatch between token spent and billing against my account - #10066: Excessive input token usage with Sonnet on AWS Bedrock - #6728: High Token Consumption Observed with Opus 4.5 in OpenCode - #7463: When using the cerebras api i am frequently getting 'Tokens per minute limit exceeded' - #8005: GLM 4.7 from Cerebras not working - #3322: web and tui reports token usage differently Feel free to ignore if none of these address your specific case.
Author
Owner

@Sandipbgn commented on GitHub (Jan 29, 2026):

Any updates on this? I encountered similar issues.

@Sandipbgn commented on GitHub (Jan 29, 2026): Any updates on this? I encountered similar issues.
Author
Owner

@icculp commented on GitHub (Feb 2, 2026):

Is it possible cerebras is doing something weird? I noticed that glm costs skyrocket like crazy with only a few minutes of usage, but using gpt-oss-120b on cerebras didn't skyrocket even though I used it way more, and, glm4.7 on openrouter didn't skyrocket like it did on cerebras for similar usage.

@icculp commented on GitHub (Feb 2, 2026): Is it possible cerebras is doing something weird? I noticed that glm costs skyrocket like crazy with only a few minutes of usage, but using gpt-oss-120b on cerebras didn't skyrocket even though I used it way more, and, glm4.7 on openrouter didn't skyrocket like it did on cerebras for similar usage.
Author
Owner

@azais-corentin commented on GitHub (Feb 3, 2026):

I don't have that problem with other AI coding agents using Cerebras.

@azais-corentin commented on GitHub (Feb 3, 2026): I don't have that problem with other AI coding agents using Cerebras.
Author
Owner

@rekram1-node commented on GitHub (Feb 3, 2026):

I heard that cerebras counts tokens in a really weird way, and I bet we aren't treating it correctly

@rekram1-node commented on GitHub (Feb 3, 2026): I heard that cerebras counts tokens in a really weird way, and I bet we aren't treating it correctly
Author
Owner

@azais-corentin commented on GitHub (Feb 10, 2026):

Cerebras counts cached tokens as normal tokens, so this may be it.

@azais-corentin commented on GitHub (Feb 10, 2026): Cerebras counts cached tokens as normal tokens, so this may be it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7745