New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@purinton/openai

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@purinton/openai

A simple OpenAI API client wrapper for Node.js, with ESM and TypeScript support.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Purinton Dev

@purinton/openai npm versionlicensebuild status

A simple OpenAI API client wrapper for Node.js, with ESM and TypeScript support.

Table of Contents

Features

  • Minimal wrapper for the official OpenAI Node.js SDK
  • ESM-first and TypeScript-ready
  • Simple API key management (env or parameter)
  • Example usage and tests included

Installation

npm install @purinton/openai

Usage

import { createOpenAI } from '@purinton/openai';

(async () => {
  // Optionally pass your API key, or set OPENAI_API_KEY in your environment
  const openai = await createOpenAI();
  // Example: list models
  // const models = await openai.models.list();
  // console.log(models);
})();

API

createOpenAI(apiKey?: string): Promise<OpenAI>

Creates and returns a new OpenAI client instance. If apiKey is not provided, it will use process.env.OPENAI_API_KEY.

  • apiKey (optional): Your OpenAI API key. If omitted, the function will use the OPENAI_API_KEY environment variable.
  • Returns: A Promise that resolves to an OpenAI client instance.
  • Throws: If no API key is provided.

TypeScript

Type definitions are included:

import { createOpenAI } from '@purinton/openai';
import type OpenAI from 'openai';
const openai: OpenAI = await createOpenAI();

Support

For help, questions, or to chat with the author and community, visit:

DiscordPurinton Dev

Purinton Dev on Discord

License

MIT © 2025 Russell Purinton

Keywords

openai

FAQs

Package last updated on 11 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts