openai/openai-quickstart-node
openai/openai-quickstart-node has 2,646 GitHub stars and 1,929 forks. GitHot measured 0 stars in 24 hours and -1 in 7 days. Last checked 2026-11-12 14:14 UTC. Last push 2025-09-24.
Node.js example app from the OpenAI API quickstart tutorial
측정된 스타 증가
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- 업데이트 지연
- in 1 month
- 업데이트 지연
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalOpenAI API Quickstart - Node.js
This repository provides a collection of examples demonstrating how to use the OpenAI APIs with the Node.js SDK.
The examples are organized by API, with each folder dedicated to a specific API:
- Chat Completions
- Assistants
- Fine-tuning
- Embeddings
- Moderation
- Batch Processing
- Images
Within each folder, you'll find a basic example to get started. For some APIs, additional examples are also included to explore more advanced use cases.
Prerequisites
To run the examples with the Node.js SDK, you will need:
- A recent version of Node.js (>= 16.0.0)
- A recent version of npm or another node package manager
- An OpenAI API key (you can get one from your OpenAI dashboard)
How to use
Clone this repository
$ git clone https://github.com/openai/openai-quickstart-node.gitNavigate into the project directory
$ cd openai-quickstart-nodeInstall the OpenAI Node.js SDK
$ npm install openaiSet your OpenAI API key in environment variables
In the terminal session:
Bash (Mac/Linux):
$ export OPENAI_API_KEY=<your-api-key>PowerShell (Windows):
$ setx OPENAI_API_KEY "<your_api_key>"Set it globally:
Add this line to your
.bashrcor.zshrcfile on Mac/Linux:$ export OPENAI_API_KEY=<your-api-key>Or update your system environment variables on Windows.
Run each script individually
$ node path/to/script.jsFor example, to run the basic chat completions example:
$ node chat_completions/index.js
Examples
Explore the examples below to learn how to use the Node.js SDK for your specific use case.
| API | Example | Path |
|---|---|---|
| Chat Completions | Basic example | chat_completions/index.js |
| Multi-turn conversation | chat_completions/multi_turn.js | |
| Function Calling | chat_completions/function_calling.js | |
| Vision (image input) | chat_completions/vision.js | |
| Assistants | Create an assistant | assistants/index.js |
| Example thread | assistants/thread.js {assistant-id} | |
| Fine-tuning | Create a fine-tuned model | fine_tuning/index.js |
| Use a fine-tuned model | fine_tuning/use_model.js {job-id} | |
| Embeddings | Generate embeddings | embeddings/index.js |
| Moderation | Moderate text | moderation/index.js |
| Moderate images & text | moderation/images.js | |
| Batch | Create a batch job | batch/index.js |
| Get batch job results | batch/retrieve_results.js {job-id} | |
| Images | Generate an image | images/index.js |
Additional Resources
For more in-depth examples within front-end applications, including with streaming responses, check out these additional resources:
관련 프로젝트 살펴보기
sindresorhus/awesome
😎 온갖 흥미로운 주제에 관한 Awesome 목록 [참고: 기존 풀 리퀘스트를 따라잡을 여유가 생길 때까지 풀 리퀘스트가 일시적으로 비활성화되어 있습니다]
536,044 스타EbookFoundation/free-programming-books
:books: 무료로 이용할 수 있는 프로그래밍 도서
401,511 스타nilbuild/developer-roadmap
개발자의 커리어 성장을 돕는 인터랙티브 로드맵, 가이드 및 기타 교육 콘텐츠.
371,926 스타vinta/awesome-python
“Python으로 X를 하고 싶은데, 어떤 도구를 써야 할까?”에 답하는 결정판 목록.
334,381 스타