🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@robinpath/openai

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@robinpath/openai

OpenAI integration — chat completions, embeddings, image generation, transcription, moderation. Uses the encrypted credential vault for API keys.

latest
npmnpm
Version
0.3.0
Version published
Maintainers
4
Created
Source

@robinpath/openai

OpenAI module for RobinPath.

Category Functions Auth License

Why use this module?

The openai module lets you:

  • Send a chat completion request to OpenAI
  • Send a legacy completion request
  • Generate images using DALL-E
  • Edit an image using DALL-E with an optional mask
  • Create a variation of an existing image

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

robinpath add @robinpath/openai

Quick Start

1. Set up credentials

openai.setApiKey "sk-..."

2. Send a chat completion request to OpenAI

openai.chat "Hello, how are you?" {"model": "gpt-4o"}

Available Functions

FunctionDescription
openai.setApiKeySet the OpenAI API key for authentication
openai.chatSend a chat completion request to OpenAI
openai.completeSend a legacy completion request
openai.generateImageGenerate images using DALL-E
openai.editImageEdit an image using DALL-E with an optional mask
openai.createImageVariationCreate a variation of an existing image
openai.transcribeTranscribe audio to text using Whisper
openai.translateTranslate audio to English text using Whisper
openai.speakConvert text to speech using TTS
openai.createEmbeddingGenerate text embeddings
openai.createModerationCheck text for content policy violations
openai.listModelsList all available OpenAI models
openai.getModelGet details of a specific model
openai.uploadFileUpload a file to OpenAI
openai.listFilesList uploaded files
openai.deleteFileDelete an uploaded file
openai.getFileContentGet the content of an uploaded file
openai.createFineTuneCreate a fine-tuning job
openai.listFineTunesList fine-tuning jobs
openai.getFineTuneGet details of a fine-tuning job
openai.cancelFineTuneCancel a running fine-tuning job
openai.createBatchCreate a batch processing request
openai.getBatchGet details of a batch request
openai.listBatchesList batch requests
openai.cancelBatchCancel a batch request

Examples

Send a chat completion request to OpenAI

openai.chat "Hello, how are you?" {"model": "gpt-4o"}

Send a legacy completion request

openai.complete "Once upon a time"

Generate images using DALL-E

openai.generateImage "A sunset over mountains" {"model": "dall-e-3", "size": "1024x1024"}

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/openai";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  openai.setApiKey "sk-..."
  openai.chat "Hello, how are you?" {"model": "gpt-4o"}
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

License

MIT

Keywords

openai

FAQs

Package last updated on 06 May 2026

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