Artificial Intelligence 4 min read

OpenAI Assistants API Quickstart Project for Next.js

OpenAI’s open‑source openai‑assistants‑quickstart project shows how to integrate the Assistants API into a Next.js app, offering streaming chat, code‑interpreter, file‑search, and function‑calling tools, and provides step‑by‑step setup instructions so developers can quickly build and customize AI assistants.

Sohu Tech Products
Sohu Tech Products
Sohu Tech Products
OpenAI Assistants API Quickstart Project for Next.js

On May 2nd, OpenAI released an open-source project called openai-assistants-quickstart [1], which demonstrates how to use OpenAI's Assistants API [2] in Next.js.

Assistants API allows you to build AI assistants in your own applications. Assistants have instructions and can leverage models, tools, and files to respond to user queries. The Assistants API currently supports three types of tools: Code Interpreter, File Search, and Function Calling .

This project serves as a template for using the Assistants API in Next.js, including streaming [3], tool usage ( Code Interpreter [4] and File Search [5]), and Function Calling [6]. While there are multiple pages demonstrating these features, they all use the same underlying assistant with all features enabled.

Quick Start

Clone the project

git clone https://github.com/openai/openai-assistants-quickstart.git
cd openai-assistants-quickstart

Set your OpenAI API key

export OPENAI_API_KEY="sk_..."

Or rename .env.example to .env and set the value of OPENAI_API_KEY .

Install project dependencies

npm install
Note: This project requires Next.js, which requires Node.js version greater than v18.17.0

Run the project

npm run dev

Visit http://localhost:3000 in your browser.

In the opened page, click the Create Assistant button to create an assistant, and configure the generated ID in the app/assistant-config.ts file.

After configuring the assistantId , you can see the different feature menus.

Feature Pages

Basic Chat

Function Calling

File Search

Full Features

For those who want to develop their own AI assistants, this Next.js project serves as a helpful reference.

StreamingOpenAIfunction callingAI AssistantNext.jsAssistants APICode Interpreterfile-search
Sohu Tech Products
Written by

Sohu Tech Products

A knowledge-sharing platform for Sohu's technology products. As a leading Chinese internet brand with media, video, search, and gaming services and over 700 million users, Sohu continuously drives tech innovation and practice. We’ll share practical insights and tech news here.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.