Written Labs Logo

How to get an OpenAI API key

Learn how to obtain an OpenAI API key with this step-by-step guide. Unlock advanced AI capabilities, integrate intelligent applications, and manage usage easily.

Dobroslav RadosavljevicDRDobroslav Radosavljevic
September 9, 2023·2 min read

This comprehensive guide provides a step-by-step walkthrough for obtaining an OpenAI API key, which unlocks a wide range of AI capabilities.

From creating an OpenAI account to setting up billing and usage limits, the guide covers all the essential steps to get you started.

Ideal for both beginners and experienced developers, this guide aims to simplify the process and help you integrate AI functionalities into your projects seamlessly.

Step 1: Create an OpenAI Account

  1. Visit the OpenAI website.
  2. Click the "Sign Up" button at the top-right corner and fill in your details.

Step 2: Verify Your Account

  1. Check your email for a verification link from OpenAI.
  2. Click the link to confirm your account.

Step 3: Log In to Your Account

  1. Return to the OpenAI website.
  2. Click the "Log In" button and enter your credentials.

Step 4: Navigate to the API Section

  1. After logging in, click on your account name at the top-right corner.
  2. Select "View API keys" from the dropdown menu.

Step 5: Generate a New API Key

  1. Click the "Create new secret key" button.
  2. Name your API key appropriately for future reference.
  3. Click "Create secret key."

Step 6: Save Your API Key

  1. Copy the generated secret key.
  2. Store it securely, as you won't be able to retrieve it again.

Step 7: Set Up Billing

  1. Click "Billing" on the left menu.
  2. Then click on the "Start payment plan" to add a payment method + necessary details about you to activate your API key.

WARNING: You might be charged $5 on your card, but this is only temporary. You get $5 in credits as free bonus for this and your $5 will be refunded soon back.

Step 8: Set Usage Limits

  1. Click "Usage limits" on the left menu.
  2. Set hard and soft usage limits to control your spending.

Step 9: Understand OpenAI's Usage Guidelines

Familiarize yourself with OpenAI's use case policy and terms of use to ensure responsible usage of the technology. If you don't obey OpenAI rules, your account might be banned from using the API.

This can happen, if you for example try to avoid filters for banned words and prompts.