ControlPlaneClient and minimal, factual examples.
Prerequisites
Before you begin, ensure you have:- Python 3.8 or higher installed
- pip package manager
- A Kubiya API key from the Kubiya platform
Installation
Install the Kubiya SDK using pip:Setup
Configure API Key
Set your API key as an environment variable:.env file:
Initialize the Client
Create and Manage an Agent
Minimal agent creation:create:
- name: Agent display name
- model_id: Provider id (e.g.,
claude-sonnet-4)
Execute an Agent
Execution requiresworker_queue_id, and a prompt.
execute:
- worker_queue_id: Queue name (e.g.,
default) - prompt: What the agent should do (task description)
Delete an Agent
Integrations and Secrets
List integrations and get credentials:- Store sensitive values in Secrets and reference them at runtime
list()returns metadata only; useget_value(name)to fetch the actual secret
Verify Setup
Quick health check:base_url, API key, and network access.
Best Practices
Use Descriptive Names
Use Descriptive Names
Always use clear, descriptive names for agents:
Handle Errors Gracefully
Handle Errors Gracefully
Add error handling around agent operations:
Use Environment Variables
Use Environment Variables
Store sensitive values securely:
Validate Before Executing
Validate Before Executing
Check agent exists before execution:
Next Steps
Control Plane Client Overview
Learn the services in the Control Plane client
Agents
Full agent lifecycle: create, list, get, update, execute, delete
Integrations
List integrations and fetch credentials
Secrets
List secret metadata and get values