Not sure whether to use the Animus SDK or REST API? This guide will help you choose the best approach based on your project requirements, technical constraints, and development preferences.
✅ Minimal Setup: One import, one configuration object
✅ Automatic Authentication: Secure token handling with refresh
✅ Built-in Events: React to messages, images, and errors
✅ Conversation Management: Automatic history and context
✅ Streaming Made Easy: AsyncIterable pattern for real-time responses
✅ Image Generation: Automatic detection and generation
✅ TypeScript Support: Full type safety and autocomplete
✅ Error Handling: Specific error types for different scenarios
// Complete chat setup in 3 linesimport { AnimusClient } from 'animus-client';const client = new AnimusClient({ tokenProviderUrl: 'your-auth-server' });client.on('messageComplete', (data) => console.log('Friend:', data.content));client.chat.send('Hey, how has your day been?');
✅ Universal Language Support: Works with any programming language
✅ Maximum Flexibility: Full control over requests and responses
✅ Server-Side Integration: Perfect for backend services
✅ Existing Infrastructure: Integrate with current HTTP clients
✅ Batch Operations: Process multiple requests efficiently
✅ Custom Authentication: Implement your own auth patterns
// Natural conversation with automatic historyclient.on('messageComplete', (data) => updateChatUI(data.content));client.chat.send(userInput);
📱 Real-time Applications
Copy
Ask AI
// Streaming responses with eventsconst stream = await client.chat.completions({ stream: true });for await (const chunk of stream) { updateUI(chunk.choices[0].delta.content);}
🎨 Creative Tools
Copy
Ask AI
// Automatic image generationclient.on('imageGenerationComplete', (data) => displayImage(data.imageUrl));client.chat.send('I need some inspiration today, could you create something beautiful?');
🔄 Interactive Experiences
Copy
Ask AI
// Conversational turns with natural delaysconst client = new AnimusClient({ chat: { systemMessage: 'You are a caring companion.', autoTurn: true // Natural conversation flow }});
Still unsure? Start with the SDK if you’re building a browser application with JavaScript/TypeScript. You can always switch to the REST API later if you need more control or different language support.