opik icon indicating copy to clipboard operation
opik copied to clipboard

[Bug]: Cost estimate not showing for recent claude model

Open ming-orby opened this issue 2 months ago • 3 comments

What component(s) are affected?

  • [ ] Opik Python SDK
  • [ ] Opik Typescript SDK
  • [ ] Opik Agent Optimizer SDK
  • [x] Opik UI
  • [ ] Opik Server
  • [ ] Documentation

Opik version

  • Opik version: 1.9.15
  • python version: 3.13

Describe the problem

On the Opik UI, while using OpikTracer, I can get a estimated cost for claude sonnet 4 model, but not for the latest sonnet 4.5 or haiku 4.5. The code logic is the same, except I changed the model. Can you help me understand this case better? Is this a missing feature? Image Image

Reproduction steps and code snippets

  • use OpikTracer for langchain integration, and config with claude-sonnet-4.5 model

Error logs or stack trace

No response

Healthcheck results

No response

ming-orby avatar Nov 18 '25 19:11 ming-orby

@ming-orby can you try updating your opik SDK and try again? The latest is 1.9.23. If it still fails, can you give use more details about how you are logging (eg, what provider, what framework)?

dsblank avatar Nov 20 '25 18:11 dsblank

@dsblank I have updated to latest 1.9.24, but it still fails to show the cost estimate. Details

Provider & Framework

  • Library: opik version >=1.9.23
  • Provider: Self-hosted Opik instance
  • Integration: LangChain via OpikTracer (from opik.integrations.langchain)

Usage Patterns

  1. Decorator-based tracing: - Uses @opik.track() decorator on the main entry point - Tracks entire flow
  2. LangChain Integration: - Creates OpikTracer instances - Passed as callbacks to LangChain's RunnableConfig - Tracks LLM calls automatically
  3. Manual Span Creation

Failed on showing cost when model is Claude sonnet 4.5 or haiku 4.5:

  • client = ChatAnthropic( model=config.model, ← "claude-sonnet-4-5-20250929" or "claude-haiku-4-5-20251001" ... ) ↓ self.client.astream(messages) ← Actual LLM calls

ming-orby avatar Nov 20 '25 20:11 ming-orby

Ok, thanks for the details. We're looking into it.

dsblank avatar Nov 20 '25 21:11 dsblank