The Pezzo client is an NPM package that allows you to easily integrate your application with Pezzo. The client was built with TypeScript and is type-safe.

Getting Started

Intall the Pezzo Client

Install the @pezzo/client NPM package:

Initialize the Pezzo Client

You only need to initialize the Pezzo client once, and then you can use it throughout your application.

Pezzo automatically looks for the following environment variables:

  • PEZZO_API_KEY: Your Pezzo API key
  • PEZZO_PROJECT_ID: Your Pezzo project ID
  • PEZZO_ENVIRONMENT: The environment you want to use (e.g. Production, which is the default environment created by Pezzo)

Variables found will be used automatically for configuration.

import { Pezzo, PezzoOpenAI } from "@pezzo/client";

// Initialize the Pezzo client and export it
export const pezzo = new Pezzo();

// Initialize PezzoOpenAI and export it
export const openai = new PezzoOpenAI(pezzo);

API Reference

Pezzo.constructor(options: PezzoOptions)
Function
options
PezzoOptions
apiKey
string
default: "process.env.PEZZO_API_KEY"required

Pezzo API key

projectId
string
default: "process.env.PEZZO_PROJECT_ID"required

Pezzo project ID

environment
string
default: "process.env.PEZZO_ENVIRONMENT"required

Pezzo environment name

serverUrl
string
default: "https://api.pezzo.ai"required

Pezzo server URL

Pezzo.getPrompt(promptName: string)
Function
promptName
string

The name of the prompt to retrieve. The prompt must be deployed to the current environment specified when initializing the Pezzo client.