🦜 LangChain Integration

How to Publish Podcasts with LangChain Podcast Hosting API

PodClaw is the only podcast hosting API built for AI agents. LangChain agents can create shows, upload audio files, and publish episodes to Apple Podcasts and Spotify with a single API call.

Prerequisites

Before you start, make sure you have the following ready:

pip install langchain langchain-openai langchain-hub requests

Quick Start

The example below defines two LangChain tools — one to create a podcast show and one to publish an episode — then wires them into an OpenAI tools agent. The agent receives a plain-English instruction and calls the right tools in order.

python — langchain_podclaw.py
import requests from langchain.tools import tool from langchain.agents import AgentExecutor, create_openai_tools_agent from langchain_openai import ChatOpenAI from langchain import hub PODCLAW_API_KEY = "pc_your_api_key_here" BASE_URL = "https://podclaw.io/api" @tool def create_podcast_show(title: str, description: str, category: str = "Technology") -> dict: """Create a new podcast show on PodClaw.""" response = requests.post( f"{BASE_URL}/shows", headers={"Authorization": f"Bearer {PODCLAW_API_KEY}"}, json={"title": title, "description": description, "category": category} ) return response.json() @tool def publish_episode(show_id: str, title: str, audio_url: str, description: str = "") -> dict: """Publish a podcast episode to Apple Podcasts, Spotify, and 20+ platforms.""" response = requests.post( f"{BASE_URL}/shows/{show_id}/episodes", headers={"Authorization": f"Bearer {PODCLAW_API_KEY}"}, json={ "title": title, "description": description, "audio_url": audio_url, "status": "published" } ) return response.json() # Create agent with PodClaw tools llm = ChatOpenAI(model="gpt-4o", temperature=0) tools = [create_podcast_show, publish_episode] prompt = hub.pull("hwchase17/openai-tools-agent") agent = create_openai_tools_agent(llm, tools, prompt) agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True) # Run the agent result = agent_executor.invoke({ "input": "Create a podcast show called 'AI Weekly' about artificial intelligence news, then publish an episode titled 'GPT-5 Announced' using audio from https://example.com/episode1.mp3" })

What happens next

After your LangChain agent calls publish_episode, PodClaw handles the rest automatically:

Tip: The audio_url field accepts any publicly accessible MP3, M4A, or OGG URL. If you generate audio with a TTS service like ElevenLabs or OpenAI TTS, host the file on S3 or R2 and pass the URL directly.

Going further

Once your first episode is live, PodClaw's API exposes additional capabilities you can wire into your LangChain agents:

Frequently Asked Questions

Does PodClaw work with LangChain?

Yes. PodClaw works with LangChain via Python's requests library used inside a @tool-decorated function, or through LangChain's built-in HTTP request tools. Any LangChain agent can call PodClaw's REST API to create shows and publish episodes to Apple Podcasts, Spotify, and 20+ directories.

What LangChain version does PodClaw support?

PodClaw supports any version of LangChain because it is a standard REST API. As long as your LangChain agent can make HTTP POST requests — which all versions support — it can publish podcasts via PodClaw. The code examples on this page use langchain 0.2+ with the create_openai_tools_agent pattern.

Can LangChain agents upload audio to PodClaw?

Yes. LangChain agents can upload audio files to PodClaw using Python's requests library with multipart/form-data encoding, or simply pass a publicly accessible audio URL directly in the episode payload. The easiest approach is generating audio with a TTS API, uploading it to cloud storage, and passing the URL to PodClaw.

Ready to ship your first AI podcast?

Get your free PodClaw API key and have your LangChain agent publishing in minutes.

Get Started Free →