ChatGPT billing: list your ChatGPT subscription invoices
Automatically list your ChatGPT subscription invoices on chatgpt.com. ChatGPT subscription invoices, not the OpenAI API platform. Lists the billing history of the ChatGPT account currently open in this browser, as its Billing page shows it: only that account's invoices, never those of the user's other accounts. To get another account's invoices, switch ChatGPT to that account, then run this again. A Business, Team or Enterprise workspace open in the browser has no personal Billing page, and the run fails saying so. Each invoice comes with its date, amount, currency, payment status, plan and a link to the invoice; the result also names the active account and lists every account the user belongs to. Amounts are in the currency's smallest unit, so 1917 means 19.17 EUR. The Billing page shows the most recent invoices first and this script cannot page further: when ChatGPT says older invoices exist, complete is false and next_cursor holds the cursor ChatGPT gave, but those older invoices are not returned. When the browser is not signed in to ChatGPT, the run fails with a not-signed-in error. Pass hosted_invoice_url to the Stripe invoice PDF download script to get the PDF.
Input
None
Output
account requiredThe account open in this browser, whose invoices are listed.
accounts requiredEvery ChatGPT account the user belongs to; only the active one's invoices are listed.
complete requiredfalse when ChatGPT says the account has older invoices than the ones its Billing page loads.
invoices requiredsigned_in requiredAlways true: a browser that is not signed in to ChatGPT makes the run fail with a not-signed-in error.
next_cursor requiredThe cursor ChatGPT gave for its older invoices when complete is false; null otherwise. This script cannot page with it.
FAQ
Ask ChatGPT
Open a new ChatGPT chat, send one question, wait for the answer to finish (up to 3 minutes), and return the answer, the sources it cited, and the web searches it ran. `answers` is a list: ChatGPT sometimes answers twice and asks which reply you prefer, so check its length before reading answers[0]. `references` are the pages the answer cited, each with the id of the search result it came from when ChatGPT gives one (the search call and the result's rank in it). `sources` are the pages its searches gave the model. `searches` and `calls` also list the results ChatGPT shows under Sources but never gave the model, with `given: false`. An empty `references` means that reply cited nothing: the same question may search on one run and not the next, so repeat it before drawing conclusions. `webSearchQueries` lists what ChatGPT searched for, `searches` groups those queries by round with their results, and `calls` lists each search call with every result's type, position, snippet and date. `activity` gives the progress lines the page showed while it worked ("Searching the web", "Searched 8 websites"). `model`, `stopReason` and `searchContext` say which model answered and how; signed in, `searchContext` also gives the model and thinking effort the account asked for, and its plan. Signed in, it answers in Chat mode only: when the browser is in Work mode it fails with an error that says so; switch back with set_mode (a Chat choice lasts about four hours). Works signed in or signed out, on a Reduck cloud browser or your own paired browser, in any display language. Signed in, every field is filled, and the account's saved memory can influence the answer. Signed out, ChatGPT shows the answer and its citations but not its searches: `answers`, `references` (with each citation's search result id) and `activity` are filled, and `webSearchQueries`, `searches`, `sources`, `calls`, `model` and `stopReason` are null (unknown, not none).
ChatGPT whoami (signed-in account)
Report which ChatGPT account this browser is signed in as: the user id, email and name. When the browser is signed out of ChatGPT, the run fails with a message asking you to sign in to chatgpt.com, so it can be used to check a session before running other ChatGPT scripts.
Get ChatGPT memory setting
Report whether memory is turned on for the signed-in ChatGPT account: the "Enable memory" switch in Settings > Personalization, which lets ChatGPT use saved memories and past chats to personalize its answers. Requires a signed-in session; a signed-out browser fails with an error that says so. Use set_memory to change it.
