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.
1

Create an account and generate an API key

Log into Helicone or create an account. Once you have an account, you can generate an API key here.
2

Set up your Helicone API key in your .env file

HELICONE_API_KEY=<your-helicone-api-key>
LLAMA_API_KEY=<your-llama-api-key>
3

Modify the base URL path and set up authentication

import LlamaAPIClient from 'llama-api-client';

const client = new LlamaAPIClient({
  apiKey: process.env.LLAMA_API_KEY,
  baseURL: "https://llama.helicone.ai/v1",
  defaultHeaders: {
    "Helicone-Auth": `Bearer ${process.env.HELICONE_API_KEY}`
  }
});

const response = await client.chat.completions.create({
  model: 'Llama-4-Maverick-17B-128E-Instruct-FP8',
  messages: [
    {
      role: 'user', 
      content: 'Hello, how are you?' 
    }
  ],
  max_completion_tokens: 1024,
  temperature: 0.7,
});

console.log(response);
4

Verify your requests in Helicone

With the above setup, any calls to Llama will automatically be logged and monitored by Helicone. Review them in your Helicone dashboard.