Skip to content
Discussion options

You must be logged in to vote

Hi! Welcome to the OpenAI Python SDK community!

If you're just getting started with Python and want to build AI-powered applications, the official OpenAI Python library is a great place to begin.

1. Install the library

Make sure Python is installed, then install the SDK using pip:

pip install openai

2. Set up your API key

Create an API key from the [OpenAI API dashboard](https://platform.openai.com/api-keys) and store it in an environment variable rather than hardcoding it in your Python script.

On Windows PowerShell:

$env:OPENAI_API_KEY="your-api-key"

On macOS or Linux:

export OPENAI_API_KEY="your-api-key"

Keep your API key private and never commit it to GitHub.

3. Make your first API call

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bits-4-bittu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants