List OpenAI platform invoices
Automatically list OpenAI platform invoices on platform.openai.com. List the invoices of an OpenAI API platform billing account (API usage and credits; for the ChatGPT subscription use chatgpt.com/list_invoices). Returns id, number, total (in cents), amount paid, currency, status, creation time, hosted invoice link and PDF link. Covers the past 12 months, as the billing page does. An account in several organizations picks the first one offered, or the one named exactly by organization; an unknown name fails and lists the organizations offered.
Input
organization optionalWhich API organization to use if OpenAI asks you to choose one, by its exact name as shown. When no organization has that name the run stops and lists them. Defaults to the first one offered.
Output
invoices requiredFAQ
OpenAI unofficial API: download an OpenAI platform invoice PDF
An unofficial OpenAI API to download platform billing invoice PDFs. Download a billing invoice PDF from the signed-in OpenAI API platform organization (platform.openai.com; API usage and credits, not the ChatGPT subscription). Pass the invoice id (in_...) or number (e.g. PFWBT7SS-0003) as shown by list_invoices, or omit it for the most recent invoice. If OpenAI asks which API organization to use, it picks the one named in organization, or else the first offered. Returns the invoice number, status, total (cents), created date, and where the PDF was saved, plus every invoice number on the organization. It fails with the list of available invoices if the requested one does not exist. Read-only.
OpenAI Platform login (Google SSO)
Log into the OpenAI API Platform (platform.openai.com) with Continue with Google, handling the Google account chooser and consent screen, and wait for OpenAI to finish the sign-in. Returns straight away if you are already signed in, and reports the account email and default organization. If the site asks you to verify you are human, the run stops and says so. Optionally pass which Google account to use. Needs a browser already signed in to Google and a Google account that already has an OpenAI account.
OpenAI Platform whoami
Report which OpenAI API Platform account this browser is signed in as: the account email, name and default organization. When the browser is signed out, the run fails with a signed-out error that asks to sign in to platform.openai.com, so it can be used to check a session before running other platform.openai.com scripts.
