API Reference
Welcome to the Nebula SDK API Reference. This section provides detailed documentation for all classes, methods, and types available in the SDK.Overview
The Nebula SDK is organized into several main modules:Chat
Conversational AI with streaming support
Memory
Persistent storage for AI context and data
Agent
Autonomous AI agents with tool integration
Storage
Decentralized storage on the 0G network
Quick Reference
Core Classes
Class | Description | Import |
---|---|---|
Chat | Main chat interface | import { Chat } from 'nebula-sdk' |
Memory | Memory management | import { Memory } from 'nebula-sdk' |
Agent | AI agent framework | import { Agent } from 'nebula-sdk' |
ZGStorageClient | Storage client | import { ZGStorageClient } from 'nebula-sdk' |
ZGComputeBroker | Compute broker | import { ZGComputeBroker } from 'nebula-sdk' |
Common Types
Authentication
All API calls require authentication. Set your API key when initializing SDK components:Error Handling
The SDK uses structured error objects for consistent error handling:Rate Limits
The SDK respects the following rate limits:Endpoint | Limit | Window |
---|---|---|
Chat API | 100 requests | per minute |
Memory API | 1000 requests | per minute |
Storage API | 50 requests | per minute |
Agent API | 20 requests | per minute |
Pagination
For endpoints that return large datasets, use pagination:Versioning
The SDK follows semantic versioning. Always specify the version in your package.json:Support
- Documentation: https://docs.0g.ai
- GitHub Issues: https://github.com/0glabs/nebula-sdk/issues
- Discord: https://discord.gg/0g
- Email: support@0g.ai