1

Create an account and generate an API key

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

Set up your Helicone API key in your .env file

HELICONE_API_KEY=<your-helicone-api-key>
OPENAI_API_KEY=<your-openai-api-key>
3

Set up your OpenAI base URL

import os
from dotenv import load_dotenv
from llama_index.core import Settings
from llama_index.llms.openai import OpenAI

load_dotenv()

helicone_api_key = os.getenv("HELICONE_API_KEY")
openai_api_key = os.getenv("OPENAI_API_KEY")

Settings.llm = OpenAI(
  base_url="https://oai.helicone.ai/v1",
  api_key=openai_api_key,
  default_headers={
    "Helicone-Auth": f"Bearer {helicone_api_key}"
  }
)
4

Use the LlamaIndex SDK

python
  response = OpenAI().complete("What is the meaning of life?")
  print(response)
5

Verify your requests in Helicone

With the above setup, any calls to OpenAI will automatically be logged and monitored by Helicone. Review them in your Helicone dashboard.