OpenAI unofficial API: list your platform invoices with PDF links
Automatically list your platform invoices with PDF links on platform.openai.com. An unofficial OpenAI API for platform billing invoices. List invoices on the OpenAI API platform billing account (platform.openai.com, API usage/credits — NOT the ChatGPT subscription, which is chatgpt.com/list_invoices). Returns id, number, total (cents), currency, status, created_ts, hosted_invoice_url, pdf_url. Covers the past 12 months, as the dashboard does.
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. A Cloudflare check is waited out (never clicked) and named if it does not clear. 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. Being signed out is reported as a normal answer (loggedIn false), not an error, so it can be used to check a session before running other platform.openai.com scripts.
