Loading video player…

Obtaining an API Key

Resource mentioned in this lesson: OpenAI Platform

00:00 In this lesson, you’re going to start setting up your environment. So the first thing to do is to obtain your API key, then you’re going to have to securely store that key. Thirdly, you’ll have to set up a virtual environment, and then finally you’ll have to install the openai package in that virtual environment.

00:21 But let’s start with step one, how to obtain your API key. Now the way to do that is to go to platform.openai.com and then go to the top right of the screen and you’ll find a cog there. And if you hover over the cog, it’ll say Settings, and please click on Settings.

00:43 Once you’ve clicked on Settings, then please go to the left-hand side of the screen and there’s a vertical menu and then select API keys and click on that.

00:53 Once you’ve clicked on API keys, you need to look for a button that says Create new secret key. If this is the first key that you’re creating, then this button will appear in the middle of the screen as well as at the top right.

01:08 Now if you already have keys like I have, then that button will only appear at the top right of your screen. Wherever you can find it, please click the button that says Create new secret key. And then a box should appear where you can create your new secret key.

01:26 So you need to fill in some boxes there. So the name, I’ve just chosen something that I’ll remember. So Python Tutorial Key, that’ll make it obvious to me why I’ve created that key.

01:37 And then as project, I just selected default and for permissions, please select All. And then at the bottom right of that little pop-up box, if you like, click the black Create secret key button.

01:53 Once you’ve done that, your secret key will appear on screen. Well, part of it anyway. Now it’s very important that you copy this immediately using the Copy button that you can see highlighted on the screen here, because once you close this, you won’t be able to get this key ever again. So please copy it.

02:12 And then the next step, which you’ll cover in the next lesson, is how to safely store this secret key.

Become a Member to join the conversation.