IntegrationsBeginner
How to Generate YouTube Titles and Descriptions with ChatGPT's API
Call the OpenAI Chat Completions API to produce several title options plus an SEO-friendly description with timestamps and tags.
8 minBeginner
Titles decide whether a video gets clicked, and writing ten good options by hand is tedious. This guide uses the OpenAI API to return five title candidates plus a full description block from your transcript or summary, so you pick rather than invent.
What you need
- An OpenAI API key from platform.openai.com
- Python 3.9+ with the openai package
- A short summary or transcript of the video
Step 1: Install and authenticate
zsh — yt-titles
$pip install openai
$export OPENAI_API_KEY=sk-...
$
Step 2: Ask for structured JSON
Request the result as JSON so your script can parse it directly into an upload step instead of you copying and pasting. The response_format flag keeps the model from wrapping prose around the data.
titles.py
import os, json
from openai import OpenAI
client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
PROMPT = (
"From the video summary, return JSON with keys: "
"titles (5 options, under 60 chars, no clickbait lies), "
"description (2 short paragraphs), "
"tags (10 lowercase keywords)."
)
def metadata(summary):
res = client.chat.completions.create(
model="gpt-5",
response_format={"type": "json_object"},
messages=[
{"role": "system", "content": PROMPT},
{"role": "user", "content": summary},
],
)
return json.loads(res.choices[0].message.content)
if __name__ == "__main__":
data = metadata("A beginner walkthrough of soldering a through-hole kit.")
print(json.dumps(data, indent=2))Step 3: Run and review
zsh — yt-titles
$python titles.py
{
"titles": ["Soldering for total beginners", ...],
"description": "In this video we ...",
"tags": ["soldering", "electronics", ...]
}
$
YouTube Studio — Details
Title (required)
[ Soldering for total beginners ]
Description
[ In this video we walk through your first ]
[ through-hole kit, step by step ... ]
Keep titles honest
Tell the model not to promise things the video does not deliver. Misleading titles get punished by both viewers and the algorithm once watch time drops off.
Result
You get a parsed object with five titles, a description, and tags. Combine this with the upload guide to set metadata at upload time instead of in the web UI.
Watch related tutorials
12:38OpenAI Codex Tutorial #1 - Introduction & Setup
Net Ninja
14:09OpenAI Codex Tutorial #4 - Using the Codex CLI
Net Ninja
17:53Using OpenAI Codex CLI with GPT-5-Codex
Prompt Engineering
15:00OpenAI Codex Tutorial 2026 || Getting Started with Codex for AI Coding Beginners
YouTube
12:00OpenAI Codex CLI
YouTube
30:00Building 5 AI Apps In 30 Minutes (ChatGPT + Lovable Tutorial)
YouTube
Tags
#chatgpt#openai#titles#seo#api