/v1/dashboard/billing/usage is Not work

The /v1/dashboard/billing/usage API endpoint, which was previously accessible, has become unavailable since today. Is this api no longer provided? The current error message indicates “Your request to GET /v1/dashboard/billing/usage must be made with a session key (that is, it can only be made from the browser). You made it with the following key type: secret”.

2 Likes

Technically it was never provided officially, this functionality was discovered by sniffing network tools.

Very disappointing either way. This was the simplest way to get your API costs.

 ███████████     ███████       ███████       ███████    ███
▒▒███▒▒▒▒▒███  ███▒▒▒▒▒███   ███▒▒▒▒▒███   ███▒▒▒▒▒███ ▒███
 ▒███    ▒███ ███     ▒▒███ ███     ▒▒███ ███     ▒▒███▒███
 ▒██████████ ▒███      ▒███▒███      ▒███▒███      ▒███▒███
 ▒███▒▒▒▒▒███▒███      ▒███▒███      ▒███▒███      ▒███▒███
 ▒███    ▒███▒▒███     ███ ▒▒███     ███ ▒▒███     ███ ▒▒▒ 
 ███████████  ▒▒▒███████▒   ▒▒▒███████▒   ▒▒▒███████▒   ███
▒▒▒▒▒▒▒▒▒▒▒     ▒▒▒▒▒▒▒       ▒▒▒▒▒▒▒       ▒▒▒▒▒▒▒    ▒▒▒ 
2 Likes

Simplest way to strategize unauthorized usage attacks on leaked keys, you mean.

managed to get a similar result by writing into the billinge api, getting a sum of the daily costs and adding them up: Handling OpenAI API Cost Retrieval Changes - JeyPop

1 Like

Why not use https://api.openai.com/v1/usage ?

1 Like

Hi,
sad but this doesn’t group expenses by an api key but only by an org key :frowning: