Skip to main content
This integration method is maintained but no longer actively developed. For the best experience and latest features, use our new AI Gateway with unified API access to 100+ models.
  • Python
  • Node (TS)
  • cURL
  • Langchain
Change the api url and add a Helicone-Auth header
import anthropic
client = anthropic.Client(
    api_key="<Anthropic API Key>",
    base_url="https://anthropic.helicone.ai/v1"
)
res = client._request_as_json(
    "post",
    "v1/complete",
    params={
        "prompt": f"{anthropic.HUMAN_PROMPT} How many toes do dogs have?{anthropic.AI_PROMPT}",
        "stop_sequences": [anthropic.HUMAN_PROMPT],
        "model": "claude-v1",
        "max_tokens_to_sample": 300,
    },
    headers={
        "Helicone-Auth": "Bearer <HELICONE_API_KEY>"
    }
)