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
npm install @chaoslabs/ai-sdkQuick Usage
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
| Model | Constant | Description |
|---|---|---|
| Wallet Agent | WALLET_MODEL | Portfolio analysis, DeFi actions, recommendations |
| Ask Agent | ASK_MODEL | General DeFi questions, protocol explanations |
Documentation Sections
- Quickstart Guide: Get up and running in minutes
- Block Types: Understand response block formats
- Primitives: Work with DeFi primitives
- Streaming: Real-time response handling
- Examples: Complete code examples