Note: Custom
Properties
are available in
metadata starting with LiteLLM version 1.41.23.1 line integration
AddHELICONE_API_KEY to your environment variables.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Connect Helicone with LiteLLM using callbacks to log and monitor API calls across various AI models.
metadata starting with LiteLLM version 1.41.23."role": "system" messages in Helicone logs. This is because LiteLLM processes the request before sending it to Helicone.For full system instruction support, consider using proxy-based integration instead.HELICONE_API_KEY to your environment variables.
export HELICONE_API_KEY=sk-<your-api-key>
# You can also set it in your code (See below)
litellm.success_callback=["helicone"]
from litellm import completion
import os
## set env variables
os.environ["HELICONE_API_KEY"] = "your-helicone-key"
os.environ["OPENAI_API_KEY"], os.environ["COHERE_API_KEY"] = "", ""
# set callbacks
litellm.success_callback=["helicone"]
#openai call
response = completion(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hi π - i'm openai"}],
metadata={
"Helicone-Property-Hello": "World"
}
)
#cohere call
response = completion(
model="command-r",
messages=[{"role": "user", "content": "Hi π - i'm cohere"}],
metadata={
"Helicone-Property-Hello": "World"
}
)
print(response)
Was this page helpful?