Proxy Integration

1

Create an account + Generate an API Key

Log into www.helicone.ai or create an account. Once you have an account, you can generate an API key.

2

Set HELICONE_API_KEY as an environment variable

export HELICONE_API_KEY=<your API key>
3

Modify the base path and add a Helicone-Auth header

import anthropic

client = anthropic.Anthropic(
  api_key=os.environ.get("ANTHROPIC_API_KEY"),
  base_url="https://anthropic.hconeai.com/v1"
  defaultHeaders={
    "Helicone-Auth": os.environ.get("HELICONE_API_KEY"),
  },
)

client.messages.create(
  model="claude-3-opus-20240229",
  max_tokens=1024,
  messages=[
    {"role": "user", "content": "Hello, world"}
  ]
)