Providers & Models
Anthropic

Anthropic

Before you start

  1. Obtain an Anthropic API key here (opens in a new tab).
  2. Make sure the ANTHROPIC_API_KEY environment variable is set.

Usage

import { UniLLM } from 'unillm';
 
/*
  #SETUP#
*/
 
// Setup UniLLM
const unillm = new UniLLM();
 
// Use any LLM provider and model
const response = await unillm.createChatCompletion("#MODEL#", {
  temperature: 0,
  messages: [
    {
      role: "user",
      content: "How are you?"
    }
  ]
})