API Access to Hard Limit / Usage / Billing data

Hey there,

is there any way to have access to the billing limit and/or current spenting per month through an api?

I want to be transparent with my users and show them how much money has already been used and i don’t want to rely solely on counting the tokens used.

Tokens used per month * openAI pricing model = $ spent per month

I know I could do that using data.usage.total_tokens and counting dallE access but they I would still be missing the configured hard limit. Would need to hardcode that and update the code everytime I up or downgrade the limit

Also you dont get token counts when you are streaming replies

1 Like