1

Create an account + Generate an API Key

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

2

Set HELICONE_API_KEY as an environment variable

export HELICONE_API_KEY=<your API key>
3

Modify the base path and add a Helicone-Auth header

client = OpenAI(
  api_key="your-api-key-here",  # Replace with your OpenAI API key
  base_url="https://oai.hconeai.com/v1",  # Set the API endpoint
  default_headers= {  # Optionally set default headers or set per request (see below)
    "Helicone-Auth": f"Bearer {HELICONE_API_KEY}",
  }
)

Package Integration

1

Create an account + Generate an API Key

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

2

Set HELICONE_API_KEY as an environment variable

export HELICONE_API_KEY=<your API key>
3

Install the Helicone package

pip install helicone
4

Modify OpenAI import to use Helicone

from helicone.openai_proxy import openai # replace `import openai` with this line
5

That's it! You're ready to start logging with Helicone. Here's an example of using Helicone along with our advanced features as parameters

import OpenAI from "openai";

const openai = new OpenAI({
    apiKey: request.env.OPENAI_API_KEY,
    baseURL: "https://oai.hconeai.com/v1",
    defaultHeaders: {
        "Helicone-Auth": `Bearer ${request.env.HELICONE_API_KEY}`,
    },
});