anomalyco / anomalyco/opencode

No usage/cost shown for DeepInfra provider (openai-compatible)

Open
#45,483 1 comment 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Aug 27, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

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

"provider": {
  "deepinfra": {
    "npm": "@ai-sdk/openai-compatible",
    "options": { "baseURL": "https://api.deepinfra.com/v1" },
    "models": { "deepseek-ai/DeepSeek-V4-Flash-0731": { "name": "DS Flash DI", "tool_call": true, "reasoning": true } }
  }
}
Expected

Usage (prompt/completion tokens, cached tokens) and cost are reported for the DeepInfra provider, like they are for OpenRouter/DeepSeek.

Actual

No usage / cost is shown for DeepInfra at all.

Environment
  • opencode (OpenChamber UI)
  • macOS
  • Provider: DeepInfra via OpenAI-compatible adapter
Related
  • #41328 No token usage tracking with @ai-sdk/openai-compatible provider
  • #39061 OpenAI-compatible cost chunk omits required stream fields
  • #43818 Honor provider-reported cost from LLM gateways

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.