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-sdkCopy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
Quick 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: [{ type: "message", role: "user", content: "What is my portfolio value?" }],
metadata: {
wallets: [{ address: "0x1234567890abcdef1234567890abcdef12345678", chain: "ethereum" }],
},
});
console.log(response);Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
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
- Quick Start: 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
Was this helpful?