This does not use the Helicone Proxy. For more information on Async Logging, see the Proxy vs Async page.


Create an account + Generate an API Key

Log into or create an account. Once you have an account, you can generate an API key.


Set HELICONE_API_KEY as an environment variable

export HELICONE_API_KEY=<your API key>

Install Helicone

npm install @helicone/helicone

Replace the imports and add Helicone authorizations

const { HeliconeAsyncOpenAI as OpenAI,
  IHeliconeAsyncClientOptions as ClientOptions } = require("helicone");

const openai = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY,
  heliconeMeta: {
    apiKey: process.env.HELICONE_API_KEY, // Can be set as env variable
    // ... additional helicone meta fields

const chatCompletion = await{
  model: "gpt-3.5-turbo",
  messages: [{ role: "user", content: "Hello world" }],