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.
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<br/>cd openai-assistants-quickstart<br/>Set your OpenAI API key export OPENAI_API_KEY="sk_..."<br/> Or rename .env.example to .env and set the value of OPENAI_API_KEY.
Install project dependencies
npm install<br/>Note: This project requires Next.js, which requires Node.js version greater than v18.17.0
Run the project npm run dev<br/> 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.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
