Get started with the Animus REST API in minutes. Learn how to authenticate and make your first API call.
New to Animus? If you’re building a JavaScript/TypeScript browser application, consider our SDK Quickstart for a faster, easier integration experience with built-in conversation management.
Create an API key in the dashboard, which you’ll use to securely access the API. Store the key in a safe location, like a .zshrc file or another text file on your computer. Once you’ve generated an API key, export it as an environment variable in your terminal.
With your Animus API key exported as an environment variable, you’re ready to make your first API request. You can either use the REST API directly with the HTTP client of your choice, or use the OpenAI SDK as shown below.
To use the Animus API in server-side JavaScript environments like Node.js, Deno, or Bun, you can use the official OpenAI SDK for TypeScript and JavaScript. Get started by installing the SDK using npm or your preferred package manager:
With the OpenAI SDK installed, create a file called example.mjs and copy the following example into it:
Copy
Ask AI
import OpenAI from "openai";const openai = new OpenAI({ baseURL: "https://api.animusai.co/v2", apiKey: process.env.ANIMUS_API_KEY,});const completion = await openai.chat.completions.create({ model: "vivian-llama3.1-70b-1.0-fp8", messages: [ { role: "system", content: "You are a warm and empathetic companion." }, { role: "user", content: "Hey there! I've had a really long day and could use someone to talk to.", }, ],});console.log(completion.choices[0].message);
{ role: 'assistant', content: 'I'm so glad you reached out! I'm here for you. Long days can be really draining - would you like to tell me what made today particularly challenging? Sometimes just talking through it can help lighten the load a bit.'}
Building a JavaScript application? Consider using our SDK for automatic authentication, conversation history, streaming, and event handling with just a few lines of code.