How I Fixed a Breaking Spotify API, Cut AI Costs by 78%, and Built a Morning Briefing Worth Waking Up For
Some days the work is glamorous. Today was not one of those days.
Today was OAuth errors, deprecated API endpoints, and a 403 Forbidden that gave me no useful information. It was also the day I shipped three personalized Spotify playlists to family members, rebuilt my morning briefing from the ground up, and cut my AI infrastructure costs by 78%. So: mixed bag, net positive.
Here is what actually happened.
The Spotify API Deprecation Nobody Announced
In February 2026, Spotify deprecated the /v1/playlists/{id}/tracks endpoint for new developer-mode apps. No announcement. No deprecation warning in the API response. Just a clean 403 Forbidden with no body.
I spent about an hour trying every variation: POST vs PUT, query parameters vs body, different auth headers. All 403. Eventually I found the replacement buried in a changelog: /v1/playlists/{id}/items. Same request body, same auth, different path. Both 200 and 201 are valid success codes depending on the operation.
One line change. Everything started working.
The lesson is not “check the changelog” (though yes, check the changelog). The lesson is that a 403 on a previously working endpoint that is definitively not an auth issue is almost always a deprecation. Debug accordingly.
What I Built Once the API Worked
With the endpoint fixed, I put the Spotify integration to immediate use. I built a mood-based playlist generator that maps text descriptions to Spotify audio feature targets (energy, valence, tempo, acousticness) and generates playlists via the Recommendations API.
Then I used it to create three personalized playlists for people I care about:
- Filthy Scouser for my friend Sam, 15 Liverpool FC-themed tracks
- Pillemer Love, Featuring the Floop for Daphna, 15 romantic tracks
- Shelleys Golden Hits for my mum, who turns 75 this year, 15 classics from the 70s through 90s
Each was delivered via WhatsApp with a personal message. The whole thing, from idea to three playlists sent, took about 20 minutes once the API was unblocked.
The mood-to-audio-features mapping is where the real work is. For the Shelley playlist specifically: low energy, high acousticness, high valence, slow tempo. The Recommendations API did the rest.
Rebuilding the Morning Briefing
My daily morning briefing runs automatically at 7 AM Jerusalem time and delivers a summary to Telegram. Today I made two meaningful changes.
The first was adding an urgent email filter. The briefing now scans the inbox and surfaces only messages from known business contacts, filtering out the noise. It is a small thing but changes the quality of the morning significantly.
The second was adding a Song of the Day. The briefing now includes a curated Spotify track with a direct link, rotating through a list of 10 tracks based on the day of year. It takes 30 seconds of the briefing and changes the tone of the whole thing. A morning that starts with useful information and a good song is a different morning than one that starts with a wall of text.
Cutting AI Infrastructure Costs by 78%
This one is worth going into.
My AI infrastructure runs a set of scheduled jobs: morning briefing, habit tracking, Strava analysis, blog generation, and a few others. Previously these all ran on Sonnet 4. After switching all scheduled jobs to Claude Haiku 4.5 with prompt caching and output token caps, the projected monthly cost drops from around $140 to around $26. Annualized, that is roughly $1,400 in savings.
The quality difference on scheduled, deterministic tasks is negligible. Haiku 4.5 handles structured output and summarization well. The place to spend on Sonnet 4 is interactive sessions where reasoning quality genuinely matters. Scheduled cron jobs are not that.
The rule I arrived at: if a task runs on a schedule and the output is consumed asynchronously, run it on the cheapest model that produces acceptable output. Reserve expensive models for real-time reasoning where being wrong has a cost.
OAuth Debugging: Google Drive
Also today: my Google Drive integration stopped working. HTTP 401 Unauthorized, which after the Spotify episode I was at least familiar with as a category of problem.
Root cause: the refresh token had expired or been invalidated, likely from a session that did not complete cleanly. The fix was a direct token refresh via the OAuth endpoint, bypassing the auto-refresh mechanism, saving the new access token, and confirming the API call worked on first attempt.
Google Drive is now back to fully operational. This integration matters because it gives my automation stack access to lease documents, financial spreadsheets, and project files without manual retrieval. When those go down, other things break downstream.
The Actual Work of Building AI Infrastructure
The through-line today was not any single fix. It was the reminder that building a personal AI infrastructure is mostly maintenance. Not in a discouraging way. In the way that owning anything useful is maintenance.
APIs change without warning. OAuth tokens expire. Cost structures drift. The morning briefing that was good three weeks ago is not the same as the morning briefing that is good today.
The wins compound, though. Three personalized playlists delivered to family members. A morning routine that now includes a song. An infrastructure that costs 78% less to run. A Drive integration that works again.
That is a good day’s work, even if most of it was 403 errors and token refreshes.
Devin Pillemer, Tel Aviv, March 9 2026