Hi! You are currently passing in usageMetadata in the async log response. On the Helicone request page, your responses look like this:
[
{
"usageMetadata": {
"promptTokenCount": 548,
"candidatesTokenCount": 281,
"totalTokenCount": 829
}
}
]
This seems to be hardcoded at the moment. We can change that. Vertex AI returns
usageMetadata
object in their responses. Here is an example:
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "I am sorry, I cannot fulfill this request. I do not have access to real-time information such as current movie showtimes. \n\nWould you like me to try searching for something else? \n"
}
]
},
"finishReason": "STOP",
"safetyRatings": [],
"usageMetadata": {
"promptTokenCount": 9,
"candidatesTokenCount": 42,
"totalTokenCount": 51
}
}
You can see the
usageMetadata
JSON object is there. If you grab that out of the response from Vertex AI, then pass it just like you are currently passing in the hardcoded usageMetadata, you will start getting costs metrics.