Helicone

Helicone is a platform that enables you to build dependable AI applications by providing an AI gateway along with observability tools for monitoring and optimizing LLM usage.

1.1 API Configuration

Method 1: Helicone AI Gateway

Helicone can forward your requests to your inference API using the Helicone-Target-URL header:

import openai

client = openai.OpenAI(
    api_key="YOUR_RYGEN_API_KEY",
    base_url="https://ai-gateway.helicone.ai/v1",
    default_headers={
        "Helicone-Auth": "Bearer YOUR_HELICONE_API_KEY",
        "Helicone-Target-URL": "https://api.rygen.io/v1"
    }
)

response = client.chat.completions.create(
    model="your-model-name",
    messages=[{"role": "user", "content": "Hi there!"}]
)

Method 2: Self-Hosted Helicone

export RYGEN_API_KEY="sk-your-rygen-api-key"
export HELICONE_API_KEY="sk-helicone..."

curl --request POST \
  --url http://localhost:8585/v1/gateway/oai/v1/chat/completions \
  --header "Authorization: Bearer $RYGEN_API_KEY" \
  --header "Helicone-Auth: Bearer $HELICONE_API_KEY" \
  --header "Helicone-Target-URL: https://api.rygen.io/v1" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "your-model-name",
    "messages": [{"role": "user", "content": "Hi, How are you doing?"}]
  }'

1.2 References