Can't get AI Assistant to work
I placed my OpenAI API key in the
.env
file in the OPENAI_API_KEY
key, then docker compose down && docker compose up -d
but when I went to use AI Assistant, I get a toast notification saying "An error occurred.".
I don't even know where the logs are to check what's happening.
20 Replies
Check for logs in devtools. This issue was fixed a while ago https://github.com/supabase/supabase/pull/35804 https://github.com/supabase/supabase/pull/35812
Verify that the key is working
Thanks for responding.
The logs in my browser developer tools show:
----
I see you mentioned Github issues from May, while this installation was setup using the Self Hosting documentation, just yesterday and using the studio image supabase/studio:2025.06.30-sha-6f5982d.
The API works:
I did now try to use the newer studio version
2025.06.30-sha-6f5982d
and it still doesn't work.
I've attached another SS from the newer version.
These logs are for different issue. Its trying to fetch new api keys which hasn't been implemented.
To get rid of this error specifically, you can use the previous studio img:
supabase/studio:2025.06.23-sha-17632f7
For the AI error, look into network tab when request is made
Response:
See SS, took almost 7s to respond

What is the status code of response?
200
Do you see ai response in preview tab ? 200 means successful
preview tab?

Try making a request yourself with the openai api. This is the prompt supabase uses on the backend https://github.com/supabase/supabase/blob/master/apps/studio/pages/api/ai/sql/generate-v3.ts#L74
Checking ...
Yet I've never even used the API

Or is this Supabase rate limit? Not OpenAI?
No this isn't coming from supabase.
Yea, stupid question on my part
You'll have to ask about this from chatgpt support/forums.
Yes
Ty
Fixed. I checked billing and saw $0.00 credits. Even though usage showed a $120 budget, nothing would be used since the Pay as you go credit balance was at zero.
Honestly, I expected Supabase’s UX to at least return OpenAI’s original
429 You exceeded your current quota error
and not the generic An error occurred.
.

@inder :solved:
Ya, actual error msg would've saved a lot of time. I'd recommend to open an issue on supabase github repo. This forum isn't monitored by the team.