{"id":18762682,"url":"https://github.com/vinodnextcoder/openai-nodejs","last_synced_at":"2025-12-05T10:30:38.787Z","repository":{"id":173580038,"uuid":"650939275","full_name":"vinodnextcoder/openai-nodejs","owner":"vinodnextcoder","description":"openai nodejs example","archived":false,"fork":false,"pushed_at":"2023-08-02T06:45:59.000Z","size":292,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-29T05:12:10.703Z","etag":null,"topics":["createchatcompletion","createcompletion","createembedding","openai","openai-chatgpt","openai-javascript","openai-node","openai-nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vinodnextcoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-08T06:23:43.000Z","updated_at":"2023-06-08T07:28:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"59d88246-6354-48ca-9b33-71b81c799c3e","html_url":"https://github.com/vinodnextcoder/openai-nodejs","commit_stats":null,"previous_names":["vinodnextcoder/openai-nodejs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinodnextcoder%2Fopenai-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinodnextcoder%2Fopenai-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinodnextcoder%2Fopenai-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinodnextcoder%2Fopenai-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vinodnextcoder","download_url":"https://codeload.github.com/vinodnextcoder/openai-nodejs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239661319,"owners_count":19676404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["createchatcompletion","createcompletion","createembedding","openai","openai-chatgpt","openai-javascript","openai-node","openai-nodejs"],"created_at":"2024-11-07T18:22:45.443Z","updated_at":"2025-12-05T10:30:33.472Z","avatar_url":"https://github.com/vinodnextcoder.png","language":"JavaScript","readme":"# openai-nodejs\n\n# OpenAI Node.js API Usage\nThis repository provides examples of using the OpenAI API with Node.js. It demonstrates how to use three different API endpoints: createEmbedding, createCompletion, and createChatCompletion. Each endpoint serves a specific purpose and has its own usage pattern.\n\n# Prerequisites\nBefore running the examples, make sure you have the following:\n\nNode.js installed on your machine.\nOpenAI API key. You can obtain one from the OpenAI website.\nInstallation\nClone this repository: https://github.com/vinodnextcoder/openai-nodejs\n\n# add api key\n\nOpen the config.js file.\n\nReplace the YOUR_OPENAI_API_KEY sssdsdplaceholder with your actual OpenAI API key.\n\nUsage\nThe repository includes examples for three different API endpoints: createEmbedding, createCompletion, and createChatCompletion. Here's how you can use each of them:\ncurl \ncurl --location 'http://localhost:3000/createEmbedding' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"text\":\"chat\"\n}'\n\ncurl --location 'http://localhost:3000/chatCompletion' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"text\":\"i am going to pune university\"\n}'\n\ncurl --location 'http://localhost:3000/createCompletion' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"text\":\"Write a tagline for an ice cream shop.\"\n}'","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinodnextcoder%2Fopenai-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinodnextcoder%2Fopenai-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinodnextcoder%2Fopenai-nodejs/lists"}