Skip to content

Instantly share code, notes, and snippets.

@greencamp20552
Created July 7, 2023 07:25
Show Gist options
  • Select an option

  • Save greencamp20552/bc2fe89cc0d2823a948ead80a002ffb0 to your computer and use it in GitHub Desktop.

Select an option

Save greencamp20552/bc2fe89cc0d2823a948ead80a002ffb0 to your computer and use it in GitHub Desktop.
gpt4-for-dev-tut
import os
import openai
def init_api():
with open(".env") as env:
for line in env:
key, value = line.strip().split("=")
os.environ[key] = value
openai.api_key = os.environ.get("API_KEY")
openai.organization = os.environ.get("ORG_ID")
init_api()
models = openai.Model.list()
print(models)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment