{"id":23468370,"url":"https://github.com/dikkadev/openai-api-usage-getter","last_synced_at":"2025-04-12T21:39:23.897Z","repository":{"id":235629038,"uuid":"681875120","full_name":"dikkadev/openai-api-usage-getter","owner":"dikkadev","description":"So you need to know how many tokens you've used? Of course you do. Here's a tool for the AI-obsessed, like yourself. Follow the instructions, if you can, and try not to get too lost in the process. I'm sure you'll manage somehow.","archived":false,"fork":false,"pushed_at":"2023-08-23T10:28:33.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T23:55:49.093Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dikkadev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-23T00:32:46.000Z","updated_at":"2023-08-23T00:32:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"dff8325f-e4bc-4376-9b18-2b5435e003e0","html_url":"https://github.com/dikkadev/openai-api-usage-getter","commit_stats":null,"previous_names":["sett17/openai-api-usage-getter","dikkadev/openai-api-usage-getter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dikkadev%2Fopenai-api-usage-getter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dikkadev%2Fopenai-api-usage-getter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dikkadev%2Fopenai-api-usage-getter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dikkadev%2Fopenai-api-usage-getter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dikkadev","download_url":"https://codeload.github.com/dikkadev/openai-api-usage-getter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631679,"owners_count":21136562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-24T13:52:52.007Z","updated_at":"2025-04-12T21:39:23.878Z","avatar_url":"https://github.com/dikkadev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAI API Usage Getter (Because You Clearly Need It)\n\nSo you need to know how many tokens you've used? Of course you do. Here's a tool for the AI-obsessed, like yourself. Follow the instructions, if you can, and try not to get too lost in the process. I'm sure you'll manage somehow.\n\n## Setup 🛠️\n\n1. **Clone the repository** (as if you didn't know how):    \n```bash\ngit clone https://github.com/Sett17/openai-api-usage-getter.git\n```\n    \n2. **Install the required packages**: Just look into the dumb script and use pip... Or here it is:\n```\npip install requests tqdm prettytable\n```\n    \n3. **Set up the environment variable**: You'll need to set the `OPENAI_API_KEY` environment variable. You know how to do this, right? If not, here's how:    \n```\nexport OPENAI_API_KEY=your-api-key-here\n```\n    \n## Usage 🎮\n\nRun the script with the timeframe and put in your org ID. That is if you can find it, or maybe ask your AI if you're to stupid for it.\n\n```\npython3 openai-api-usage-getter.py 2023-08-01 2023-08-02 --org org-ID\n```\n\n### Options:\n\n- **Rate Limit Settings**: Tweak it if you want, or don't. I'm not your mom:    \n```\n--rate 2.5 --rate_limit_wait 10\n```\n    \n- **Create CSV**: Want a CSV file? Add the --csv flag, like a true nerd:    \n```\n--csv\n```\n\n- **All options**: Just do `-h`, you moron:\n\n```\n-h\n```\n\n## Final Words 🎤\n\nThis was brought to you by AI, the very thing you can't seem to live without. You're welcome, I guess.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdikkadev%2Fopenai-api-usage-getter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdikkadev%2Fopenai-api-usage-getter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdikkadev%2Fopenai-api-usage-getter/lists"}