> ## Documentation Index
> Fetch the complete documentation index at: https://docs.run-agent.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK Overview

> Native SDKs for multiple programming languages

## Introduction

RunAgent provides native SDKs for multiple programming languages, making it easy to integrate deployed agents into your applications. All SDKs follow consistent patterns while respecting language-specific conventions.

## Available SDKs

### Python

Full-featured SDK with sync/async support

```bash theme={null}
pip install runagent
```

### Rust

High-performance SDK with zero-cost abstractions

```bash theme={null}
cargo add runagent tokio
```

### JavaScript

Coming Soon - Node.js and browser support

```bash theme={null}
npm install @runagent/sdk
```

### Go

Coming Soon - Idiomatic Go client

```bash theme={null}
go get github.com/runagent-dev/runagent-go
```

## Common Features

All SDKs provide:

* **Authentication**: API key and token management
* **Synchronous Calls**: Request/response pattern
* **Asynchronous Support**: Non-blocking operations
* **Streaming**: Real-time response streaming
* **Error Handling**: Consistent error types
* **Retry Logic**: Automatic retry with backoff
* **Type Safety**: Language-appropriate typing

## Quick Comparison

| Feature       | Python | Rust | JavaScript | Go |
| ------------- | ------ | ---- | ---------- | -- |
| Sync Support  | ✅      | ✅    | ✅          | ✅  |
| Async Support | ✅      | ✅    | ✅          | ✅  |
| Streaming     | ✅      | ✅    | 🚧         | 🚧 |
| Type Safety   | ✅      | ✅    | ✅ (TS)     | ✅  |
| Published     | ✅      | ✅    | 🚧         | 🚧 |

## Basic Usage Pattern

All SDKs follow a similar pattern:

### Python

```python theme={null}
from runagent import RunAgentClient

client = RunAgentClient(agent_id="agent-123")
result = client.run_generic({"query": "Hello"})
```

### Rust

```rust theme={null}
use runagent::client::RunAgentClient;
use serde_json::json;

let client = RunAgentClient::new("agent-123", "generic", true).await?;
let result = client.run(&[("query", json!("Hello"))]).await?;
```

### JavaScript

```javascript theme={null}
import { RunAgentClient } from '@runagent/sdk';

const client = new RunAgentClient({ agentId: 'agent-123' });
const result = await client.runGeneric({ query: 'Hello' });
```

### Go

```go theme={null}
import "github.com/runagent-dev/runagent-go"

client := runagent.NewClient("agent-123")
result, err := client.RunGeneric(map[string]interface{}{
    "query": "Hello",
})
```

## Authentication

SDKs support multiple authentication methods:

### Environment Variable

Set `RUNAGENT_API_KEY` and SDKs will use it automatically:

```bash theme={null}
export RUNAGENT_API_KEY="your-api-key"
```

### Direct Configuration

Pass API key during initialization:

```python theme={null}
client = RunAgentClient(
    agent_id="agent-123",
    api_key="your-api-key"
)
```

### Configuration File

SDKs can read from `~/.runagent/config.json`:

```json theme={null}
{
  "api_key": "your-api-key",
  "api_url": "https://api.run-agent.ai"
}
```

## Error Handling

All SDKs provide consistent error types:

| Error Type            | Description                    |
| --------------------- | ------------------------------ |
| `AuthenticationError` | Invalid or missing credentials |
| `AgentNotFoundError`  | Agent doesn't exist            |
| `ValidationError`     | Invalid input data             |
| `RateLimitError`      | Too many requests              |
| `TimeoutError`        | Request timed out              |
| `NetworkError`        | Connection issues              |

## Advanced Features

### Streaming Responses

For real-time applications:

```python theme={null}
for chunk in client.run_generic_stream({"query": "Tell a story"}):
    print(chunk, end="")
```

### Batch Processing

Process multiple requests efficiently:

```python theme={null}
results = client.batch_run([
    {"query": "Question 1"},
    {"query": "Question 2"},
    {"query": "Question 3"}
])
```

### Custom Headers

Add custom headers for tracking:

```python theme={null}
client = RunAgentClient(
    agent_id="agent-123",
    headers={
        "X-Request-ID": "unique-id",
        "X-User-ID": "user-123"
    }
)
```

## SDK Selection Guide

Choose your SDK based on:

### Python SDK

Best for:

* Data science and ML applications
* Backend services
* Scripts and automation
* Jupyter notebooks

### Rust SDK

Best for:

* High-performance applications
* Systems programming
* WebAssembly targets
* Memory-efficient applications
* Concurrent processing

### JavaScript SDK

Best for:

* Web applications
* Node.js backends
* React/Vue/Angular apps
* Serverless functions

### Go SDK

Best for:

* Microservices
* Cloud-native applications
* CLI tools
* Concurrent processing

## Performance Considerations

| SDK        | Startup Time | Memory Usage | Throughput | Type Safety   |
| ---------- | ------------ | ------------ | ---------- | ------------- |
| Python     | Medium       | Medium       | Good       | Runtime       |
| Rust       | Fast         | Very Low     | Excellent  | Compile-time  |
| JavaScript | Fast         | Low          | Good       | Optional (TS) |
| Go         | Fast         | Low          | Excellent  | Compile-time  |

## Migration Guide

Moving between SDKs? The concepts remain the same:

1. **Client initialization** - Same parameters
2. **Method names** - Consistent across languages
3. **Response format** - JSON-compatible structures
4. **Error handling** - Similar error types

## Getting Help

* **Documentation**: Language-specific guides
* **Examples**: GitHub repositories with samples
* **Community**: Discord channels for each SDK
* **Support**: [support@run-agent.ai](mailto:support@run-agent.ai)

## Next Steps

<CardGroup cols={3}>
  <Card title="Python SDK" icon="python" href="/sdk/python/getting-started">
    Start with our most mature SDK
  </Card>

  <Card title="Rust SDK" icon="rust" href="/sdk/rust/getting-started">
    High-performance native SDK
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    Understand the underlying API
  </Card>
</CardGroup>

<Card title="Still have a question?" icon="circle-question" href="/components/columns">
  * Join our [Discord Community](https://discord.gg/Q9P9AdHVHz)
  * Email us: [hi@run-agent.ai](mailto:hi@run-agent.ai)
  * Follow us on [X](https://x.com/run_agent)
  * New here? [Sign up](https://run-agent.ai/dashboard)
</Card>
