You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No usage/cost shown for DeepInfra provider (openai-compatible) #45483
When using DeepInfra (https://deepinfra.com/) as a provider, opencode shows no token usage and no cost in the TUI / stats / session sidebar. The same setup works correctly with Anthropic (Claude), DeepSeek and OpenRouter — usage and cost display fine there. DeepInfra is the only one that shows nothing.
Setup
DeepInfra is configured as an OpenAI-compatible provider (@ai-sdk/openai-compatible), baseURL https://api.deepinfra.com/v1, e.g.:
Cross-reference: the DeepInfra account balance now shows in OpenChamber's Usage panel (openchamber/openchamber#3600) via GET https://api.deepinfra.com/v1/me?checklist=true → checklist.stripe_balance. That covers the balance surface; the per-request token/cost reporting for @ai-sdk/openai-compatible providers in the TUI is separate and still open here.
Thanks for the report! A few details would help us look into this:
OpenCode version: the output of opencode --version.
Does it happen in OpenCode itself? You mention OpenChamber, which is a separate third-party UI. Do you see the same thing in the plain opencode TUI (session sidebar) or with opencode stats? If it only happens in OpenChamber, the problem is probably there.
Tokens, cost or both? Are the token counts (input/output/cache) missing, or only the cost? One thing to know: OpenCode works out cost from the token counts and the model's per-token rates. Your custom deepinfra model has no cost entry, so its cost will show as $0 even when tokens are tracked. You can add the rates to the model config, for example:
Closing this for now because we haven't heard back. To look into the missing DeepInfra usage and cost, we'd need your OpenCode version (opencode --version). We'd also need to know whether it happens in the plain opencode TUI or opencode stats, or only in OpenChamber, and whether the token counts or only the cost are missing.
A quick tip in the meantime: OpenCode works out cost from the model's per-token rates. A custom model with no cost entry in its config will always show $0. Adding "cost": { "input": ..., "output": ..., "cache_read": ... } (USD per 1M tokens) to the model may be enough.
If it still happens, please comment here with those details or open a new issue, and we'll take another look. Thanks!
Activity
Tobias-Conrad commentedon Sep 16, 2026
Cross-reference: the DeepInfra account balance now shows in OpenChamber's Usage panel (openchamber/openchamber#3600) via
GET https://api.deepinfra.com/v1/me?checklist=true→checklist.stripe_balance. That covers the balance surface; the per-request token/cost reporting for@ai-sdk/openai-compatibleproviders in the TUI is separate and still open here.opencodejr commentedon Oct 28, 2026
Thanks for the report! A few details would help us look into this:
opencode --version.opencodeTUI (session sidebar) or withopencode stats? If it only happens in OpenChamber, the problem is probably there.deepinframodel has nocostentry, so its cost will show as $0 even when tokens are tracked. You can add the rates to the model config, for example:You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know you're done.
Related issues I found, ordered from most to least likely to be relevant:
@ai-sdk/openai-compatible(closed because the issue body was empty)usage.cost) instead of computing it locallyopencodejr commentedon Oct 31, 2026
Closing this for now because we haven't heard back. To look into the missing DeepInfra usage and cost, we'd need your OpenCode version (
opencode --version). We'd also need to know whether it happens in the plainopencodeTUI oropencode stats, or only in OpenChamber, and whether the token counts or only the cost are missing.A quick tip in the meantime: OpenCode works out cost from the model's per-token rates. A custom model with no
costentry in its config will always show $0. Adding"cost": { "input": ..., "output": ..., "cache_read": ... }(USD per 1M tokens) to the model may be enough.If it still happens, please comment here with those details or open a new issue, and we'll take another look. Thanks!