Promptly Node.js SDK

Official Node.js SDK - TypeScript-first, zero config

Install the Promptly SDK for Node.js and start saving immediately. Extends the OpenAI client with Promptly defaults.


Setup Guide

1

Install the SDK

Works with Node.js 18+ and any TypeScript project.

bash
npm install promptly-sdk
2

Create a Client

Extends the official OpenAI Node.js SDK. Full TypeScript types included.

typescript
import Promptly from "promptly-sdk";

const client = new Promptly({ apiKey: "sk-promptly-..." });

const response = await client.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);
3

Or Wrap an Existing Client

Already using the OpenAI SDK? Wrap your existing client instance to route through Promptly.

typescript
import OpenAI from "openai";
      import { wrap } from "promptly-sdk";

const client = wrap(new OpenAI({ apiKey: "sk-promptly-..." }));
// All existing code works unchanged

Why Use Promptly with Promptly Node.js SDK?

  • One-line install - npm install promptly-sdk
  • Full TypeScript support with type definitions
  • wrap() existing OpenAI clients instantly
  • Streaming and all OpenAI features supported
  • Works with Next.js, Express, Fastify, and more

Start optimizing Promptly Node.js SDK costs

Sign up, grab your API key, and change your base URL. Under 2 minutes.