Chaos AI Documentation

Chaos AI Documentation

Welcome to the Chaos AI SDK documentation. This SDK provides a TypeScript/JavaScript interface to the Chaos AI API, enabling you to build intelligent DeFi applications with natural language interactions.

Key Features

  • Wallet Analysis: Get AI-powered insights about wallet positions and performance
  • DeFi Actions: Execute transactions with natural language commands
  • Risk Assessment: Understand risks before executing any action
  • Streaming Responses: Real-time responses with progress updates
  • Type Safety: Full TypeScript support with comprehensive type definitions

Quick Install

terminal
npm install @chaoslabs/ai-sdk

Quick Usage

example.ts
import Chaos, { WALLET_MODEL } from '@chaoslabs/ai-sdk';
 
const chaos = new Chaos({
  apiKey: process.env.CHAOS_API_KEY,
});
 
const response = await chaos.chat.responses.create({
  model: WALLET_MODEL,
  input: "What is my portfolio value?",
  metadata: {
    wallet_id: "0x1234567890abcdef1234567890abcdef12345678",
  },
});
 
console.log(response);

Available Models

ModelConstantDescription
Wallet AgentWALLET_MODELPortfolio analysis, DeFi actions, recommendations
Ask AgentASK_MODELGeneral DeFi questions, protocol explanations

Documentation Sections