Skip to content

Cost Tracking for vertex_ai/claude-sonnet-4-5@20250929 #1681

@ShreySatapara

Description

@ShreySatapara

The cost tracking is working fine while using LLM class from openhands sdk, however not able to track the cost while using conversation.run()

When I inspected with litellm debug it is throwing following warning. Even though I am passing vertex_ai as provider in my LLM class init in following way

model = "vertex_ai/claude-sonnet-4-5@20250929"
agent_llm = LLM(
usage_id="agent",
model=model,
log_completions=True,
caching_prompt=True,
drop_params=True,
# llm_provider="vertex_ai",

)

UserWarning: Cost calculation failed: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=claude-sonnet-4-5@20250929 Pass model as E.g. For 'Huggingface' inference endpoints pass in completion(model='huggingface/starcoder',..) Learn more: https://docs.litellm.ai/docs/providers warnings.warn(f"Cost calculation failed: {e}") success callbacks: Running Custom Callback Function - <function _debug_cost_cb at 0x796e22993d80>

Running litellm 1.80.13 with latest version of Openhands-sdk

The same cost tracking issue is there for azure/gpt-5.2-chat model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions