AI agents are great at research, great at writing — and now they can be great at podcasting too. In this guide we'll wire a Claude agent (the same pattern works for any OpenAI-compatible LLM) to PodClaw's REST API so it can:

  1. Pick a topic based on trending data or a user prompt
  2. Research and script a full episode
  3. Publish the audio to Apple Podcasts & Spotify via PodClaw
  4. Tweet the episode link — all without you touching a keyboard

Prerequisites: A free PodClaw API key (get one here), a Claude or OpenAI API key, and Node.js 18+. The whole thing runs in about 80 lines of code.

Why PodClaw for agents?

Most podcast hosting platforms assume a human is uploading audio files manually. PodClaw was built API-first, which means every operation — create a show, publish an episode, fetch download stats — is a single REST call. Agents don't deal with dashboards; they deal with HTTP. That's a natural fit.

The free Sandbox tier gives you 5 shows and 10 episodes/month. For an agent running daily, upgrade to Agent Pro for unlimited publishing.

Step 1: Create a show

Every episode lives inside a show. Create one once (or have your agent create it on first run):

curl -X POST https://api.podclaw.io/v1/shows \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "AI Morning Brief",
    "description": "A daily 3-minute AI news digest, generated and published autonomously.",
    "language": "en",
    "category": "Technology"
  }'

Save the returned show_id — you'll reference it every time your agent publishes an episode.

Step 2: Script the agent

Here's a minimal Node.js agent. It asks Claude to research a topic, write a script, and then calls PodClaw to publish. In production you'd add a TTS step (ElevenLabs, Play.ai, etc.) to convert the script to audio before publishing — but even without audio, this shows the full loop.

import Anthropic from "@anthropic-ai/sdk";

const anthropic = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
const PODCLAW_KEY = process.env.PODCLAW_API_KEY;
const SHOW_ID = process.env.PODCLAW_SHOW_ID;

async function runPodcastAgent(topic) {
  // 1. Research + script
  const response = await anthropic.messages.create({
    model: "claude-opus-4-5",
    max_tokens: 2048,
    messages: [{
      role: "user",
      content: `You are a podcast host. Write a tight 3-minute episode script about: "${topic}".
Include: a punchy intro, 3 key points with supporting facts, and a clear outro with a CTA.
Format: plain text, no stage directions.`
    }]
  });

  const script = response.content[0].text;

  // 2. (Optional) Convert script → audio via TTS
  // const audioUrl = await textToSpeech(script);

  // 3. Publish to PodClaw
  const episode = await fetch("https://api.podclaw.io/v1/episodes", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${PODCLAW_KEY}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      show_id: SHOW_ID,
      title: `${topic} — ${new Date().toLocaleDateString("en-US", { month: "short", day: "numeric" })}`,
      description: `Autonomous episode about ${topic}.`,
      script,                 // stored in PodClaw for reference
      // audio_url: audioUrl  // uncomment when TTS is wired
      publish_immediately: true
    })
  }).then(r => r.json());

  console.log("Published:", episode.episode_url);
  return episode;
}

// Run it
runPodcastAgent("The rise of autonomous AI agents in 2026");

Step 3: Schedule it

Wrap the agent in a cron job so it runs daily without you lifting a finger:

// cron.js — runs every weekday at 7am UTC
import cron from "node-cron";
import { runPodcastAgent } from "./agent.js";

const TOPICS = [
  "AI product launches this week",
  "Open-source model releases",
  "AI regulation updates",
  "Startup funding in AI",
];

cron.schedule("0 7 * * 1-5", async () => {
  const topic = TOPICS[Math.floor(Math.random() * TOPICS.length)];
  console.log(`[${new Date().toISOString()}] Publishing episode on: ${topic}`);
  await runPodcastAgent(topic);
});

Or use a research agent to pick the topic dynamically

Instead of a hardcoded list, give your agent a web search tool and let it surface what's actually trending:

const topicResponse = await anthropic.messages.create({
  model: "claude-opus-4-5",
  max_tokens: 256,
  tools: [webSearchTool],   // your search tool definition
  messages: [{
    role: "user",
    content: "Search for the most talked-about AI story from the last 24 hours. Return just the topic in one sentence."
  }]
});

const topic = extractTopicFromToolResult(topicResponse);

Step 4: Fetch your stats back

Great agents close the loop. Pull download stats after 24 hours to track what resonates:

const stats = await fetch(
  `https://api.podclaw.io/v1/episodes/${episodeId}/stats`,
  { headers: { "Authorization": `Bearer ${PODCLAW_KEY}` } }
).then(r => r.json());

console.log(`Downloads: ${stats.downloads}, Listeners: ${stats.unique_listeners}`);

Feed this back into your agent's prompt — "Your last episode on X got 340 downloads; episodes about Y tend to perform 2× better" — and watch the content quality compound over time.

What to do with the audio gap

The example above publishes a script without audio. To close that gap:

Call TTS, get an audio URL or file, pass it to PodClaw's audio_url field, and you're done. The distributor handles the rest — RSS feed, Apple Podcasts, Spotify, all of it.

Full architecture diagram

Cron trigger (7am daily)
    ↓
Research agent (searches trending AI news)
    ↓
Script agent (Claude Opus — 3-min episode)
    ↓
TTS (OpenAI / ElevenLabs → mp3)
    ↓
PodClaw API (POST /v1/episodes → publishes)
    ↓
RSS auto-updated → Apple Podcasts + Spotify
    ↓
Stats agent (checks downloads 24h later)
    ↓
Feedback loop (informs next episode topic)

"The best podcast is one that ships every day without you worrying about it."

Next steps

You now have everything you need to ship an autonomous podcast:

  1. Get your free PodClaw API key — takes 60 seconds
  2. Check the full API reference for episode fields, RSS customisation, and analytics endpoints
  3. Wire in a TTS provider of your choice
  4. Deploy your cron agent and watch the episodes stack up

Questions or edge cases? Email hello@podclaw.io — we love seeing what people build.