A valid vercel.json from simple inputs
vercel.json controls how Vercel routes requests, sets headers, pins function regions, and runs scheduled jobs. The schema mixes arrays of objects with specific keys, and a single typo can be silently ignored. This builder assembles a clean, valid configuration so each feature is wired correctly.
How it works
The output is a JSON object whose keys map directly to Vercel features. rewrites and redirects are arrays of objects with source and destination; redirects also carry a permanent flag controlling 308 versus 307. headers is an array pairing a source glob with a list of header name and value objects. crons is an array of path and schedule pairs using standard cron syntax. functions region pinning is expressed through the regions array, and framework overrides auto-detection. Empty sections are omitted so the file stays minimal.
Tips and example
Add a rewrite from /api/(.*) to an upstream to proxy requests, and a redirect from /old to /new marked permanent for SEO. Pin functions with regions set to iad1 if your database is in US East. Schedule a daily job with path /api/cron and schedule 0 2 * * * to run at 02:00 UTC. Commit the resulting vercel.json and Vercel applies it on the next deployment.