Feature query the balance corresponding to api key
yiios opened this issue · comments
闫冰 commented
$ curl -s "https://api.openai.com/dashboard/billing/credit_grants" \
--header 'Content-type: application/json' \
--header 'Authorization: Bearer api_key' | jq
{
"object": "credit_summary",
"total_granted": 18,
"total_used": 0.178104, # Amount used
"total_available": 17.821896, # Remaining Available Balance
"grants": {
"object": "list",
"data": [
{
"object": "credit_grant",
"id": "be32c280-ad4a-4e14-bc1a-077a32275f9e",
"grant_amount": 18,
"used_amount": 0.178104,
"effective_at": 1677628800,
"expires_at": 1688169600 # expiration time
}
]
}
}
Jeff commented
The feature to display the remaining available balance for the current API key has already been added to the master branch.