Common errorsBlogSponsor

Supabase: “Invalid API key”

What it means

The Supabase URL or anon key is wrong, swapped, or from another project.

How to fix it

Copy URL and anon key fresh from Supabase > Project Settings > API into env vars.

Paste this into Supabase

Stop retrying previous fixes. I'm getting this error: "Invalid API key". Likely cause: The Supabase URL or anon key is wrong, swapped, or from another project. Before editing, show me the relevant files and confirm the root cause. Then: Copy URL and anon key fresh from Supabase > Project Settings > API into env vars. Change only what's necessary, don't delete working code, don't add new libraries unless required, and tell me exactly what you changed and how to verify it.

Your error's a bit different? Paste it and get a fix prompt written for your exact case.

Get my fix prompt — 3 free