Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for querying billing details #591

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Aug 22, 2024

  1. Add support for querying billing details

    This commit adds support for querying daily costs usage information
    (as shown on https://platform.openai.com/usage). The implementation
    uses the public endpoing available at
    https://api.openai.com/dashboard/billing/usage  However, note that
    this API is not documented in
    https://platform.openai.com/docs/api-reference and may thus be
    controversial to include. The API requires a browser session key and
    will explicitly reject requests made using an API key.
    
    (cherry picked from commit 2f53565)
    (cherry picked from commit 33269e5)
    (cherry picked from commit 26947c0)
    (cherry picked from commit 7cf5c6b)
    (cherry picked from commit 7669bf1)
    (cherry picked from commit 7943ad7)
    mikeb26 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    9a8ef8d View commit details
    Browse the repository at this point in the history
  2. Avoid time.DateOnly

    It looks like the github action build environment for this repo uses
    a go 1.19.x environment which does not have time.DateOnly. Replace
    with local constant until this is upgraded.
    
    (cherry picked from commit 22886dd)
    (cherry picked from commit 5225542)
    (cherry picked from commit fbaa1f1)
    (cherry picked from commit 46091ed)
    (cherry picked from commit f477bcf)
    (cherry picked from commit dc6b161)
    mikeb26 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    5e3e84e View commit details
    Browse the repository at this point in the history
  3. Avoid time.Compare

    It looks like the github action build environment for this repo uses
    a go 1.19.x environment which does not have time.Compare(). Replace
    with time.Before() and time.After() instead.
    
    (cherry picked from commit a579ea8)
    (cherry picked from commit ffd8a2d)
    (cherry picked from commit 24eaaf5)
    (cherry picked from commit 6020e24)
    (cherry picked from commit 3abc47f)
    (cherry picked from commit a1f95a8)
    mikeb26 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    121bab2 View commit details
    Browse the repository at this point in the history