The issue stems from the underlying coding agent Pi not properly supporting Gemini API endpoint with OpenAI compatibility. You'll see 400 errors with no details.
- Create new AI preset (Settings > AI > Create Preset)
- Click 'Custom'
- Add
https://generativelanguage.googleapis.com/v1beta/openaifor the 'Custom URL' - Add your API key and choose your model