Helicone

helicone-helpers 1.0.3 (optional stub) · active · verified Sat Feb 28

Open-source LLM observability platform using a proxy-based architecture. Unlike LangSmith or Langfuse, Helicone requires NO Python SDK install for core tracing — it works by routing requests through its AI gateway (https://ai-gateway.helicone.ai) via a base_url override on the OpenAI/Anthropic client. All logging happens at the proxy layer. The 'helicone' PyPI package (helicone-helpers) is a thin optional helper with minimal functionality. Primary integration is via HTTP headers and base_url, not a Python library.

Warnings

Install

Imports

Quickstart

Helicone's entire Python integration is a base_url change. No import, no decorator, no SDK call. Features like caching, rate limiting, user tracking, and prompt versioning are all controlled via HTTP headers added to default_headers.

import os
import openai

# Core integration: change base_url, add auth header
# No pip install needed beyond openai
client = openai.OpenAI(
    api_key=os.environ['OPENAI_API_KEY'],
    base_url='https://ai-gateway.helicone.ai/openai/v1',
    default_headers={
        'Helicone-Auth': f'Bearer {os.environ["HELICONE_API_KEY"]}',
    }
)

response = client.chat.completions.create(
    model='gpt-4o',
    messages=[{'role': 'user', 'content': 'Hello!'}]
)
# Request is now logged in your Helicone dashboard

# Add metadata via headers
client_with_metadata = openai.OpenAI(
    api_key=os.environ['OPENAI_API_KEY'],
    base_url='https://ai-gateway.helicone.ai/openai/v1',
    default_headers={
        'Helicone-Auth': f'Bearer {os.environ["HELICONE_API_KEY"]}',
        'Helicone-User-Id': 'user-123',           # per-user tracking
        'Helicone-Session-Id': 'session-abc',      # session grouping
        'Helicone-Cache-Enabled': 'true',          # response caching
    }
)

# Anthropic integration
import anthropic
client_anthropic = anthropic.Anthropic(
    api_key=os.environ['ANTHROPIC_API_KEY'],
    base_url='https://ai-gateway.helicone.ai/anthropic',
    default_headers={
        'Helicone-Auth': f'Bearer {os.environ["HELICONE_API_KEY"]}',
    }
)

view raw JSON →