Skip to main content
The Kubiya Client SDK provides a comprehensive Python interface to all Kubiya platform services, enabling you to programmatically manage agents, workflows, integrations, secrets, and knowledge. What it provides:
  • Type-safe Python interfaces to platform services
  • Automatic authentication and request handling
  • Streaming support for real-time updates
  • Comprehensive error handling with specific exceptions
  • Retry logic for resilient operations

Quick Start

Available Services

The Client SDK provides access to these platform services:

Agents Service

Create and manage AI agents with custom capabilities and configurations

Client Initialization

Basic Initialization

The ControlPlaneClient supports two authentication methods:
  1. Environment variable (recommended): Set KUBIYA_API_KEY in your environment
  2. Direct parameter: Pass api_key directly to the constructor
If api_key is not provided and KUBIYA_API_KEY environment variable is not set, a ValueError will be raised.

Advanced Configuration

Using Environment Variables

Set these environment variables to avoid hardcoding credentials:
Then simply initialize without parameters:
The client will automatically read:
  • KUBIYA_API_KEY for authentication (required)
  • KUBIYA_CONTROL_PLANE_BASE_URL for the API endpoint (optional, defaults to https://control-plane.kubiya.ai)

Core Features

Agents Management

Create, configure, and manage AI agents:
Learn more about Agents Service →

Workflow Execution

Execute workflows with real-time streaming:

Integration Management

Connect and manage external services:

Secrets Management

Securely store and retrieve sensitive data:

Knowledge Query

Search the knowledge base with AI:

Error Handling

The SDK provides specialized exceptions for different failure scenarios:

Async Support

For non-blocking operations, use the async client:

Best Practices

1. Always Use Error Handling

2. Use Environment Variables

3. Handle Streaming Gracefully

4. Validate Inputs

Common Patterns

Pagination

Retry Logic

Context Manager

Advanced: Control Plane Client

For advanced orchestration and infrastructure use cases, the SDK also includes a ControlPlaneClient for accessing internal services like the context graph, models, and skills. Learn about Control Plane Client →

Next Steps

Agents Service

Learn how to create and manage AI agents