Chaos AI Documentation

Updated

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

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: [{ type: "message", role: "user", content: "What is my portfolio value?" }],
  metadata: {
    wallets: [{ address: "0x1234567890abcdef1234567890abcdef12345678", chain: "ethereum" }],
  },
});
 
console.log(response);

Available Models

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

Documentation Sections

Was this helpful?