Skip to main content
The RunAgent Python SDK provides a simple and powerful interface for interacting with your deployed agents. It supports both synchronous and asynchronous operations, with built-in streaming capabilities.

Installation

Install the SDK using pip:
The SDK is included with the main runagent package. No separate installation needed.

Quick Start

Basic Usage

With API Key

Authentication

The SDK supports multiple authentication methods:

Response Formats

Standard Response

Streaming Response

Error Handling

The SDK provides comprehensive error handling:

Common Error Types

Configuration Options

Input Validation

The SDK validates inputs before sending requests:

Logging

Enable logging for debugging:

Complete Examples

Question-Answering Bot

Interactive Chat

Batch Processing

Best Practices

Reuse Clients

Create client instances once and reuse them for multiple requests

Handle Errors

Always implement proper error handling for production use

Use Streaming

Use streaming for long responses to improve user experience

Set Timeouts

Configure appropriate timeouts based on your agent’s complexity

Next Steps

Synchronous Client

Deep dive into synchronous operations

Asynchronous Client

Learn about async/await support

Streaming Responses

Master real-time streaming

API Reference

Complete API documentation