Skip to main content
Get started with the Control Plane SDK to manage agents, integrations, and secrets. This guide uses the current 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:
Or using poetry:

Setup

Configure API Key

Set your API key as an environment variable:
Or use a .env file:

Initialize the Client

Using environment variables is recommended for security. Never commit API keys to version control.

Create and Manage an Agent

Minimal agent creation:
Required fields for create:
  • name: Agent display name
  • model_id: Provider id (e.g., claude-sonnet-4)
Attach skills and integrations later via update() using IDs. Keep creation minimal until the agent is working end-to-end.
List agents:
Update an agent (attach skills/integrations by IDs if needed):

Execute an Agent

Execution requires worker_queue_id, and a prompt.
Required fields for execute:
  • worker_queue_id: Queue name (e.g., default)
  • prompt: What the agent should do (task description)
Prefer executing by known agent_id. If you only have a name, first list() and resolve the agent_id to avoid name collisions.

Delete an Agent

Integrations and Secrets

List integrations and get credentials:
Some vendors (e.g., github_app, jira) may use a fixed id like "0". Check the list output and use the exact vendor and id returned.
List secrets and get a secret value:
Best practices:
  • Store sensitive values in Secrets and reference them at runtime
  • list() returns metadata only; use get_value(name) to fetch the actual secret

Verify Setup

Quick health check:
Expected output: a small dict indicating service health. If the call fails, verify your base_url, API key, and network access.

Best Practices

Always use clear, descriptive names for agents:
Add error handling around agent operations:
Store sensitive values securely:
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