Anthropic
Anthropic JavaScript SDK Integration
Use Anthropic’s JavaScript SDK to integrate with Helicone to log your Anthropic LLM usage.
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use Anthropic’s JavaScript SDK to integrate with Helicone to log your Anthropic LLM usage.
Set HELICONE_API_KEY as an environment variable
HELICONE_API_KEY=<your API key>
Modify the base path and add a Helicone-Auth header
import Anthropic from "@anthropic-ai/sdk";
const anthropic = new Anthropic({
baseURL: "https://anthropic.helicone.ai",
apiKey: process.env.ANTHROPIC_API_KEY,
defaultHeaders: {
"Helicone-Auth": `Bearer ${process.env.HELICONE_API_KEY}`,
},
});
await anthropic.messages.create({
model: "claude-3-opus-20240229",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello, world" }],
});
Was this page helpful?