All guides

October 2, 2026 · Updated · 7 min read

How to Summarize YouTube Videos with AI (Claude or OpenAI API)

In short

Summarize any YouTube video with AI in Python: one call to a summary API, or fetch the transcript and prompt Claude or GPT yourself. Code, prompts, and costs.

Language models can't watch YouTube, but they read transcripts very well. A video summarizer is two calls: one to get the transcript, one to summarize it. This guide shows both ways in Python: a single call to a summary endpoint, and a do-it-yourself version with the Claude or OpenAI API when you want full control of the prompt.

The one-call way: a summary API

If you just need a summary, skip the prompt engineering. GET /v1/summary returns a short summary, a list of key points, and timestamped notes grouped by section, written in the video's own language. It costs 2 credits for most videos (1 for the transcript, 1 for the AI), and a summary someone already requested is served from cache for 1 credit.

Pass translate_to=en to summarize a Spanish or Hindi video in English. Videos without captions are transcribed with AI first, so the same call works on them too.

import os
import requests

res = requests.get(
    "https://transcript-yt.com/v1/summary",
    params={"url": "https://youtu.be/5f3Pn-N6yLc"},
    headers={"Authorization": f"Bearer {os.environ['TRANSCRIPTYT_KEY']}"},
    timeout=180,
)
res.raise_for_status()
data = res.json()

print(data["summary"])
for point in data["keyPoints"]:
    print("-", point)
for note in data["notes"]:
    print(f"[{note['start']}s] {note['heading']}")

The do-it-yourself way

Write your own prompt when you need a specific shape: a tweet, a product-mention list, a summary in a house style, or answers to fixed questions about every video. The recipe is two steps, transcript first, then the model.

1. Get the transcript as LLM-ready text

Request format=md with paragraphs=true. Markdown output includes the title and channel as a header, and paragraph grouping merges short caption cues into readable blocks, which uses fewer tokens and gives the model better context than one line per cue.

Keep timestamps=true if you want the summary to cite moments in the video.

import os
import requests

def transcript_markdown(video: str) -> str:
    res = requests.get(
        "https://transcript-yt.com/v1/transcript",
        params={"url": video, "format": "md", "paragraphs": "true", "timestamps": "true"},
        headers={"Authorization": f"Bearer {os.environ['TRANSCRIPTYT_KEY']}"},
        timeout=120,
    )
    res.raise_for_status()
    return res.text

2. Summarize it with an LLM

Pass the transcript with a specific instruction. Asking for a fixed structure (key points, takeaways, timestamps) gives far more useful results than "summarize this".

import anthropic

client = anthropic.Anthropic()

def summarize(video: str) -> str:
    message = client.messages.create(
        model="claude-sonnet-5-5",
        max_tokens=1024,
        messages=[{
            "role": "user",
            "content": "Summarize this YouTube transcript in 5 bullet points, "
                       "each with the [HH:MM:SS] timestamp where it is discussed.\n\n"
                       + transcript_markdown(video),
        }],
    )
    return message.content[0].text

print(summarize("https://youtu.be/5f3Pn-N6yLc"))

Prompts that work

Name the format and the length. "5 bullet points, each under 20 words, with the timestamp where it is discussed" beats "summarize this" every time.

Say who the summary is for. "For a busy engineer deciding whether to watch" produces a different, more useful summary than no audience at all.

Ask for what the video does not cover if you are comparing sources, and ask the model to quote rather than paraphrase when exact wording matters, such as interviews or earnings calls.

Auto-generated captions misspell names and jargon. Give the model the correct spellings in the prompt ("the guest is Andrej Karpathy") and it will fix them in the summary.

What it costs

A 15-minute video is about 2,500 words, roughly 3,500 tokens. With a mid-size model that is a fraction of a cent per summary, and the transcript is 1 credit (from $1.58 per 1,000 on paid plans). The /v1/summary endpoint bundles both into 2 credits for most videos, so you never manage an LLM key or bill.

Long videos

An hour of speech is roughly 10,000 to 15,000 words, which fits in the context window of current Claude and GPT models. For multi-hour streams or podcasts, split the paragraphs into chunks, summarize each, then summarize the summaries.

Videos without captions

Some videos have no captions at all. TranscriptYT transcribes those with AI speech-to-text automatically, so the same code works; the response's source field is speech_to_text and it costs 1 credit per started minute of audio.

Skip the code: use the MCP server

To summarize one video without code, use the free YouTube video summarizer, or turn it into study notes with timestamps, an X thread, or a LinkedIn post. For summaries in Claude Code, Claude Desktop, Cursor, or Codex, connect the TranscriptYT MCP server and paste a link into the chat. The agent fetches the transcript itself.

Common questions

Can ChatGPT summarize a YouTube video from a link?

Often not reliably, because it may not be able to read the video's transcript. Paste the transcript into the chat, use a free YouTube summarizer, or connect an MCP server that fetches transcripts.

How much does it cost to summarize a YouTube video with AI?

With the TranscriptYT /v1/summary endpoint, 2 credits for most videos (about $0.003 to $0.006). Doing it yourself costs 1 credit for the transcript plus a fraction of a cent of LLM tokens for a 15-minute video.

Can I summarize a video in another language?

Yes. Pass translate_to=en to /v1/summary to summarize a Spanish or Hindi video in English, or use the free summarizer and pick a language.

Try the YouTube Transcript API

Get transcripts as JSON, text, SRT, or VTT. 100 free credits, no card required.

Free tools for this

More guides