Lets tak about usage tracking ($$$)

Lets discuss about tracking usage.
I think I am not the only one with this problem.

It is becoming incredibly hard to track the usage with all the zoo of models and type of tokens, and going forward its not going to be much easier.

I have two proposals:

  • return the usage in $ in addition to tokens - it is much easier to do it on your side, since you know all the prices for the tokens, types (text, completion, audio, image, cache, batch… etc etc etc).
  • return the usage in a separate call, because each completion call has an ID assigned, why not create a separate API that will return usage by ID.

Having a separate API for the usage, and return the usage in money would be perfect!
Thank you.

3 Likes

It might not have that level of detail (request ID) that you are asking, but there is already an API for costs and usage, in case you missed:

https://platform.openai.com/docs/api-reference/usage

4 Likes

This api is completely useless.
Imagine this - we have a platform with hundreds of different clients, there are different jobs running for different clients. It is very difficult to track the individual client usage if you have a single account. That api is an aggregation which is just showing total usage.

Any other ideas? Maybe someone from the engineering team?

Are you not using projects per client? That would be an easy way. Then within clients (project) you can group your cost in the same way you group your tokens.

In my OpenAI bash script warper, I used to calculate the cost BUT it became too cumbersome to maintain due to always-changing token and price rates.

OP’s first proposal seems cool. It is not like I would re-implement the cost feature but it would be easier for developers focusing solely on OpenAI API response scheme.

It is not like OpenAI defines any more “defaults” any longer (this is for alternative provider developers as comment)

1 Like

The number of clients goes to thousands, I dont know how many projects can I have there, but probably this is not what projects have been created for after all…

don’t think there is a limit to projects. It seems designed for keep track of stuff like this. And you can create them in the API https://platform.openai.com/docs/api-reference/projects