Unleash OpenAI’s AI Assistant with this NodeJs Internet Integration Tutorial

By connecting OpenAI’s AI assistant with external APIs, you can create a smart SEO assistant that analyzes user-provided keywords and returns organic search results. Using GPT-4 model and Surf API, you can call external functions to enhance the AI’s knowledge. With proper setup and coding, the AI assistant can provide suggestions for blog post titles based on top organic results. It’s a game-changer for SEO strategy! 🚀 #AIassistant #SEOstrategy

Creating the AI Assistant

To start, we need to create our AI assistant through code or the user interface from OpenAI. In this case, we’ll create an SEO assistant that analyzes user-provided keywords and returns organic results based on the keyword. We’ll also add a function called "tools" that will access an external API to retrieve these organic results.

Choosing the GPT-4 Model

To ensure accuracy, we’ll be using the GPT-4 model for our AI assistant instead of GPT-3.5, as there were errors when using the latter to extract specific keywords or sections from user prompts.

Setting Up the Necessary Keys

Before diving into the code, we’ll need to register at Surf API and obtain an API key. This key, along with the OpenAI API key and the assistant ID from the OpenAI user interface, will be crucial for the implementation.

Implementing the Code

We’ll need to install both Surf API and OpenAI packages in the directory. Then, by utilizing the "getJson" method from Surf API and the appropriate routing in Node.js, we can set up our AI assistant and assign the necessary keys.

Testing the AI Assistant

Using Postman, we can simulate the API request and test our AI assistant, ensuring that it can successfully access the external API and return the desired information based on user prompts.

Monitoring the Output

We’ll monitor the AI assistant’s response, particularly when it requires an external function or API call based on the user’s prompts. This will demonstrate the AI’s capability to determine when to utilize external functions and when to rely on its existing knowledge.


With the implementation of the AI assistant connected to the internet, we have successfully created a functional system that can analyze user-provided keywords and access external APIs to retrieve relevant information. This opens up numerous possibilities for creating AI-driven applications and services. Thank you for watching, and stay tuned for the next video!

About the Author

About the Channel:

Share the Post: