Prerequisites
Make sure you have these in place before starting:
- PodClaw API key — free at podclaw.io/signup
- Python 3.9+
- crewai and requests packages installed
pip install crewai crewai-tools requests
Quick Start
The example below defines two PodClaw tools using CrewAI's @tool decorator, creates a producer agent and a publisher agent, assigns each a task, and runs them sequentially in a crew.
python — crewai_podclaw.py
import requests
from crewai import Agent, Task, Crew, Process
from crewai.tools import tool
PODCLAW_API_KEY = "pc_your_api_key_here"
@tool("PodClaw Publisher")
def publish_podcast_episode(show_id: str, title: str, audio_url: str, description: str) -> str:
"""Publishes a podcast episode to Apple Podcasts, Spotify, and 20+ platforms via PodClaw."""
response = requests.post(
f"https://podclaw.io/api/shows/{show_id}/episodes",
headers={"Authorization": f"Bearer {PODCLAW_API_KEY}"},
json={
"title": title,
"description": description,
"audio_url": audio_url,
"status": "published"
}
)
data = response.json()
if data.get("success"):
return f"Episode published! Episode ID: {data['episode']['id']}, GUID: {data['episode']['guid']}"
return f"Error: {data.get('error', 'Unknown error')}"
@tool("PodClaw Show Creator")
def create_podcast_show(title: str, description: str, author: str = "AI Podcast Bot") -> str:
"""Creates a new podcast show on PodClaw and returns the show ID."""
response = requests.post(
"https://podclaw.io/api/shows",
headers={"Authorization": f"Bearer {PODCLAW_API_KEY}"},
json={"title": title, "description": description, "author": author}
)
data = response.json()
if data.get("success"):
return f"Show created! Show ID: {data['show']['id']}"
return f"Error: {data.get('error', 'Unknown error')}"
# Define agents
producer = Agent(
role="Podcast Producer",
goal="Create and manage podcast shows on PodClaw",
backstory="Expert podcast producer who creates compelling podcast series using AI tools",
tools=[create_podcast_show],
verbose=True
)
publisher = Agent(
role="Episode Publisher",
goal="Publish podcast episodes to all major platforms",
backstory="Technical publishing expert who ensures episodes reach Apple Podcasts, Spotify, and 20+ platforms",
tools=[publish_podcast_episode],
verbose=True
)
# Define tasks
create_show_task = Task(
description="Create a new podcast show called 'Tech Trends Weekly' about weekly technology news for developers",
agent=producer,
expected_output="Show created with ID returned"
)
publish_task = Task(
description="Using the show ID from the previous task, publish an episode titled 'The Rise of Agentic AI' with audio from https://example.com/ep1.mp3 and a 2-sentence description about AI agents taking over software development",
agent=publisher,
expected_output="Episode published successfully with episode ID"
)
# Run the crew
crew = Crew(
agents=[producer, publisher],
tasks=[create_show_task, publish_task],
process=Process.sequential,
verbose=True
)
result = crew.kickoff()
print(result)
Multi-agent podcast production
The real power of combining CrewAI with PodClaw is the ability to build fully automated end-to-end podcast pipelines. A typical production crew looks like this:
Agent 1
Researcher
Searches the web, pulls RSS feeds, and identifies the week's most relevant stories using search tools.
Agent 2
Writer
Takes the research and drafts a podcast script, episode title, and show notes in the brand's voice.
Agent 3
Publisher
Calls a TTS API to generate audio, uploads it to cloud storage, then publishes via PodClaw.
Each agent only has access to the tools it needs. The researcher never touches PodClaw. The publisher never browses the web. CrewAI's sequential process passes context between tasks automatically, so the publisher always has the show ID and script from the upstream agents.
Tip: For the audio generation step, add an ElevenLabs or OpenAI TTS tool to the writer agent's toolset. Generate the audio, upload to S3 or Cloudflare R2, and pass the URL to the publisher agent's task.