Gemini Notebook (NotebookLM): podcasts, Video Overviews and slides with the useapi.net API
These scripts call the useapi.net Gemini Notebook API (NotebookLM API), a third-party REST API (not affiliated with Google) that runs Gemini Notebook (NotebookLM) on the user's own Google account. Every script is in {baseDir}/scripts/ ({baseDir} is this skill's folder). Run them with bash.
What the user needs (tell them if something is missing)
- A useapi.net account and API token in
USEAPI_TOKEN: https://useapi.net/docs/start-here/setup-useapi. useapi.net is a paid service: one $15/month subscription covers every useapi.net API (https://useapi.net/docs/subscription). Never print the token or write it to a file. - A Google account connected to useapi.net once, on the useapi.net side: https://useapi.net/docs/start-here/setup-gemini-notebook. The setup guide recommends a dedicated Gmail account for this, not the user's personal one. The free Google plan works; cinematic Video Overviews need Google AI Pro or Ultra.
bash,curlandjqinstalled.
USEAPI_EMAIL is optional: if the user connected more than one Google account, it names the one to use.
This skill does not sign in to Google, read browser cookies or use Google OAuth tokens on the user's machine. It only sends HTTPS requests to api.useapi.net with the useapi.net token. Nothing runs locally besides curl, so a job keeps going on the server if the agent stops.
Fastest path: one command
bash {baseDir}/scripts/studio.sh audio|video|slides "<title>" <URL or local file> [more ...] [-- key=value ...]
It creates a notebook, adds the sources (existing local files are uploaded, everything else is added as a URL), waits until Google has read them, generates, waits and downloads. It prints progress on stderr and the saved paths on stdout (OUT_DIR sets the folder).
# A podcast (Audio Overview), short brief
bash {baseDir}/scripts/studio.sh audio "Apollo 11" https://en.wikipedia.org/wiki/Apollo_11 ./notes.pdf -- format=brief length=short
# A Video Overview in the whiteboard style
bash {baseDir}/scripts/studio.sh video "Apollo 11" https://en.wikipedia.org/wiki/Apollo_11 -- format=explainer style=whiteboard
# A slide deck (saves .pdf and .pptx)
bash {baseDir}/scripts/studio.sh slides "Q3 report" ./q3-report.pdf -- format=presenter length=short
podcast.sh "<title>" ... is the same as studio.sh audio "<title>" ....
Typical times: a short podcast about 3 to 10 minutes, slides about 7, a Video Overview 10 minutes or more. Run it in the background or with a timeout of at least 15 minutes (30 for video). Tell the user it is running and wait; do not start a second copy.
Options
type |
format |
Other options |
|---|---|---|
audio |
deep_dive (default), brief, critique, debate |
length: short, default, long; language (e.g. en, es, pt_BR, zh_Hans); instructions |
video |
explainer (default), brief, cinematic, short |
style (explainer and brief only): auto, classic, whiteboard, heritage, paper_craft, watercolor, anime, retro_print, kawaii, or custom with stylePrompt="..."; language, instructions (not cinematic). cinematic takes no style, language or instructions, and needs Google AI Pro or Ultra |
slides |
detailed (default), presenter |
length: short, default, long; language; instructions |
Pass options as key=value, e.g. instructions="Focus on the risks". Any other option returns 400 with the valid values. Every Studio type (reports, quizzes, flashcards, infographics, mind maps too) and option: https://useapi.net/docs/api-gemini-notebook-v1/post-gemini-notebook-artifacts
Step by step (pasted text, several outputs from one notebook, more control)
- Create a notebook. It prints the notebook id; keep it.
NB=$(bash {baseDir}/scripts/create-notebook.sh "My topic") - Add sources. URLs (web pages and YouTube, up to 50 per call) and pasted text:
Local files (PDF, DOCX, PPTX, EPUB, MD, TXT, CSV, MP3, M4A, WAV, MP4, JPG, PNG, WEBP; up to 200 MB):bash {baseDir}/scripts/add-sources.sh "$NB" https://example.com/article https://www.youtube.com/watch?v=VIDEO_ID bash {baseDir}/scripts/add-sources.sh "$NB" --text notes.txt --title "My notes" # or --text - to read stdinbash {baseDir}/scripts/upload-file.sh "$NB" ./report.pdf - Wait until Google has processed every source (polls every 10 s, gives up after 10 minutes). A YouTube video without captions ends as
errorand is skipped.bash {baseDir}/scripts/wait-sources.sh "$NB" - Start a generation. It prints the job id (and logs it on stderr). Run it again on the same notebook for more outputs.
JOB=$(bash {baseDir}/scripts/generate.sh "$NB" audio format=deep_dive language=en) JOB=$(bash {baseDir}/scripts/generate.sh "$NB" slides format=detailed) - Wait for the job (polls every 15 s) and save the final record:
bash {baseDir}/scripts/wait-job.sh "$JOB" > job.json - Download the file(s). Prints the saved paths:
bash {baseDir}/scripts/download.sh job.json ./out
Timeouts and resuming
If a run is interrupted after the generation started, do not run it again: that spends the user's Gemini Notebook usage twice. generate.sh logs the job id on stderr (job job:...). Resume with it:
bash {baseDir}/scripts/wait-job.sh "<jobid>" > job.json && bash {baseDir}/scripts/download.sh job.json
Errors
HTTP 401: the token is wrong.HTTP 404fromcreate-notebook.sh:USEAPI_EMAILis not a connected account.HTTP 596: the Google account needs to be reconnected: https://useapi.net/docs/start-here/setup-gemini-notebookHTTP 429fromgenerate.sh: the account is busy (maxJobsjobs already running) or Google's usage window is used up.retryAtin the body says when it resets. Tell the user and retry then. Do not loop on it.HTTP 409fromgenerate.sh: no source isreadyyet. Runwait-sources.shfirst.- A failed job prints its
error. A job still running after 40 minutes is failed by the API withtimeout.
After it finishes
Tell the user the file path(s) and the title (result.title in job.json; audio and video also carry result.duration in seconds). The notebook stays in their Gemini Notebook (NotebookLM) account, so they can open it there or generate more from it with generate.sh "$NB" ....
About
- Third-party service by useapi.net, not affiliated with or endorsed by Google. Gemini Notebook and NotebookLM are Google's names for its product.
- API docs: https://useapi.net/docs/api-gemini-notebook-v1?utm_source=clawhub.ai&utm_medium=skill&utm_campaign=clawhub-gemini-notebook
- Example code, a Dify plugin and a hosted MCP server (57 tools): https://github.com/useapi/notebooklm-api
- Support: support@useapi.net, Discord https://discord.gg/w28uK3cnmF, Telegram https://t.me/use_api
