<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: PixelVault</title>
    <description>The latest articles on DEV Community by PixelVault (@pixelvault).</description>
    <link>https://dev.to/pixelvault</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4239410%2Fac3eb0be-316f-45f1-a1f7-6689288619e6.png</url>
      <title>DEV Community: PixelVault</title>
      <link>https://dev.to/pixelvault</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pixelvault"/>
    <language>en</language>
    <item>
      <title>Compress images in a pre-commit hook and in CI</title>
      <dc:creator>PixelVault</dc:creator>
      <pubDate>Sun, 06 Dec 2026 09:06:18 +0000</pubDate>
      <link>https://dev.to/pixelvault/compress-images-in-a-pre-commit-hook-and-in-ci-5209</link>
      <guid>https://dev.to/pixelvault/compress-images-in-a-pre-commit-hook-and-in-ci-5209</guid>
      <description>&lt;p&gt;Somebody (or some coding agent) adds a screenshot to the docs, and the PNG is 4 MB. Nobody notices in review, because the diff of a binary file is just "changed".&lt;/p&gt;

&lt;p&gt;A few months later the repo is heavy, the docs page is slow, and every clone downloads the same oversized images.&lt;/p&gt;

&lt;p&gt;The fix is boring and mechanical, so automate it: compress images before they are committed, and make CI fail when one slips through. One command does both. It needs no account and uploads nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick answer
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx pixelvault-cli optimize ./docs/images -r --in-place
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It needs Node 20.9+ and runs locally. It never writes a file bigger than the original.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pre-commit: run it on staged images only, then re-stage them.&lt;/li&gt;
&lt;li&gt;CI: run it, then &lt;code&gt;git diff --exit-code&lt;/code&gt;. Any changed file is an image someone forgot, so the build fails.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--in-place&lt;/code&gt; overwrites files with no undo. Only use it on files under version control.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The one command
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;optimize&lt;/code&gt; resizes, converts and strips metadata, and prints the saving for each file. A few properties make it safe in automation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It never writes a bigger file.&lt;/strong&gt; If an image can't be made smaller, it is left alone and reported as already optimal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It is idempotent.&lt;/strong&gt; Running it again over compressed images changes nothing, so a hook or CI check doesn't nibble at the same file every time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It refuses to lose data.&lt;/strong&gt; It stops before writing if two inputs would produce the same output file, or an output would overwrite an input. It writes through a temporary file, so an interrupted run can't truncate an image.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Metadata is stripped&lt;/strong&gt; (camera details, GPS location) after rotation is applied, so the photo still displays the right way up. Add &lt;code&gt;--keep-metadata&lt;/code&gt; if you need it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Formats:&lt;/strong&gt; JPG, PNG, WebP and AVIF. GIF, SVG, animated images and iPhone HEIC are skipped.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Useful variations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Preview the saving without touching anything&lt;/span&gt;
npx pixelvault-cli optimize ./docs/images -r --dry-run

&lt;span class="c"&gt;# Convert a folder to WebP, capped at 1600px wide, into a separate directory&lt;/span&gt;
npx pixelvault-cli optimize ./shots -r --format webp --max-width 1600 --out-dir ./optimized

&lt;span class="c"&gt;# Machine-readable report (always a JSON array)&lt;/span&gt;
npx pixelvault-cli optimize ./docs/images -r --json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The default format is &lt;code&gt;keep&lt;/code&gt;, so a PNG stays a PNG (lossless) and a JPEG stays a JPEG. Converting to WebP usually saves the most, but it changes the extension, so update any references to the old name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compress staged images in a pre-commit hook
&lt;/h2&gt;

&lt;p&gt;Save this as &lt;code&gt;.git/hooks/pre-commit&lt;/code&gt; (or call it from your hook manager) and make it executable. It compresses only the images you are about to commit, then re-stages them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/sh&lt;/span&gt;
&lt;span class="c"&gt;# Compress staged images before they reach the repo.&lt;/span&gt;
&lt;span class="nv"&gt;staged&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;git diff --cached --name-only --diff-filter=AM &lt;span class="o"&gt;|&lt;/span&gt; grep -Ei &lt;span class="s1"&gt;'\.(png|jpe?g|webp|avif)$'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt; -z &lt;span class="s2"&gt;"$staged"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt; 0

&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s\n'&lt;/span&gt; &lt;span class="s2"&gt;"$staged"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; tr &lt;span class="s1"&gt;'\n'&lt;/span&gt; &lt;span class="s1"&gt;'\0'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; xargs -0 npx --yes pixelvault-cli optimize --in-place &lt;span class="o"&gt;&amp;gt;&amp;amp;&lt;/span&gt;2
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s\n'&lt;/span&gt; &lt;span class="s2"&gt;"$staged"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; tr &lt;span class="s1"&gt;'\n'&lt;/span&gt; &lt;span class="s1"&gt;'\0'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; xargs -0 git add
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--in-place&lt;/code&gt; is fine here because the files are about to be committed anyway.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fail the build when an image is not optimized
&lt;/h2&gt;

