Skip to main content

Python API Reference

Welcome to the 0G AI SDK Python API Reference. This section provides detailed documentation for all classes, methods, and types available in the Python SDK.

Overview

The 0G AI SDK Python library 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

Common Types

Installation

Install the Python SDK using pip:

Authentication

All API calls require authentication. Set your API key when initializing SDK components:

Error Handling

The SDK uses structured exception classes for consistent error handling:

Rate Limits

The SDK respects the following rate limits:

Pagination

For endpoints that return large datasets, use pagination:

Async/Await Support

The Python SDK is built with async/await support for better performance:

Type Hints

The SDK provides comprehensive type hints for better IDE support:

Configuration

Configure the SDK using environment variables or configuration objects:

Support