You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

openpipe

Package Overview
Dependencies
Maintainers
3
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openpipe

OpenPipe TypeScript SDK: Fine-Tuning, Inference, and Metrics for Production Apps

1.0.0
latest
npmnpm
Version published
Weekly downloads
37K
15.02%
Maintainers
3
Weekly downloads
 
Created
Source

OpenPipe Node API Library

NPM version

This library wraps TypeScript or Javascript OpenAI API calls and logs additional data to the configured OPENPIPE_BASE_URL for further processing.

It is fully compatible with OpenAI's sdk and logs both streaming and non-streaming requests and responses.

Installation

npm install --save openpipe
# or
yarn add openpipe

Import

ESM

// import OpenAI from "openai"
import OpenAI from "openpipe/openai";

CJS

// const OpenAI = require("openai")
const OpenAI = require("openpipe/openai").default;

Usage

// import OpenAI from "openai"
import OpenAI from "openpipe/openai";

// Fully compatible with original OpenAI initialization
const openai = new OpenAI({
  apiKey: "my api key", // defaults to process.env["OPENAI_API_KEY"]
  // openpipe key is optional
  openpipe: {
    apiKey: "my api key", // defaults to process.env["OPENPIPE_API_KEY"]
    baseUrl: "my url", // defaults to process.env["OPENPIPE_BASE_URL"] or https://api.openpipe.ai/api/v1 if not set
  },
});

async function main() {
  // Allows optional openpipe object
  const completion = await openai.chat.completions.create({
    messages: [{ role: "user", content: "Say this is a test" }],
    model: "gpt-4o",
    // optional
    store: true,
    metadata: {
      prompt_id: "extract_user_intent",
      any_key: "any_value",
    },
  });

  console.log(completion.choices);
}

main();

Keywords

OpenPipe

FAQs

Package last updated on 31 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.