CoolFace
Apppublic

ForgetMe/openai_api_key_status

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
README.md52 linesDownload Raw Back to root
1---2title: Openai/Anthropic Api Key Status3colorFrom: gray4colorTo: green5sdk: gradio6sdk_version: 4.36.17app_file: app.py8pinned: false9license: mit10python_version: 3.11.911duplicated_from: shaocongma/openai_api_key_status12---13 14# OpenAI API Key Status Checker15 16This web app allows you to input your OpenAI API key and get information about your account, GPT-4 availability, API usage, and other related information. 17 18## Usage - Huggingface Spaces191. Go to [OpenAI API Key Status Checker](https://huggingface.co/spaces/shaocongma/openai_api_key_status).202. Enter your OpenAI API key in the provided textbox.213. Click the 'Submit' button to display the information associated with your API key.22 23## Usage - API241. Install `gradio_client`.25```angular2html26pip install gradio_client27```282. Connect the client and call the API.29```python30from gradio_client import Client31 32client = Client("https://shaocongma-openai-api-key-status.hf.space/")33json_file_path = client.predict("sk-......", 34                        api_name="/get_key_info")35```363. Read the output JSON file.37```python38with open(json_file_path, "r") as f:39    result = f.read()40print(result)41```424. Sample output:43```python44# result - valid key45{"account_name": "Peter Parker", "key_availability": true, "gpt4_availability": true, "has_payment_method": true, "used": 10.33174, "limit": 120.0}46# result - invalide key47{"account_name": "", "key_availability": false, "gpt4_availability": "", "has_payment_method": "", "used": "", "limit": ""}48```49 50## License51 52This project is released under the MIT License. Please see the LICENSE file for more information.