Odin AI SDK
The Odin AI SDK provides a comprehensive TypeScript/JavaScript library for integrating Odin AI’s powerful features into your applications. Build chat interfaces, manage structured data, enable voice conversations, and leverage AI agents programmatically.What is the SDK?
The Odin AI SDK is a TypeScript library that provides programmatic access to Odin AI’s core features:- ChatSDK: Build conversational AI interfaces with chat management, message handling, and streaming responses
- SmartTablesSDK: Manage structured data tables with advanced querying, filtering, and AI-powered data processing
- VoiceSDK: Enable voice conversations with automatic chat integration and React hooks
Installation
Quick Start
Basic Setup
Authentication
The SDK supports two authentication methods:1. API Key Authentication (Recommended for Server-Side)
Use API keys for server-to-server communication and external integrations:- Navigate to My Account > API Keys in your Odin AI dashboard
- Create a new API key pair
- Copy the API Key and API Secret
- Store them securely (use environment variables, never commit to version control)
2. Access Token Authentication (For Web Apps)
Use access tokens for client-side applications with existing user sessions:SDK Components
ChatSDK
Build conversational AI interfaces with comprehensive chat management. Key Features:- Create, list, and manage chats
- Send messages with streaming support
- Knowledge base integration
- File uploads (images, documents)
- User feedback (thumbs up/down)
- Custom agents and models
SmartTablesSDK
Manage structured data with advanced querying and AI-powered processing. Key Features:- Create and manage data tables
- Advanced filtering and sorting
- Data import/export (CSV, Excel)
- AI-powered column computation
- Custom views and column management
- Pagination and search
VoiceSDK
Enable voice conversations with automatic chat integration. Key Features:- Real-time voice conversations
- Automatic transcription
- React hooks for easy integration
- Audio visualization
- Session management
- Chat integration
Common Use Cases
1. Customer Support Chatbot
2. Data Management Application
3. Voice-Enabled Application
Environment Variables
For production applications, always use environment variables:Error Handling
All SDK methods throw errors that should be caught and handled:TypeScript Support
The SDK is written in TypeScript and provides full type definitions:React Integration
The SDK includes React hooks for easy integration:Best Practices
1. Use Environment Variables
Never hardcode API keys or secrets in your code. Always use environment variables.2. Handle Errors Gracefully
Always wrap SDK calls in try-catch blocks and provide meaningful error messages to users.3. Reuse SDK Instances
Create SDK instances once and reuse them rather than creating new instances for each operation.4. Use Streaming for Better UX
For chat applications, use streaming responses for real-time feedback:5. Implement Pagination
When listing chats or querying tables, always implement pagination:Getting Help
- Documentation: Browse the detailed documentation for each SDK component
- Support: Email support@getodin.ai for technical assistance
- Examples: Check the SDK repository for complete working examples
Next Steps
- Chat SDK Documentation - Build conversational interfaces
- Smart Tables SDK Documentation - Manage structured data
- Voice SDK Documentation - Enable voice conversations

