Description
When trying to add the Gemini model by entering a valid API key, the system shows an error message:
“Incorrect API key provided” even though the key is valid and works externally.
Expected Behavior
- The Gemini API key should be verified successfully.
- The model should appear in the “Model List” section after clicking Save.
Current Behavior
- Upon entering the API key and saving, a toast error appears: “Incorrect API key provided.”
- The model is not added to the list.
- Other models (if applicable) work correctly.
Steps to Reproduce
- Navigate to the API Key management section.
- Select Gemini from the “Add Model” dropdown.
- Enter a valid Gemini API key.
- Click Save.
- Observe the error: “Incorrect API key provided.”
Possible Causes
- API validation endpoint may be incorrect or outdated.
- Missing or incorrect request headers (e.g.,
Authorization: Bearer <key>).
- Gemini model integration not aligned with latest API spec.
- Backend may be rejecting keys due to missing environment configuration.

Description
When trying to add the Gemini model by entering a valid API key, the system shows an error message:
“Incorrect API key provided” even though the key is valid and works externally.
Expected Behavior
Current Behavior
Steps to Reproduce
Possible Causes
Authorization: Bearer <key>).