Can't Generate TypeScript Type with New API Keys

Hello, when I try to generate TypeScript types using the CLI (npx supabase gen types typescript --project-id "PROJECT_ID" --schema public > src/types/database.types.ts) or in the API Docs > Instruction > Generate and download types it throws 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-31T14:41:06.927252+00:00. Re-enable them in the Supabase dashboard, or use the new publishable and secret API keys.\"}"}
Try rerunning the command with --debug to troubleshoot the 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-31T14:41:06.927252+00:00. Re-enable them in the Supabase dashboard, or use the new publishable and secret API keys.\"}"}
Try rerunning the command with --debug to troubleshoot the error.
1 Reply
'M7ilan
'M7ilanOP4w ago
with --debug
Supabase CLI 2.33.7
2025/08/01 00:32:12 HTTP GET: https://api.supabase.com/v1/projects/PROJECT_ID/types/typescript?included_schemas=public
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-31T14:41:06.927252+00:00. Re-enable them in the Supabase dashboard, or use the new publishable and secret API keys.\"}"}
Supabase CLI 2.33.7
2025/08/01 00:32:12 HTTP GET: https://api.supabase.com/v1/projects/PROJECT_ID/types/typescript?included_schemas=public
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-31T14:41:06.927252+00:00. Re-enable them in the Supabase dashboard, or use the new publishable and secret API keys.\"}"}
https://github.com/supabase/cli/issues/3893

Did you find this page helpful?