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>
LLAMA_API_KEY=<your-llama-api-key>
3

Modify the base URL path and set up authentication

import os
from llama_api_client import LlamaAPIClient

# Load environment variables
helicone_api_key = os.getenv("HELICONE_API_KEY")
llama_api_key = os.getenv("LLAMA_API_KEY")

client = LlamaAPIClient(
    api_key=llama_api_key,
    base_url="https://llama.helicone.ai/v1",
    default_headers={
        "Helicone-Auth": f"Bearer {helicone_api_key}"
    }
)

completion = client.chat.completions.create(
    model="Llama-4-Maverick-17B-128E-Instruct-FP8",
    messages=[
        {
            "role": "user",
            "content": "What is the moon made of?",
        }
    ],
)

print(completion.completion_message.content.text)
4

Verify your requests in Helicone

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