Track Token usage #87
-
Technical FeedbackIn my Blazor App, I would like to track token usage in SemanticKernel and KernelMemory with streaming responses and document ingestion on a per-user basis for billing purposes. Desired OutcomeBeing able to track the detailed token usage on a per user basis, i.e. get the tokens after Current WorkaroundI don't have one. Copilot suggested to intercept OpenTelemetry, but this is on a per-app basis. Maybe one could wrap all calls around |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
I would recommend using Azure API Management (APIM) to manage access to the Azure OpenAI Service API. This approach provides more effective management and retrieval of tokens for different users with each API call. I don't recommend directly using the native AOAI API approach, as this is unrelated to Semantic Kernel from my understanding. Here are some helpful resources: AI Gateway Sample |
Beta Was this translation helpful? Give feedback.
I would recommend using Azure API Management (APIM) to manage access to the Azure OpenAI Service API. This approach provides more effective management and retrieval of tokens for different users with each API call. I don't recommend directly using the native AOAI API approach, as this is unrelated to Semantic Kernel from my understanding.
Here are some helpful resources:
AI Gateway Sample
Leveraging API Management for OpenAI Applications