Track Openai Assistant API costs #2625
christos-bsq
started this conversation in
Ideas
Replies: 1 comment
-
|
Assistant-style APIs can hide cost across threads, tool calls, retrieval, and retries. I would attach cost to both the provider call and the logical assistant run, otherwise the dashboard can be technically correct but not very actionable. I am testing an OpenAI-compatible multi-model API layer, and assistant/workflow-level cost tracking is one of the areas I am working on. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature or potential improvement
Idea
Monitor costs for tool usage within Langfuse,
Case: OpenAI's Assistants API
Besides, I/O tokens, OpenAI can also charge you for tool usage via the Assistants API:
source: https://openai.com/api/pricing/
Langfuse changes
Then specifically for Assistants API, use the OpenAI response to calculate cost (e.g. if OpenAI's response has Code Interpreter in the tool usage, add the flat $0.03 as cost)
Other cases
A developer might also use other tools and APIs (e.g. a Google Search API) when building agents.
Using Langfuse as the central hub for cost monitoring would be nice.
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions