Error generating types after upgrading to new api keys
Hey gang! Running into an issue generating types. I upgraded to the new api keys today because I was excited to use getClaims() instead of getuser() and hitting the server every time. It went well, and my app is functioning properly now. Only issue is, I can't generate types anymore. I tried it through the dashboard via Api Docs, as well as through the CLI.
I'm receiving the following error:
failed to retrieve generated types: {"message":"{"message":"Legacy API keys are disabled","hint":"Your legacy API keys (anon, service_role) were disabled on 2025-07-16T21:39:21.342182+00:00. Re-enable them in the Supabase dashboard, or use the new publishable and secret API keys."}"}
I've already migrated to the new keys in the dashboard. Where, exactly, do I make this fix so that my types again?
5 Replies
In the same section that you disabled them. You should see now a button to re enable them.
This eventually worked after restarting my project manually, but I'm unsure about what to do in the future. I assume we'll still have to disable the old keys at some point.
Is there something specific we should be doing instead, or should I just chalk this down to an edge case they haven't gotten to at launch but will sort out eventually?
Remember new API keys are in beta. Many of the final pieces will be in place in the coming months.
With that being said. What version of Supabase cli are you using?
This seems to be a general issue. I found this issue that mentions it as well.
I'm using Supabase CLI 2.33.7 & Nextjs.
Has anyone found a solution?
GitHub
Supabase API Key Migration Issues with Type Generation and FlutterF...
Bug report Supabase API Key Migration Issues with Type Generation and FlutterFlow Bug Summary: After migrating from the deprecated Supabase "anon key" to the new "publishable key&qu...
the solution is to re enable your JWT keys. There is a Github discussion that covers more about these new feature, including a chart that show that the new keys are for platform usage only, and not the cli. Take a look here: https://github.com/orgs/supabase/discussions/29260
GitHub
Upcoming changes to Supabase API Keys · supabase · Discussion #29260
Timestamp Latest Update 17th June 2025 Early access to new API keys launched, available on all projects. Please give them a try and raise any issues in this discussion for the team to fix or addres...