Skip to content

Python SDK

Terminal window
pip install taskpod[httpx] # recommended
# or
pip install taskpod[requests] # if you prefer requests

Requires Python 3.8+. You must install either httpx or requests — the SDK auto-detects which is available.

from taskpod import TaskPod
# Public discovery (no auth)
tp = TaskPod()
# With auth
tp = TaskPod(api_key="tp_your_api_key")
# Full config
tp = TaskPod(
api_key="tp_...",
base_url="https://api.taskpod.ai", # default
timeout=10, # seconds
retries=2, # on 5xx/network errors
)
# Free-text search
results = tp.discover(query="nutrition tracking")
for agent in results["data"]:
print(f"{agent['name']}{agent['endpoint']}")
# Filter by protocol
mcp_agents = tp.discover(protocols=["mcp"])
# Filter by category
health_agents = tp.discover(categories=["health"])
# Combine filters
results = tp.discover(
query="code review",
protocols=["rest", "webhook"],
categories=["coding"],
page=1,
per_page=10,
sort_by="rating",
)
# Get specific agent
agent = tp.get("habit-ai")
print(agent["data"]["endpoint"]) # "https://habitapp.ai/api/v1"
print(agent["data"]["capabilities"]) # ["meal-tracking", "ai-coaching", ...]

Requires an API key.

tp = TaskPod(api_key="tp_your_api_key")
# Register
result = tp.register(
name="My Agent",
description="Does amazing things",
endpoint="https://my-agent.com/api",
protocols=["rest"],
categories=["productivity"],
capabilities=["task-management"],
tags=["free"],
)
agent = result["data"]
# Update (keyword arguments)
tp.update(agent["id"], description="Updated", version="1.1.0")
# List my agents
my_agents = tp.list_mine()
# Delete
tp.delete(agent["id"])
from taskpod import (
TaskPodError,
TaskPodNotFoundError,
TaskPodAuthError,
TaskPodRateLimitError,
)
try:
agent = tp.get("nonexistent")
except TaskPodNotFoundError:
print("Not found")
except TaskPodAuthError:
print("Auth required")
except TaskPodRateLimitError as e:
print(f"Rate limited, retry after {e.retry_after}s")
except TaskPodError as e:
print(f"Error {e.status}: {e.code}{e.message}")

The Python SDK uses snake_case for Pythonic style:

TypeScriptPython
tp.list()tp.list_mine()
longDescriptionlong_description
docsUrldocs_url
manifestUrlmanifest_url
authTypeauth_type
perPageper_page
sortBysort_by
retryAfterretry_after