# Integrations / Google Gemini: Troubleshooting

Source: https://www.kerlig.com/help/integrations/google-gemini/troubleshooting

##### Troubleshoot Google Gemini error messages and find the solution

**Free tier not available**

Cause: Gemini API free tier is not available in your country. Please enable billing on your project in Google AI Studio.

Solution: To use the Gemini API, you will need to setup a paid plan using [Google AI Studio](https://aistudio.google.com/app/plan_information).

**Country not supported**

Cause: The Gemini API isn't available in your country or region.

Solution: See the [available regions](https://ai.google.dev/gemini-api/docs/available-regions).

**API key error**

Cause: The requesting API key is not correct.

Solution: Ensure the API key used is correct, or [generate a new one](https://aistudio.google.com/app/apikey).

**Permission denied**

Cause: Your API key doesn't have the required permissions.

Solution: Check that your API key is set and has the right access.

**Model unavailable**

Cause: The model isn't available to your API key, or Google has retired it.

Solution: Pick another Gemini model in Kerlig. See the [list of models](https://ai.google.dev/gemini-api/docs/models).

**Rate limit reached**

Cause: You've exceeded the rate limit.

Solution: Ensure you're within the model's [rate limits](https://ai.google.dev/models/gemini#model-variations). Check your account [rate limits](https://aistudio.google.com/app/plan_information).

**Quota exceeded**

Cause: You have run out of credits.

Solution: Ensure you're within the model's [rate limits](https://ai.google.dev/models/gemini#model-variations). Check your account [rate limits](https://aistudio.google.com/app/plan_information).

**Message too long**

Cause: The request is longer than the model's context window, the most text it can read at once.

Solution: Shorten the selected text, start a new chat, or switch to a model with a larger context window.

**Image too large**

Cause: An attached image is larger than Google accepts.

Solution: Attach a smaller image, or compress it first.

**Message flagged**

Cause: Google's safety system rejected the request.

Solution: Rephrase your request. If you think it was flagged by mistake, contact Google support.

**Blocked due to safety**

Cause: Your request was blocked due to safety concerns. The content you provided may contain language or topics that violate Google safety guidelines.

Solution: Please review and adjust your input to ensure it doesn't include potentially harmful, offensive, or inappropriate content. If you believe this is an error, you can try rephrasing your request.

**Server error**

Cause: An unexpected error occurred on Google's side.

Solution: Wait a bit and retry your request.

**Server overloaded**

Cause: The service may be temporarily overloaded or down.

Solution: Wait a bit and retry your request.

**Connection error**

Cause: Kerlig couldn't reach Google.

Solution: Check your internet connection, VPN or proxy, then try again.

**Error**

Cause: Something went wrong that Kerlig doesn't recognize.

Solution: Read Google's own message, shown under the error. It usually names the cause. If it doesn't help, click **Copy details** and send it to [support@kerlig.com](mailto:support@kerlig.com).

---

[See Google Gemini Error codes](https://ai.google.dev/gemini-api/docs/troubleshooting)