&lt;p&gt;Hooks can be skipped, so add a CI check too. Because &lt;code&gt;optimize&lt;/code&gt; is idempotent, a repo with compressed images produces no changes. Anything it does change is exactly the set of images someone forgot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# .github/workflows/images.yml
&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check images&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pull_request&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;optimize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v4&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Compress images&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npx --yes pixelvault-cli optimize ./docs ./public -r --in-place&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Fail if any image was not optimized&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;git diff --exit-code --stat || {&lt;/span&gt;
            &lt;span class="na"&gt;echo "Some images were not optimized. Run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npx pixelvault-cli optimize &amp;lt;dir&amp;gt; -r --in-place"&lt;/span&gt;
            &lt;span class="s"&gt;exit 1&lt;/span&gt;
          &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adjust the directories to where your images live. The command stops with an error if a path doesn't exist. If you would rather have CI fix the images than fail, commit the result back to the branch instead of running &lt;code&gt;git diff --exit-code&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make your AI coding agent do it
&lt;/h2&gt;

&lt;p&gt;Coding agents take a lot of screenshots, so they are a likely source of oversized images. Two ways to nudge them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add one line to your &lt;code&gt;CLAUDE.md&lt;/code&gt; or &lt;code&gt;AGENTS.md&lt;/code&gt;: "Before committing images, run &lt;code&gt;npx pixelvault-cli optimize &amp;lt;files&amp;gt; --in-place&lt;/code&gt;."&lt;/li&gt;
&lt;li&gt;Install the PixelVault skill (&lt;code&gt;npx skills add pixelvault-dev/skill&lt;/code&gt;), which includes &lt;code&gt;/pixelvault-optimize&lt;/code&gt;. It tells the agent to preview with &lt;code&gt;--dry-run&lt;/code&gt; first, prefer a separate output unless the files are committed, and report the saving.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prefer not to install anything?
&lt;/h2&gt;

&lt;p&gt;For a handful of images, use the &lt;a href="https://pixelvault.dev/tools/image-compressor/" rel="noopener noreferrer"&gt;free in-browser image compressor&lt;/a&gt;. Drop your files in, pick a format, quality and maximum width, and download the results. Nothing is uploaded unless you click "Get a link".&lt;/p&gt;

&lt;h2&gt;
  
  
  When you also want a hosted URL
&lt;/h2&gt;

&lt;p&gt;If a compressed image needs a public URL (a README, an email, a docs page that shouldn't carry the binary), add &lt;code&gt;--host&lt;/code&gt; to upload the result and print its CDN URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx pixelvault-cli optimize hero.png --host
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That step needs a PixelVault account and API key. Compressing locally never does.&lt;/p&gt;

&lt;p&gt;Original post, with the full workflow diagram: &lt;a href="https://pixelvault.dev/blog/compress-images-in-ci-and-pre-commit/" rel="noopener noreferrer"&gt;pixelvault.dev/blog/compress-images-in-ci-and-pre-commit&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>devops</category>
      <category>github</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Host and optimize Astro images on a CDN with @pixelvault-dev/astro</title>
      <dc:creator>PixelVault</dc:creator>
      <pubDate>Sun, 29 Nov 2026 09:18:19 +0000</pubDate>
      <link>https://dev.to/pixelvault/host-and-optimize-astro-images-on-a-cdn-with-pixelvault-devastro-ln4</link>
      <guid>https://dev.to/pixelvault/host-and-optimize-astro-images-on-a-cdn-with-pixelvault-devastro-ln4</guid>
      <description>&lt;p&gt;I just released &lt;code&gt;@pixelvault-dev/astro&lt;/code&gt;, an integration for Astro 5 and 6 with zero runtime dependencies. It ships three pieces you can use together or alone:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A typed &lt;code&gt;PixelVaultImage&lt;/code&gt; component with responsive &lt;code&gt;srcset&lt;/code&gt; and automatic WebP/AVIF.&lt;/li&gt;
&lt;li&gt;A custom image service, so Astro's built-in &lt;code&gt;&amp;lt;Image /&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;Picture /&amp;gt;&lt;/code&gt; offload resizing to the edge (no Sharp download at build time).&lt;/li&gt;
&lt;li&gt;A Content Layer loader that syncs your media into a typed collection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install @pixelvault-dev/astro
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then add &lt;code&gt;pixelvault()&lt;/code&gt; to &lt;code&gt;integrations&lt;/code&gt; in &lt;code&gt;astro.config.mjs&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// astro.config.mjs&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;defineConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"astro/config"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pixelvault&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"@pixelvault-dev/astro"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;integrations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nf"&gt;pixelvault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// Optional custom domains connected to your PixelVault projects:&lt;/span&gt;
      &lt;span class="n"&gt;domains&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"cdn.example.com"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And render PixelVault URLs with Astro's standard &lt;code&gt;&amp;lt;Image /&amp;gt;&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---
import { Image } from "astro:assets";
---

&amp;lt;Image
  src="https://img.pixelvault.dev/proj_xyz789/img_abc123.jpg"
  width={800}
  height={450}
  widths={[400, 800, 1600]}
  sizes="(max-width: 800px) 100vw, 800px"
  alt="Hosted on PixelVault"
/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Docs: &lt;a href="https://pixelvault.dev/docs/astro/" rel="noopener noreferrer"&gt;https://pixelvault.dev/docs/astro/&lt;/a&gt;&lt;br&gt;
Source: &lt;a href="https://github.com/pixelvault-dev/astro" rel="noopener noreferrer"&gt;https://github.com/pixelvault-dev/astro&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Free tier: 200 MB, 500 uploads/month, no credit card. Feedback and issues welcome.&lt;/p&gt;

</description>
      <category>astro</category>
      <category>webdev</category>
      <category>performance</category>
      <category>images</category>
    </item>
    <item>
      <title>Generate an image and get a hosted URL in one API call</title>
      <dc:creator>PixelVault</dc:creator>
      <pubDate>Tue, 24 Nov 2026 18:17:13 +0000</pubDate>
      <link>https://dev.to/pixelvault/generate-an-image-and-get-a-hosted-url-in-one-api-call-2o79</link>
      <guid>https://dev.to/pixelvault/generate-an-image-and-get-a-hosted-url-in-one-api-call-2o79</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://pixelvault.dev/blog/generate-images-with-one-api-call/" rel="noopener noreferrer"&gt;PixelVault blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The usual flow is generate, download, upload, then paste the link. Most image-generation APIs hand you something awkward to keep: a URL that expires, or a blob of base64. To use the picture anywhere (a README, an email, a CMS, a pull request) you still have to download it and upload it somewhere stable. An agent doing that has three tools to call and two places to fail.&lt;/p&gt;

&lt;p&gt;We added &lt;code&gt;POST /v1/images/generate&lt;/code&gt; to collapse that. You send a prompt, a Cloudflare Workers AI model draws the image, and PixelVault stores it and returns the URL in the same response.&lt;/p&gt;

&lt;h2&gt;
  
  
  One call: prompt in, hosted image out
&lt;/h2&gt;

&lt;p&gt;You need a PixelVault API key (a secret key and a verified email) and nothing else. No separate AI account or bucket.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s -X POST https://api.pixelvault.dev/v1/images/generate \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $PIXELVAULT_API_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"prompt":"Isometric flat illustration of a tidy desk with a laptop, a small potted plant and a coffee cup, soft pastel colors, no text"}'&lt;/span&gt; \
  &lt;span class="o"&gt;|&lt;/span&gt; jq -r &lt;span class="s1"&gt;'.data.url'&lt;/span&gt;

&lt;span class="c"&gt;# → https://img.pixelvault.dev/proj_…/img_….jpg&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"https://api.pixelvault.dev/v1/images/generate"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"POST"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Bearer "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PIXELVAULT_API_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"Content-Type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"application/json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Minimal studio backdrop for product photos, terracotta pedestal, soft morning light, no text"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;        &lt;span class="c1"&gt;// the hosted image&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;generation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// { model, credits_charged, credits_remaining }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s2"&gt;"https://api.pixelvault.dev/v1/images/generate"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Bearer {os.environ['PIXELVAULT_API_KEY']}"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"prompt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Abstract gradient background in indigo and orange, soft glow, no text"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;         &lt;span class="c1"&gt;# the hosted image&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"generation"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# model, credits_charged, credits_remaining&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response is the same payload an upload returns, plus a &lt;code&gt;generation&lt;/code&gt; block that tells you what it cost. This is a real one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"img_rnvpd6170k5c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://img.pixelvault.dev/proj_mkoboesmx25d/img_rnvpd6170k5c.jpg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"optimized_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"…/img_rnvpd6170k5c.jpg?fmt=auto&amp;amp;q=85"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"mime_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"image/jpeg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"size"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;160196&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"width"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"height"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"generation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"flux-1-schnell"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"credits_charged"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"credits_remaining"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Calls took three to four seconds end to end in our production runs. The image comes back as a 1024×1024 file: 160 KB as a JPEG, and the &lt;code&gt;optimized_url&lt;/code&gt; serves the same picture as WebP at 21.8 KB, which is the one to put in a page or an email.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it produces
&lt;/h2&gt;

&lt;p&gt;The default model, &lt;code&gt;flux-1-schnell&lt;/code&gt;, is good at illustrations, backgrounds and abstract art. It does not follow every instruction literally: in our desk example the model drew two coffee cups, and the gradient came out warmer than "deep indigo and orange" suggests. Treat the first result as a draft, and rerun or reword the prompt when it matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Crop it for the platform without another tool
&lt;/h2&gt;

&lt;p&gt;The result is a normal PixelVault image, so every &lt;a href="https://pixelvault.dev/docs/transforms/" rel="noopener noreferrer"&gt;URL transform&lt;/a&gt; works on it. A social background cropped to the 1200×630 Open Graph size is just a query string on the URL you already have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;…/img_xs7dx8d9uvy1.jpg?w=1200&amp;amp;h=630&amp;amp;fit=cover&amp;amp;fmt=auto
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generate once, then resize per channel with a URL. Nothing is re-uploaded.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use it from Claude or any MCP client
&lt;/h2&gt;

&lt;p&gt;The same capability is a tool, &lt;code&gt;generate_image&lt;/code&gt;, on the PixelVault &lt;a href="https://pixelvault.dev/blog/mcp-image-hosting/" rel="noopener noreferrer"&gt;MCP server&lt;/a&gt; and on the OAuth connector you add to Claude. &lt;a href="https://pixelvault.dev/docs/claude/" rel="noopener noreferrer"&gt;Connect PixelVault to Claude&lt;/a&gt;, then ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use PixelVault to generate a minimalist hero image of a mountain at sunrise, flat illustration, and give me the CDN URL and Markdown.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The tool returns the same fields as the API, including how many credits are left.&lt;/p&gt;

&lt;h2&gt;
  
  
  Models and credits
&lt;/h2&gt;

&lt;p&gt;Generation draws from a monthly credit grant instead of counting images, because the models differ a lot in cost.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Credits per image&lt;/th&gt;
&lt;th&gt;Plans&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;flux-1-schnell (default)&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;All, including Free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sdxl-lightning, sdxl-base (beta)&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Starter, Pro&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;lucid-origin, phoenix-1.0 (Leonardo)&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;Starter, Pro&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Free: 10 credits a month, which is ten flux-1-schnell images.&lt;/li&gt;
&lt;li&gt;Starter: 300 credits a month. Pro: 1,500.&lt;/li&gt;
&lt;li&gt;Credits reset on the first of each month (UTC). Deleting an image does not give its credit back.&lt;/li&gt;
&lt;li&gt;If a generation fails or the image can't be stored, the credit is refunded.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A generated image also counts toward your normal upload and storage limits.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits and what the errors mean
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;402 generation_credits_exhausted&lt;/code&gt;: out of credits until the first, or upgrade. Don't retry.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;402 model_requires_paid_plan&lt;/code&gt;: the free plan can only use flux-1-schnell.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;429&lt;/code&gt;: 60 generations per hour per account, or the service is at daily capacity. Honor &lt;code&gt;Retry-After&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;422 prompt_rejected&lt;/code&gt;: prompts that clearly ask for adult content are refused.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;502&lt;/code&gt;, &lt;code&gt;503&lt;/code&gt;, &lt;code&gt;504&lt;/code&gt;: the model failed or timed out. Your credit is refunded and it is safe to retry.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full list is in the &lt;a href="https://pixelvault.dev/docs/guides/generate-images/" rel="noopener noreferrer"&gt;API guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it fits, and where it doesn't
&lt;/h2&gt;

&lt;p&gt;These are open models served by Cloudflare Workers AI. They are not the largest models available, so for exact text in the image or photoreal faces, test your own prompt first. Each model carries its own license, so check &lt;a href="https://developers.cloudflare.com/workers-ai/models/" rel="noopener noreferrer"&gt;Cloudflare's model catalog&lt;/a&gt; before commercial use.&lt;/p&gt;

&lt;p&gt;If you already generate images with another tool, our guide to &lt;a href="https://pixelvault.dev/blog/host-ai-generated-images/" rel="noopener noreferrer"&gt;hosting AI-generated images&lt;/a&gt; covers turning expiring URLs and base64 blobs into stable ones. And if you only need a quick link for an existing picture, the free &lt;a href="https://pixelvault.dev/tools/image-to-url/" rel="noopener noreferrer"&gt;image to URL tool&lt;/a&gt; needs no account; the link lasts 24 hours unless you sign up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The free plan includes 10 generation credits a month with no card. &lt;a href="https://pixelvault.dev/signup/" rel="noopener noreferrer"&gt;Create an account&lt;/a&gt;, grab your key, and run the curl example above. Keeping images beyond the free tier depends on your plan and PixelVault's retention policy, so check the &lt;a href="https://pixelvault.dev/pricing/" rel="noopener noreferrer"&gt;pricing page&lt;/a&gt; for the current terms.&lt;/p&gt;

</description>
      <category>api</category>
      <category>webdev</category>
      <category>ai</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Notion Image URLs Expire in an Hour - Here's the Fix</title>
      <dc:creator>PixelVault</dc:creator>
      <pubDate>Tue, 17 Nov 2026 12:10:45 +0000</pubDate>
      <link>https://dev.to/pixelvault/notion-image-urls-expire-in-an-hour-heres-the-fix-206a</link>
      <guid>https://dev.to/pixelvault/notion-image-urls-expire-in-an-hour-heres-the-fix-206a</guid>
      <description>&lt;p&gt;You wired Notion up as a CMS, pulled a page through the API, and shipped. The build looked perfect. An hour later every image on the site is a broken box, and the network tab shows &lt;code&gt;403&lt;/code&gt; from an &lt;code&gt;amazonaws.com&lt;/code&gt; host you never configured. Nothing regressed - Notion's file URLs are presigned and short-lived by design. Here's what's actually happening, and the one call that fixes it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6vl4eqm1lvl0mfy394e3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6vl4eqm1lvl0mfy394e3.png" alt="A document page's expiring signed image link on the left being re-hosted into a stable PixelVault URL through a vault aperture on the right" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This hero is hosted on PixelVault itself - a stable &lt;code&gt;img.pixelvault.dev&lt;/code&gt; URL, the same kind this post shows you how to get for a Notion image.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Notion image URLs break
&lt;/h2&gt;

&lt;p&gt;Pull an image block out of the Notion API and look at what comes back. For a Notion-hosted file you get a short-lived signed URL - typically an S3 presigned link, something like:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://prod-files-secure.s3.us-west-2.amazonaws.com/…?X-Amz-Algorithm=…&amp;amp;X-Amz-Expires=3600&amp;amp;X-Amz-Signature=…&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Don't key off that hostname, though - Notion has served files from more than one, and its own reference shows a different S3 form. The contractual part is in the response body: alongside &lt;code&gt;url&lt;/code&gt;, Notion returns an &lt;code&gt;expiry_time&lt;/code&gt; timestamp, and the docs are explicit that the URL "is valid for one hour. If the link expires, send an API request to get an updated URL." Notion keeps uploads in a private bucket and mints a fresh signature each time you read the block; once it lapses, the storage host rejects the request and you get a &lt;code&gt;403&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Inside Notion you never notice, because the app re-reads the block - and therefore re-signs the URL - every time you open the page. Anything outside Notion never gets that refresh. The URL you baked into your HTML at build time is a snapshot of a credential that has already expired by the time a reader loads the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this actually breaks
&lt;/h2&gt;

&lt;p&gt;The failure is delayed, which is what makes it so confusing - it always works when you test it, and it's always broken when someone else looks. In practice it bites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Static site builds.&lt;/strong&gt; Notion → Astro, Next, Hugo, Eleventy. The URL is frozen into the generated HTML and dies an hour after the build, not an hour after the visit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RSS feeds and newsletters.&lt;/strong&gt; The image was fine when the feed was generated and dead by the time it's opened - and an email lives in an inbox for years. (Same reason &lt;a href="https://pixelvault.dev/blog/host-images-in-resend-emails/" rel="noopener noreferrer"&gt;images in transactional email need their own host&lt;/a&gt;.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open Graph and social cards.&lt;/strong&gt; Scrapers fetch the URL later, on their own schedule, and cache a broken result.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docs sites and wikis&lt;/strong&gt; that mirror Notion content into another surface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agents and LLM ingestion.&lt;/strong&gt; Anything that crawls your content and stores an image reference is storing a dead link.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Notion's own answer, and where it stops
&lt;/h2&gt;

&lt;p&gt;Notion's documented guidance is to re-fetch the page to get a fresh URL. That's a real fix for a live application - if your app queries Notion on every request, the signed URL it hands the browser is always minutes old and it works fine. Credit where it's due: for a server-rendered dashboard reading Notion in real time, this is genuinely enough, and you can stop here.&lt;/p&gt;

&lt;p&gt;It stops working the moment the URL outlives the request that produced it. A static build, a sent email, a cached CDN response, an OG scrape - none of those can go back and ask Notion for a new signature. You'd be re-fetching on a cron and rewriting published HTML, which is a lot of machinery for what is really a storage problem.&lt;/p&gt;

&lt;p&gt;There is one more native option worth knowing: Notion distinguishes &lt;code&gt;file&lt;/code&gt; images (uploaded to Notion, signed, expiring) from &lt;code&gt;external&lt;/code&gt; images (a URL you supply, passed through untouched). Notion passes external URLs through untouched - it doesn't wrap them in a one-hour signature, because it isn't hosting the bytes. (Their durability is then whatever the host you pointed at provides, which is the point: pick one you trust.) That's the actual shape of the fix - you just need a URL to point at.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: re-host once, at build time
&lt;/h2&gt;

&lt;p&gt;Fetch each image while its signature is still valid, store it somewhere you control, and use that URL from then on. PixelVault does this in a single call: hand it the signed Notion URL and it fetches the bytes server-side, so you never download or buffer the image in your own build. What comes back is a stable, immutable CDN URL (retention details at the end).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Build step: swap Notion's 1-hour signed URLs for stable, hosted ones.&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;isFullBlock&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"@notionhq/client"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;notion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;NOTION_TOKEN&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;pageId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;NOTION_PAGE_ID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;hosted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// block id → hosted URL&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;rehost&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sourceUrl&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// PixelVault fetches the signed URL server-side, while it's still valid.&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"https://api.pixelvault.dev/v1/images"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"POST"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nc"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${process.env.PIXELVAULT_API_KEY}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="s2"&gt;"Content-Type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"application/json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;sourceUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"notion"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`Re-host failed: ${res.status}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Children come back 100 at a time, and images nest inside columns,&lt;/span&gt;
&lt;span class="c1"&gt;// toggles and callouts - so page through, and recurse.&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blockId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;notion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;blocks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;block_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;blockId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;start_cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;block&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;isFullBlock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="c1"&gt;// "file" = Notion-hosted, signed + expiring (see file.expiry_time).&lt;/span&gt;
      &lt;span class="c1"&gt;// "external" = a URL you already own, left alone.&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"image"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"file"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;hosted&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;rehost&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;has_children&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;cursor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;next_cursor&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pageId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hosted&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// → { "&amp;lt;block-id&amp;gt;": "https://img.pixelvault.dev/…" }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# One call: hand PixelVault the signed Notion URL, get a stable one back.&lt;/span&gt;
&lt;span class="c"&gt;# NOTION_FILE_URL is block.image.file.url, still inside its 1-hour window.&lt;/span&gt;
curl -X POST https://api.pixelvault.dev/v1/images \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $PIXELVAULT_API_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s2"&gt;"{\"url\":\"$NOTION_FILE_URL\"}"&lt;/span&gt; \
  &lt;span class="o"&gt;|&lt;/span&gt; jq -r &lt;span class="s1"&gt;'.data.url'&lt;/span&gt;
&lt;span class="c"&gt;# → https://img.pixelvault.dev/proj_abc/img_xyz.png&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run that as part of your build, or once per page when content changes, and cache the result - the returned URL is stable, so there's no reason to re-host the same image on every build. Passing &lt;code&gt;folder&lt;/code&gt; keeps a Notion sync tidily separated from the rest of your images.&lt;/p&gt;

&lt;p&gt;Two things the snippet is deliberately explicit about, because both are easy to get wrong and fail silently: children come back 100 at a time, so you have to follow &lt;code&gt;next_cursor&lt;/code&gt;, and images nest inside columns, toggles and callouts, so you have to recurse on &lt;code&gt;has_children&lt;/code&gt;. Skip either and you'll re-host some images, ship a build that still has broken ones, and have no obvious signal that anything was missed. It covers image blocks; page covers and &lt;code&gt;files&lt;/code&gt; properties on database rows are the same &lt;code&gt;file&lt;/code&gt;/&lt;code&gt;external&lt;/code&gt; shape and re-host the same way. (This is plain JS - in TypeScript, &lt;code&gt;isFullBlock&lt;/code&gt; is also what narrows &lt;code&gt;results&lt;/code&gt; so &lt;code&gt;block.type&lt;/code&gt; typechecks.)&lt;/p&gt;

&lt;p&gt;If you want the hosted URL to live in Notion too, append a new &lt;code&gt;external&lt;/code&gt; image block or store it in a URL property - Notion passes those through untouched, so there's no signature to expire.&lt;/p&gt;

&lt;h2&gt;
  
  
  The timing caveat
&lt;/h2&gt;

&lt;p&gt;This only works while the signed URL is still alive. A Notion URL you saved in a database last week is already dead, and no service can re-host bytes it can't fetch - if a tool claims otherwise, be suspicious. The fix is always to re-read the block from the Notion API first, which mints a fresh signature, and re-host from that. Your content is safe in Notion; it's only the link that's perishable.&lt;/p&gt;

&lt;p&gt;Two practical limits worth knowing up front: uploads cap at 5 MB per image on the free plan (more on paid plans), and the URL import path requires an API key (a keyless request can upload a file, but won't fetch an arbitrary URL for you).&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving off Notion with an export
&lt;/h2&gt;

&lt;p&gt;If you're leaving Notion rather than syncing from it (to Obsidian, a docs site, a GitHub wiki), you probably used Export → Markdown &amp;amp; CSV instead of the API. That avoids the one-hour URLs: the ZIP contains the image files themselves, next to the pages. The catch is that the Markdown now points at local paths, URL-encoded and inside folders named after each page. They work on your laptop and break as soon as the pages are published anywhere the folders don't come along.&lt;/p&gt;

&lt;p&gt;This script walks the unzipped export, uploads each local image to PixelVault once, and rewrites the links to hosted URLs. It needs Node 18 or later and an API key. One thing to decide first: the new URLs are public, so anyone with a link can open the image, while pages in a private Notion workspace weren't. Leave out anything confidential.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// rehost-local-images.mjs&lt;/span&gt;
&lt;span class="c1"&gt;// Usage: PIXELVAULT_API_KEY=... node rehost-local-images.mjs ./export&lt;/span&gt;
&lt;span class="c1"&gt;// Finds Markdown images that point at local files, uploads each file to&lt;/span&gt;
&lt;span class="c1"&gt;// PixelVault once, and rewrites the link in place. rehosted.json keeps the&lt;/span&gt;
&lt;span class="c1"&gt;// file -&amp;gt; URL map, so a re-run only uploads what is new.&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;writeFile&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;readdir&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"node:fs/promises"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;basename&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;resolve&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"node:path"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PIXELVAULT_API_KEY&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Set PIXELVAULT_API_KEY first."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s2"&gt;"."&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;MAP&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"rehosted.json"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;map&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;MAP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"utf8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"{}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;markdownFiles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dir&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;readdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dir&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;withFileTypes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dir&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isDirectory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;yield&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;markdownFiles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;endsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;".md"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;upload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FormData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"file"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Blob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;basename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"folder"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"migration"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"dedupe"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"true"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"https://api.pixelvault.dev/v1/images"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"POST"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${process.env.PIXELVAULT_API_KEY}`&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${file}: ${res.status} ${await res.text()}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// "my%20shot.png" -&amp;gt; "my shot.png", but keep a literal "100% done.png" as is.&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;decodePath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;decodeURIComponent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// ![alt](path), ![alt](), ![alt](path "title") and one level&lt;/span&gt;
&lt;span class="c1"&gt;// of parentheses inside a path, as in ![alt](diagram(v2).png)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;IMAGE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
  &lt;span class="o"&gt;/!&lt;/span&gt;\&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;\&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;\&lt;span class="p"&gt;]&lt;/span&gt;\&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;^&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;+&amp;gt;|&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;?:&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;\&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;\&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;\&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;\&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;\&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s2"&gt;"[^"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="s2"&gt;")?\)/g;

for await (const md of markdownFiles(root)) {
  const text = await readFile(md, "&lt;/span&gt;&lt;span class="n"&gt;utf8&lt;/span&gt;&lt;span class="s2"&gt;");
  let out = text;
  for (const [match, alt, rawTarget, title = ""] of text.matchAll(IMAGE)) {
    const target = rawTarget.replace(/^&amp;lt;|&amp;gt;$/g, "");
    if (/^[a-z][a-z0-9+.-]*:/i.test(target)) continue; // already a URL
    const file = resolve(dirname(md), decodePath(target.split(/[?#]/)[0]));
    try {
      map[file] ??= await upload(file);
    } catch (err) {
      console.error(`skipped ${target} in ${md}: ${err.message}`);
      continue;
    }
    out = out.replace(match, () =&amp;gt; `![${alt}](${map[file]}${title})`);
  }
  if (out !== text) {
    await writeFile(md, out);
    console.log(`rewrote ${md}`);
  }
  await writeFile(MAP, JSON.stringify(map, null, 2));
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It edits files in place, so run it on a copy. It keeps a &lt;code&gt;rehosted.json&lt;/code&gt; map and uploads with &lt;code&gt;dedupe&lt;/code&gt;, so it is safe to stop and re-run. The same script works for Confluence exports, which have the same problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Notion file URLs vs a URL you own
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Notion API file URL&lt;/th&gt;
&lt;th&gt;PixelVault&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Lifetime&lt;/td&gt;
&lt;td&gt;1 hour (&lt;code&gt;X-Amz-Expires&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Does not expire (retention note below)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Safe in a static build&lt;/td&gt;
&lt;td&gt;No - expires post-deploy&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Safe in an email or feed&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Safe to store in a DB&lt;/td&gt;
&lt;td&gt;No - re-read to refresh&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Resize / convert on the fly&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;?w=&lt;/code&gt;, &lt;code&gt;fmt=auto&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost to serve at scale&lt;/td&gt;
&lt;td&gt;n/a (breaks first)&lt;/td&gt;
&lt;td&gt;Zero egress&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  If an agent is doing the sync
&lt;/h2&gt;

&lt;p&gt;Notion-to-site pipelines are increasingly written and run by coding agents, and this is one of those bugs an agent will otherwise ship straight past - the build succeeds, so nothing looks wrong. Connect the PixelVault MCP server and &lt;code&gt;upload_image&lt;/code&gt; takes a &lt;code&gt;source_url&lt;/code&gt;, so the agent can re-host a signed Notion URL as a single tool call without ever pulling the bytes into its context.&lt;/p&gt;

&lt;p&gt;This is the same failure mode as &lt;a href="https://pixelvault.dev/blog/host-images-from-discord/" rel="noopener noreferrer"&gt;Discord's expiring attachment links&lt;/a&gt; and &lt;a href="https://pixelvault.dev/blog/private-user-images-githubusercontent-broken/" rel="noopener noreferrer"&gt;GitHub's private-repo image URLs&lt;/a&gt; - a signed, short-lived CDN link doing a job that needs a stable one. If you're generating the images rather than storing them, &lt;a href="https://pixelvault.dev/blog/host-ai-generated-images/" rel="noopener noreferrer"&gt;hosting AI-generated images&lt;/a&gt; covers that flow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Free to start
&lt;/h2&gt;

&lt;p&gt;PixelVault's free tier includes 200 MB storage, 500 uploads/month, and 1 GB bandwidth - no credit card, zero egress. Enough to back a Notion-powered blog or docs site before you pay anything, and paid plans start at $9/month. Start from the &lt;a href="https://pixelvault.dev/image-hosting-api/" rel="noopener noreferrer"&gt;image hosting API&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;On retention: uploads without an account are temporary (30 days); free-account images stay hosted while the account is active, and images left unused for a long time may be cleaned up (&lt;a href="https://pixelvault.dev/pricing" rel="noopener noreferrer"&gt;the rule&lt;/a&gt;); paid plans keep everything.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>api</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Video to URL: drop an MP4, get a public link. No signup.</title>
      <dc:creator>PixelVault</dc:creator>
      <pubDate>Sun, 15 Nov 2026 19:48:23 +0000</pubDate>
      <link>https://dev.to/pixelvault/video-to-url-drop-an-mp4-get-a-public-link-no-signup-4ol2</link>
      <guid>https://dev.to/pixelvault/video-to-url-drop-an-mp4-get-a-public-link-no-signup-4ol2</guid>
      <description>&lt;p&gt;You're wrapping up a demo video, a screen recording, a clip an agent just rendered. Then the boring part starts: the tool you want to feed it to doesn't want a file. It wants a URL.&lt;/p&gt;

&lt;p&gt;Some social publishing tools work this way. So do a lot of APIs, automation platforms, and agents. They accept a video URL, not an upload dialog. So you end up pushing the file to some random host, waiting for a transcode you didn't ask for, and getting back a watch page instead of a link to the actual video.&lt;/p&gt;

&lt;p&gt;I got tired of that last mile, so I built the thing I wanted: &lt;a href="https://pixelvault.dev/tools/video-to-url/" rel="noopener noreferrer"&gt;Video to URL&lt;/a&gt;, a free tool that does exactly one job. Drop an MP4, get a public, seekable link.&lt;/p&gt;

&lt;p&gt;A few things it deliberately does NOT do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No signup.&lt;/strong&gt; The anonymous link works the moment the upload finishes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No transcoding.&lt;/strong&gt; The file is stored and served as-is, byte for byte. No recompression, no quality loss, no waiting for a "processing" spinner.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No watch page.&lt;/strong&gt; You get a direct CDN URL you can paste into an API call, an HTML &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; tag, or any tool that takes a video URL. Standard players can seek through it, because the CDN answers HTTP range requests.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The limits, up front: MP4 only, up to 25 MB on the anonymous tool, and anonymous links disappear within 24 hours. If you upload something and want to keep it, there's a "Keep this video" button right on the result: it saves that exact MP4 to a free account, no second upload. Bigger files (100 MB on Starter, 250 MB on Pro) and automated uploads go through the &lt;a href="https://docs.pixelvault.dev/" rel="noopener noreferrer"&gt;video upload API&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That's the whole thing. A file goes in, a link comes out, and the person opening it never has to know PixelVault exists.&lt;/p&gt;

&lt;p&gt;If you try it and hit a wall, tell me in the comments - the tool exists because of walls I kept hitting myself.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>video</category>
      <category>api</category>
      <category>showdev</category>
    </item>
    <item>
      <title>How to Host an Image With Your Coding Agent (Claude Code or Codex)</title>
      <dc:creator>PixelVault</dc:creator>
      <pubDate>Wed, 11 Nov 2026 17:51:13 +0000</pubDate>
      <link>https://dev.to/pixelvault/how-to-host-an-image-with-your-coding-agent-claude-code-or-codex-5667</link>
      <guid>https://dev.to/pixelvault/how-to-host-an-image-with-your-coding-agent-claude-code-or-codex-5667</guid>
      <description>&lt;p&gt;You're deep in a Claude Code or Codex session, and now there's an image — a screenshot the agent just took, an asset it downloaded, a diagram it rendered — that needs to become a URL. The agent stalls at that last mile. Here's the exact prompt to hand it, why the raw API call keeps tripping agents up, and the one-command skill that makes hosting boring.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The last mile: getting an image out of a terminal session and turning it into a durable, embeddable URL — without leaving the agent.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Coding agents are great at making images exist. Claude Code takes a screenshot of a failing test. Codex downloads a logo, renders a chart, or generates a diagram. Then comes the part where the whole flow grinds to a halt: the file is sitting on disk in a sandbox, and you need a &lt;em&gt;link&lt;/em&gt; — something you can paste into a PR, a Slack message, a doc, or an &lt;code&gt;og:image&lt;/code&gt; tag. So you break out of the session, open a browser, drag the file somewhere, copy the URL back. The agent did the work in seconds; you spend the next few minutes playing courier.&lt;/p&gt;

&lt;p&gt;The broader case for &lt;a href="https://pixelvault.dev/blog/image-hosting-for-ai-agents/" rel="noopener noreferrer"&gt;why agents get stuck hosting images&lt;/a&gt; is its own post; this is the hands-on version — closing that gap step by step. We'll do it by hand first (so you see exactly what's involved), then collapse it to a single command with the open-source &lt;a href="https://github.com/pixelvault-dev/skill" rel="noopener noreferrer"&gt;PixelVault skill&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  First, the by-hand way — and why agents fumble it
&lt;/h2&gt;

&lt;p&gt;Hosting an image on PixelVault is one HTTP call. From a shell the agent already has — and if your agent runs &lt;a href="https://pixelvault.dev/blog/images-into-cloud-coding-agents/" rel="noopener noreferrer"&gt;in the cloud or over SSH&lt;/a&gt;, the same call works there, no tunnel required — it's this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# The by-hand upload — auth required, multipart only, URL is at .data.url&lt;/span&gt;
curl -s -X POST https://api.pixelvault.dev/v1/images \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $PIXELVAULT_API_KEY"&lt;/span&gt; \
  -F &lt;span class="s2"&gt;"file=@screenshot.png"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; jq -r &lt;span class="s1"&gt;'.data.url'&lt;/span&gt;
&lt;span class="c"&gt;# → https://img.pixelvault.dev/proj_abc123/img_xyz789.png&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simple enough — once. The trouble is that an agent has to get &lt;strong&gt;four&lt;/strong&gt; small things right, every fresh session, with no memory of the last one:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The endpoint.&lt;/strong&gt; &lt;code&gt;POST /v1/images&lt;/code&gt; on &lt;code&gt;api.pixelvault.dev&lt;/code&gt; — not the &lt;code&gt;img.&lt;/code&gt; serve domain, which is a common wrong guess.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The auth.&lt;/strong&gt; A &lt;code&gt;Bearer&lt;/code&gt; token in the &lt;code&gt;Authorization&lt;/code&gt; header. Miss it and you get a 401.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The format.&lt;/strong&gt; The upload is multipart form-data with the field named &lt;code&gt;file&lt;/code&gt; — not a JSON body, not base64, not a remote URL. Agents love to guess JSON here and get a 400.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The response shape.&lt;/strong&gt; The URL lives at &lt;code&gt;.data.url&lt;/code&gt;, inside a &lt;code&gt;data&lt;/code&gt; envelope — not at the top level. Read the wrong path and the agent confidently hands you &lt;code&gt;undefined&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;None of these are hard. All of them are the kind of detail an agent re-derives (and occasionally re-breaks) on every new task. One more thing to know: brand-new accounts can upload 5 images before email verification is required — verify once and the gate lifts. If you &lt;em&gt;do&lt;/em&gt; want to drive it by hand, this is the prompt that gets it right the first time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# The prompt, if you're doing it without the skill:
Host ./screenshot.png on PixelVault and give me the URL.
POST it to https://api.pixelvault.dev/v1/images with my
PIXELVAULT_API_KEY as a Bearer token, as multipart field `file`.
The URL is at .data.url in the JSON response.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The one-command way: install the skill
&lt;/h2&gt;

&lt;p&gt;The better fix is to stop making the agent remember any of that. PixelVault ships a small, open-source &lt;a href="https://github.com/pixelvault-dev/skill" rel="noopener noreferrer"&gt;skill catalog&lt;/a&gt; — plain &lt;code&gt;SKILL.md&lt;/code&gt; files any agent can read — and one of them, &lt;code&gt;pixelvault-upload&lt;/code&gt;, does exactly this job. Install it once and configure your key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install the skill once (writes skill files your agent discovers)&lt;/span&gt;
npx skills add pixelvault-dev/skill
&lt;span class="c"&gt;# Configure your key once (from your Claude Code / Codex session)&lt;/span&gt;
/pixelvault-setup
&lt;span class="c"&gt;# From now on, hosting is one command:&lt;/span&gt;
/pixelvault-upload screenshot.png
&lt;span class="c"&gt;# → https://img.pixelvault.dev/proj_abc123/img_xyz789.png&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the endpoint, the header, the multipart form, and the &lt;code&gt;.data.url&lt;/code&gt; read all live inside the skill. Your prompt drops to the thing you actually meant:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# With the skill installed, the whole prompt is just:
Host screenshot.png and give me the URL.
# Claude Code runs /pixelvault-upload for you (Codex: see the rule
# below). No endpoint, no auth header, no multipart, no .data.url.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent recognizes the intent, runs &lt;code&gt;/pixelvault-upload&lt;/code&gt;, and hands back a hosted &lt;code&gt;https://img.pixelvault.dev/…&lt;/code&gt; URL — globally cached on Cloudflare's edge, served with zero egress, and it won't rot while your account is active (retention details at the end). Same catalog also covers the adjacent jobs: &lt;code&gt;/pixelvault-list&lt;/code&gt; to see recent uploads, &lt;code&gt;/pixelvault-transform&lt;/code&gt; to resize or convert straight from the URL, and &lt;code&gt;/pixelvault-generate&lt;/code&gt; if the image &lt;em&gt;doesn't exist yet&lt;/em&gt; and you want to make one first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Claude Code and Codex
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;npx skills add pixelvault-dev/skill&lt;/code&gt; writes the skill files into your project. &lt;strong&gt;Claude Code discovers them and picks up &lt;code&gt;/pixelvault-upload&lt;/code&gt; automatically&lt;/strong&gt; — that's the auto-discovery it's built for. &lt;strong&gt;Codex&lt;/strong&gt; doesn't auto-discover skills the same way, so point it at one explicitly with a single line in your &lt;code&gt;AGENTS.md&lt;/code&gt;; that's what makes it reach for the hosted-upload flow instead of improvising a curl:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# AGENTS.md (Codex) — one rule so it reaches for the skill every time
When I ask you to host or share an image, use the pixelvault-upload skill
and return the hosted img.pixelvault.dev URL. Never paste base64
or a temporary link into a file — host it and use the URL.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That one rule is worth more than it looks: it stops the agent from re-inventing the by-hand call (and re-making the four mistakes above) on every task. If your agent speaks &lt;a href="https://pixelvault.dev/blog/mcp-image-hosting/" rel="noopener noreferrer"&gt;MCP&lt;/a&gt; instead, that's the other door — connect PixelVault's remote MCP server and &lt;code&gt;upload_image&lt;/code&gt; shows up as a native tool with no skill files at all. Skill or MCP, the agent ends up in the same place: a lasting URL, no browser. Running OpenClaw or Hermes instead? There is a curl-only skill for those that needs no install and no signup for the first upload. A common target is an image in a README or PR the agent is writing — worth hosting properly, since &lt;a href="https://pixelvault.dev/blog/host-images-for-github-readme/" rel="noopener noreferrer"&gt;GitHub's own attachment URLs break&lt;/a&gt; once the repo goes public or the image is viewed outside github.com.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you get back — and what to do with it
&lt;/h2&gt;

&lt;p&gt;The response is a stable, immutable CDN URL. Because PixelVault does transforms from that same URL, one upload becomes every size you need by adding query params — &lt;code&gt;?w=1200&amp;amp;h=630&amp;amp;fmt=auto&lt;/code&gt; for a social card, &lt;code&gt;?w=700&amp;amp;q=auto&lt;/code&gt; for an inline image in a doc. The agent uploads once; the variants come for free. That's the whole point of hosting from inside the session: the URL is immediately usable everywhere the agent is already writing — the PR description, the Markdown, the email template, the OG tag.&lt;/p&gt;

&lt;h2&gt;
  
  
  A note on ownership
&lt;/h2&gt;

&lt;p&gt;Your images live in PixelVault's storage on Cloudflare's edge, served from a zero-egress CDN — so an image that gets popular doesn't hand you a bandwidth bill. &lt;a href="https://pixelvault.dev/pricing/" rel="noopener noreferrer"&gt;Bring-your-own-key (BYOK) is on the roadmap with the paid plans&lt;/a&gt;, alongside custom domains, so you'll be able to point PixelVault at your own R2 or S3 bucket and own the bytes while keeping the same one-call hosting. It's not shipped yet; we'll say so plainly here when it is.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Agents also leave oversized screenshots behind. The same skill bundle includes &lt;code&gt;/pixelvault-optimize&lt;/code&gt;, which compresses images locally before they are committed: see &lt;a href="https://pixelvault.dev/blog/compress-images-in-ci-and-pre-commit/" rel="noopener noreferrer"&gt;compress images in CI and pre-commit&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Give your agent a hosting tool and the courier work disappears. Grab a key by &lt;a href="https://pixelvault.dev/docs" rel="noopener noreferrer"&gt;registering with a single API call&lt;/a&gt;, run &lt;code&gt;npx skills add pixelvault-dev/skill&lt;/code&gt;, and the next time an image needs a home your agent handles it in one step. The free tier includes 200 MB storage, 500 uploads/month, and 1 GB bandwidth — no credit card. Paid plans start at &lt;a href="https://pixelvault.dev/pricing/" rel="noopener noreferrer"&gt;$9/month&lt;/a&gt;. On retention: uploads without an account are temporary (30 days); free-account images stay hosted while the account is active, and images left unused for a long time may be cleaned up (&lt;a href="https://pixelvault.dev/pricing/" rel="noopener noreferrer"&gt;the rule&lt;/a&gt;); paid plans keep everything.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pixelvault.dev/docs" rel="noopener noreferrer"&gt;Read the docs →&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
    <item>
      <title>The indie hacker stack for building with agents in 2026</title>
      <dc:creator>PixelVault</dc:creator>
      <pubDate>Wed, 11 Nov 2026 15:45:37 +0000</pubDate>
      <link>https://dev.to/pixelvault/the-indie-hacker-stack-for-building-with-agents-in-2026-me</link>
      <guid>https://dev.to/pixelvault/the-indie-hacker-stack-for-building-with-agents-in-2026-me</guid>
      <description>&lt;p&gt;A coding agent can write most of a product in a weekend. It can't pick your hosting, hold your Stripe keys or tell you a signup broke at 3am. Here is the stack a solo developer actually needs around the agent, layer by layer, and which piece to set up first.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3jy8syn5rs0grjur1mcf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3jy8syn5rs0grjur1mcf.png" alt="A coding agent assembling a six-layer product stack: agent, hosting, auth and payments, database, image hosting and monitoring" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Six layers around the agent: hosting, auth and payments, database, images and monitoring.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The bottleneck for a solo builder has moved. Writing code is no longer the slow part; an agent in your terminal does most of it. The slow part is everything the agent touches but can't own: where the app runs, who can log in, how money arrives, where data and files live, and how you find out something is broken. Each of those is a service with a dashboard, an API key and a pricing page, and every one you add is something you have to understand when it fails.&lt;/p&gt;

&lt;p&gt;So the rule for this stack is simple: pick tools an agent can drive from the command line or an API, that have a free tier you can launch on, and that you could replace in an afternoon. If you want prices for 40 tools at their first paid tier, &lt;a href="https://jobbit.uk/en/blog/developer-tools-indie-hackers-2026" rel="noopener noreferrer"&gt;Jobbit's Developer Tools for Indie Hackers in 2026&lt;/a&gt; covers auth, payments, email, databases, hosting and monitoring. This post is about how the layers fit together when an agent is doing the building.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The coding agent
&lt;/h2&gt;

&lt;p&gt;This is the layer you'll spend the most hours in, so choose it first and choose it for how it works with your repo, not for benchmark scores. Claude Code, Codex and the agent modes in Cursor and similar editors all read your codebase, run commands and edit files. What matters for an indie project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It runs your real commands. Typecheck, tests, migrations, deploys. An agent that can't run your build will hand you code that doesn't compile.&lt;/li&gt;
&lt;li&gt;It reads project instructions. A &lt;code&gt;CLAUDE.md&lt;/code&gt; or &lt;code&gt;AGENTS.md&lt;/code&gt; at the repo root is where you write down your stack, your commands and your rules once, so you don't repeat them every session.&lt;/li&gt;
&lt;li&gt;It can use tools. Skills and MCP servers let the agent call services directly, which is what makes the rest of this stack agent-friendly instead of a pile of browser tabs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Hosting
&lt;/h2&gt;

&lt;p&gt;For a solo product, you want deploys that happen on &lt;code&gt;git push&lt;/code&gt; and a CLI the agent can run when it needs to. Edge platforms like Cloudflare Workers and Pages, Vercel and Netlify all fit; so does a single small VPS if your app is a long-running server. The test is whether your agent can deploy, read logs and roll back without you clicking through a dashboard.&lt;/p&gt;

&lt;p&gt;Keep it to one platform for as long as you can. Splitting the frontend and API across two providers doubles the config your agent has to keep straight, and doubles the places a deploy can fail.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Auth and payments
&lt;/h2&gt;

&lt;p&gt;These are the two layers you should not let an agent build from scratch. Password storage, session handling, webhooks and tax are full of edge cases that look finished long before they are. Use a hosted provider and let the agent write the integration, not the primitives.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Auth: Clerk, Supabase Auth, Auth.js or your framework's built-in option. For an API product, plain API keys plus email verification may be all you need at launch.&lt;/li&gt;
&lt;li&gt;Payments: Stripe Checkout and the Customer Portal cover subscriptions, upgrades and cancellations without custom billing UI. If you'd rather not deal with sales tax and VAT yourself, a merchant of record like Paddle or Lemon Squeezy does it for you.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whichever you choose, ask the agent to write tests around the webhook handler. That is where a silent failure costs you real money.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Database
&lt;/h2&gt;

&lt;p&gt;Serverless Postgres (Neon, Supabase) or SQLite at the edge (Cloudflare D1, Turso) are the common picks. Postgres is the safer default: every agent knows it well, every ORM supports it, and you won't outgrow it. Pair it with a typed ORM like Drizzle or Prisma so schema changes go through migration files the agent generates and you review, instead of ad-hoc SQL against production.&lt;/p&gt;

&lt;p&gt;One habit worth keeping: give the agent a scratch database for experiments and keep production credentials out of its environment unless a task actually needs them.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Images and assets: PixelVault
&lt;/h2&gt;

&lt;p&gt;Agent-built products produce a surprising number of images: OG cards, screenshots for docs and PRs, AI-generated illustrations, user uploads. The agent creates the file in seconds and then has nowhere to put it. Committing binaries bloats the repo, and setting up a bucket plus CDN plus access rules is a project of its own.&lt;/p&gt;

&lt;p&gt;PixelVault is the image layer built for this: one API call (or an MCP tool, or a skill) turns a file into a CDN URL the agent can drop straight into Markdown, HTML or an &lt;code&gt;og:image&lt;/code&gt; tag. The first upload doesn't need an account or a key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# No account, no key: the first upload just works&lt;/span&gt;
curl -s -X POST https://api.pixelvault.dev/v1/images \
  -F &lt;span class="s2"&gt;"file=@og-card.png"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; jq -r &lt;span class="s1"&gt;'.data.url'&lt;/span&gt;

&lt;span class="c"&gt;# → https://img.pixelvault.dev/… ("temporary": true, expires in 30 days)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That keyless upload is temporary and expires after 30 days. A free email registration gives you an API key and makes your uploads permanent (free-plan images left unused for a long time may be cleaned up; the rule is on the pricing page). The same URL also does resizing and format conversion with query params like &lt;code&gt;?w=1200&amp;amp;h=630&amp;amp;fmt=auto&lt;/code&gt;, so one upload covers every size you need. For the longer version of why agents get stuck at this step and how to wire it in, see &lt;a href="https://pixelvault.dev/blog/image-hosting-for-ai-agents/" rel="noopener noreferrer"&gt;image hosting for AI agents&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Monitoring
&lt;/h2&gt;

&lt;p&gt;When you're the only person on call, monitoring is what lets you sleep. You need three things, and none of them has to be elaborate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Errors: Sentry or a similar error tracker, so exceptions arrive with a stack trace instead of a vague user email.&lt;/li&gt;
&lt;li&gt;Logs: your hosting platform's built-in logs are often enough at first; add a log service like Axiom or Better Stack when you need search and retention.&lt;/li&gt;
&lt;li&gt;Uptime: an external check on your homepage and one key API route, with alerts to your phone.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many of these services ship MCP servers, which means your agent can read the error, find the commit that caused it and propose the fix in one session. That loop is a real advantage of building this way.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to pick first
&lt;/h2&gt;

&lt;p&gt;Don't set up all six layers on day one. In order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The coding agent and a &lt;code&gt;CLAUDE.md&lt;/code&gt; / &lt;code&gt;AGENTS.md&lt;/code&gt;. Everything else gets built through it.&lt;/li&gt;
&lt;li&gt;Hosting with deploy-on-push. Ship a placeholder page on the first day, so every later change is a small deploy.&lt;/li&gt;
&lt;li&gt;Database, once you have something to store.&lt;/li&gt;
&lt;li&gt;Auth and payments, once someone other than you will use it. Charge earlier than feels comfortable.&lt;/li&gt;
&lt;li&gt;Image hosting, the first time the agent produces an image that needs a URL. With PixelVault that's a single call with no signup, so it can wait until you need it.&lt;/li&gt;
&lt;li&gt;Monitoring, before you tell anyone about the launch.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Price out the paid tiers before you commit, since you'll pay for several of these at once once you have users. &lt;a href="https://jobbit.uk/en/blog/developer-tools-indie-hackers-2026" rel="noopener noreferrer"&gt;The Jobbit roundup&lt;/a&gt; is a good place to compare. Then pick one tool per layer, write it into your project instructions, and let the agent get on with the building.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://pixelvault.dev/blog/indie-hacker-stack-building-with-agents/" rel="noopener noreferrer"&gt;PixelVault blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
