How to Create An OpenAI API KEY

Introduction

Obtaining an API Key from OpenAI is a critical step toward unlocking the power of artificial intelligence in your projects, especially if you’re interested in developing AI assistants. OpenAI offers a range of advanced AI tools, including the renowned GPT-3.5/GPT-4, capable of performing text understanding and generation tasks at an impressive level.

These AI assistants can revolutionize the way we interact with technology, providing automated support, instant responses to frequently asked questions, and unprecedented personalization.

Whether you’re looking to integrate intelligent chatbots into your website, automate complex tasks, or simply explore the vast world of artificial intelligence, obtaining your API Key is the first step toward realizing your ambitions.

In this blog, I’ll guide you through every necessary step to create your own API Key in OpenAI and how to use it to develop AI assistants, from initial registration to advanced configuration, ensuring you have everything you need to confidently embark on your journey into the AI landscape.

1.- Create OpenAI Whisper Token

Enter our OpenAI account and go to:

https://platform.openai.com/apps

Then in the upper right side go to our account.

Select View API keys.

Press the API option and in the menu on the left select API keys.

And we proceed to create a new API key by pressing + Create new secret key.

We select a suitable name to remember and press the Create secret key button.

We copy the secret key since we will not be able to see it again. We will use this later.

2.- Create OpenaAI Assistants

Now we are going to create an Assistants in openAI, for which we go to Assistants in the left menu and press the green “+ Create” button on the right.

Our Assistants will be called A Operator and we will configure the following:

  • Name, friendly name of the Assistants.
  • Instructions, It is very important to enter clear instructions since it depends on whether our Assistants returns the desired data to us. Below is an example of what the instructions should be like:

“Imagine you are a telephone operator, and I am a customer calling for information. Please find and provide only the extension number for the name or department on the document provided. Return a answer that is as short as possible.”

  • Model, we proceed to select the gpt-3.5-turbo-1106 model which is sufficient and more economical. However, we can also use the gtp-4-1106-preview model, but this costs 30 times more.
  • Functions, function calling lets you describe custom functions of your app or external APIs to the assistant. This allows the assistant to intelligently call those functions by outputting a JSON object containing relevant arguments. We will not need this option.
  • Code Interpreter, code Interpreter enables the assistant to write and run code. This tool can process files with diverse data and formatting, and generate files such as graphs. We will not need this option.
  • Retrieval, Retrieval enables the assistant with knowledge from files that you or your user’s upload. Once a file is uploaded, the assistant automatically decides when to retrieve content based on user requests. We need to activate this option and then proceed to upload the file with our Phonebook.
  • Files (Add), We proceed to press “Add” to upload our Phonebook, which should have the following format:
    • Name Extension

 

Finally, press the Save button and it will show us the ID of the Assistants below the name, we proceed to copy it since we will use it later.

We can also use the Embedded model, which is cheaper, and the query is done in a local Chomadb database on the server. Later we will show how to install what is necessary to use this model.

 

Note:

Cost of 1K Tokens de gtp-4-1106-preview: US$ 0.03 (input), US$ 0.06 (output),

Cost of 1K Tokens de gtp-3.5-turbo-1106: US$ 0.001 (input), US$ 0.002(output).

Economic benefit of having an AI Operator

For example, a typical query involves the following phrases:

  • Whisper: “Could you transfer me to James Smith please.” 5 Seconds.
  • Caller inquiry: “Could you transfer me to James Smith please.” 8 tokens.
  • Response from Assistants: “You can reach James Smith at extension number 2000.” 9 tokens.

 

Cost per 1000 interactions

  • Whisper Cost:
    • ((5×1000)/60)) * 0.006 = US$ 0.50
  • Question Cost:
    • ((10×1000)/1000)) * 0.001 = US$ 0.01
  • Answer Cost:
    • ((10×1000)/1000)) * 0.002 = US$ 0.02

Total cost per 1000 interactions: US$ 0.53

Suppose that a Company has around 5,000 calls answered per day, which means a total of approximately 120,000 calls per month, the total cost of managing these 120,000 calls would be (120,000/1000) * 0.53 = US$ 63.60.

An operator normally attends at most 1,250 calls in an 8-hour day, which would be answering a call every 23 seconds. To be able to attend the equivalent of 5,000 calls per day we would need 4 operators, which involves a reasonable cost.

As you can see, the benefit of having an AI Operator is economically favorable in addition to having it 24×7.

Conclusion

Securing an API Key from OpenAI and integrating its advanced AI capabilities into your projects, particularly in the development of AI assistants, can significantly transform your applications, drive innovation, and open up new avenues for exploration in the realm of artificial intelligence.

With your API Key, you gain access to a suite of tools that can change how you interact with technology, solve problems, and create value. AI assistants, powered by OpenAI’s capabilities, not only enhance efficiency but also offer a more natural and enriched interaction with users.

Remember, the journey toward integrating artificial intelligence is continuous, and as you become more familiar with OpenAI’s offerings, you’ll discover even more ways to leverage these tools for your benefit.

Whether you’re building sophisticated AI-powered applications, enhancing user experiences, or automating tasks, your OpenAI API Key is your gateway to a world where the potential for creativity and efficiency is boundless. Embrace the possibilities and let your journey toward creating intelligent AI assistants begin.

Our Latest Post