Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleHow to test this API & get an API key

In order to test the API we need to get an API Key:

  • OpenAI provides a free tier for the GPT-3 API that allows developers to experiment with the API and build small-scale applications without incurring any costs.

  • The free tier provides access to a limited number of API requests per month, after which you will need to upgrade to a paid plan to continue using the API.
  • It's important to note that the availability and terms of these resources may change over time, so it's best to check with OpenAI directly for the most up-to-date information on their programs and offerings.
  • Supported languages: it provides several SDKs and libraries to use the API in different programming languages, including Python, Node.js, Java, Ruby, C#
  • I've found 2 ways to get an API Key:
    • Expand
      titleApply for access

      Steps: 

      Note that in the new documentation we can't find GPT-3 we find GPT-4

      • Go to the OpenAI website: Visit the OpenAI website at https://openai.com/.
      • Click on "Products": From the OpenAI homepage, click on the "Products" tab located in the top navigation menu.
      • Click on "GPT-3": From the Products page, click on the "GPT-3" option to learn more about the API.
      • Click on "Apply for Access": Once you have reviewed the information about the GPT-3 API, click on the "Apply for Access" button located on the GPT-3 page.
      • Fill out the application form: Fill out the application form with your personal and project information. You will need to provide information about your intended use of the API, as well as your technical expertise and experience.
      • Agree to the terms: Read and agree to the terms of the GPT-3 API access agreement.
      • Submit your application: Once you have completed the application form and agreed to the terms, submit your application for review.
      • Wait for approval: The review process can take several weeks, and not all applications are approved. If your application is approved, you will receive an email with instructions on how to set up your account and obtain an API key.
      • Set up your account: Follow the instructions in the email to set up your OpenAI account. You will need to create a password and verify your email address.
      • Obtain your API key: Once your account is set up, log in to the OpenAI developer dashboard (https://beta.openai.com/login/) and navigate to the API keys section. Here you will find your API key, which you can copy and use in your application.
    • Expand
      titleGenerate an API Key for specific model for ex. for text-davinci-003
      1. Go to the OpenAI website at https://openai.com/.
      2. Click on the "Get Started for Free" button in the top right corner of the page.
      3. Sign up for an OpenAI account by providing your email address and a password.
      4. Once you've signed up, log in to your OpenAI account.
      5. Navigate to the API Keys section of your account dashboard.
      6. Create a new API key by clicking the "New API Key" button.
      7. Select the text-davinci-003 model from the dropdown menu of available models.
      8. Give your API key a name and description, if desired.
      9. Click the "Create API Key" button to generate your new API key.
Expand
titleTokens number limitation
  • You can think of tokens as pieces of words, where 1,000 tokens is about 750 words.
  • It depends on the model used, for example for text-davinci-003 requests can use up to 4097 tokens shared between prompt and completion. If your prompt is 4000 tokens, your completion can be 97 tokens at most.
  • The limit is currently a technical limitation
  • Solution: there are often creative ways to solve problems within the limit, e.g. condensing the prompt, breaking the text into smaller pieces, etc.