404 error when I sumbit apikey of Gemini #8621

Closed
opened 2026-02-21 18:26:40 -05:00 by yindo · 33 comments
Owner

Originally created by @Tofuzhu on GitHub (Feb 25, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.3

Cloud or Self Hosted

Cloud

Steps to reproduce

On the website https://cloud.dify.ai/, when submitting the API key for the Gemini model, the system returned the following error: '404 models/gemini-pro is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.' How can this be resolved?

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @Tofuzhu on GitHub (Feb 25, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.15.3 ### Cloud or Self Hosted Cloud ### Steps to reproduce On the website https://cloud.dify.ai/, when submitting the API key for the Gemini model, the system returned the following error: '404 models/gemini-pro is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.' How can this be resolved? ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bugcloud labels 2026-02-21 18:26:40 -05:00
yindo closed this issue 2026-02-21 18:26:40 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 25, 2025):

@Tofuzhu Hello there! I'm here to assist you with bug fixes, questions, and becoming a contributor. Let's squash those bugs together! 😉

The 404 error you're encountering when submitting the API key for the Gemini model suggests that the model "gemini-pro" is either not found or not supported for the "generateContent" method in the API version v1beta. Here are a few steps you can take to resolve this issue:

  1. Verify Model Availability: Ensure that the Gemini model is available and supported for the API version v1beta. You can check the list of supported models and their methods in the api/core/model_runtime/README.md file of the Dify repository [1].

  2. Check API Version: Confirm that you are using the correct API version. The error message indicates a potential mismatch between the model and the API version.

  3. List Available Models: Use the "ListModels" API call to retrieve the current list of available models and their supported methods. This will help you verify if the Gemini model is listed and supported for your intended use.

  4. Configuration Check: Ensure that the configuration for the Gemini model is correctly set up. The configuration details, such as model type and features, are defined in a YAML file [2].

If the issue persists after these checks, there might be a need to update the model configuration or consult the documentation for any recent changes in model support.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Feb 25, 2025): <!-- Greeting --> @Tofuzhu Hello there! I'm here to assist you with bug fixes, questions, and becoming a contributor. Let's squash those bugs together! 😉 <!-- Answer --> The 404 error you're encountering when submitting the API key for the Gemini model suggests that the model "gemini-pro" is either not found or not supported for the "generateContent" method in the API version v1beta. Here are a few steps you can take to resolve this issue: 1. **Verify Model Availability**: Ensure that the Gemini model is available and supported for the API version v1beta. You can check the list of supported models and their methods in the `api/core/model_runtime/README.md` file of the Dify repository <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/README.md)</sup>. 2. **Check API Version**: Confirm that you are using the correct API version. The error message indicates a potential mismatch between the model and the API version. 3. **List Available Models**: Use the "ListModels" API call to retrieve the current list of available models and their supported methods. This will help you verify if the Gemini model is listed and supported for your intended use. 4. **Configuration Check**: Ensure that the configuration for the Gemini model is correctly set up. The configuration details, such as model type and features, are defined in a YAML file <sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/vertex_ai/llm/gemini-1.5-pro-002.yaml)</sup>. If the issue persists after these checks, there might be a need to update the model configuration or consult the documentation for any recent changes in model support. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/323c56ae-9c29-4a58-ab06-a4f95ce0e6c5?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/323c56ae-9c29-4a58-ab06-a4f95ce0e6c5?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/323c56ae-9c29-4a58-ab06-a4f95ce0e6c5?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/323c56ae-9c29-4a58-ab06-a4f95ce0e6c5?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/323c56ae-9c29-4a58-ab06-a4f95ce0e6c5?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/323c56ae-9c29-4a58-ab06-a4f95ce0e6c5?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/323c56ae-9c29-4a58-ab06-a4f95ce0e6c5?feedback_type=other)</sup>
Author
Owner

@Tofuzhu commented on GitHub (Feb 25, 2025):

I've checked the availability of the api key and my same gemini key, works fine in the Cherry studio client, so it shouldn't be a key issue. There really isn't anything else I can troubleshoot with cloud dify.

@Tofuzhu commented on GitHub (Feb 25, 2025): I've checked the availability of the api key and my same gemini key, works fine in the Cherry studio client, so it shouldn't be a key issue. There really isn't anything else I can troubleshoot with cloud dify.
Author
Owner

@hjlarry commented on GitHub (Feb 25, 2025):

The issue arises because Dify uses the gemini-pro model to validate your API key, but this model has been deprecated. It will be resolved in the upcoming version.

@hjlarry commented on GitHub (Feb 25, 2025): The issue arises because Dify uses the `gemini-pro` model to validate your API key, but this model has been deprecated. It will be resolved in the upcoming version.
Author
Owner

@Kokoabassplayer commented on GitHub (Feb 26, 2025):

Image

same issue on local host. i just install today

Gemini is critical for my case because 1m context window.

@Kokoabassplayer commented on GitHub (Feb 26, 2025): <img width="932" alt="Image" src="https://github.com/user-attachments/assets/35a0be60-eef0-4e85-86fd-ba274a6c111f" /> same issue on local host. i just install today Gemini is critical for my case because 1m context window.
Author
Owner

@zylinzzz commented on GitHub (Feb 26, 2025):

Same issue here.

@zylinzzz commented on GitHub (Feb 26, 2025): Same issue here.
Author
Owner

@ZXChen299 commented on GitHub (Feb 26, 2025):

Same issue here

@ZXChen299 commented on GitHub (Feb 26, 2025): Same issue here
Author
Owner

@pr-maia commented on GitHub (Feb 26, 2025):

Same issue here.

@pr-maia commented on GitHub (Feb 26, 2025): Same issue here.
Author
Owner

@aeiou1468 commented on GitHub (Feb 26, 2025):

同樣的問題+1

@aeiou1468 commented on GitHub (Feb 26, 2025): 同樣的問題+1
Author
Owner

@Seafoodsz commented on GitHub (Feb 26, 2025):

Same issue here. 同样的问题在这里。

@Seafoodsz commented on GitHub (Feb 26, 2025): Same issue here. 同样的问题在这里。
Author
Owner

@emmanpbarrameda commented on GitHub (Feb 26, 2025):

same issue. im using https://github.com/gemini-api-php/client

@emmanpbarrameda commented on GitHub (Feb 26, 2025): same issue. im using https://github.com/gemini-api-php/client
Author
Owner

@LynfordU commented on GitHub (Feb 26, 2025):

same issue

@LynfordU commented on GitHub (Feb 26, 2025): same issue
Author
Owner

@kaushalaga commented on GitHub (Feb 26, 2025):

import google.generativeai as genai

genai.configure(api_key="YOUR_API_KEY") #replace with your api key.

for model in genai.list_models():
print(model)

try using a model from this list

@kaushalaga commented on GitHub (Feb 26, 2025): import google.generativeai as genai genai.configure(api_key="YOUR_API_KEY") #replace with your api key. for model in genai.list_models(): print(model) try using a model from this list
Author
Owner

@kirim13 commented on GitHub (Feb 26, 2025):

Today I started having this error as well. I originally had model = genai.GenerativeModel("gemini-pro") and was able to get mine to work by specifying the gemini model to "gemini-1.5-pro-latest".

@kirim13 commented on GitHub (Feb 26, 2025): Today I started having this error as well. I originally had model = genai.GenerativeModel("gemini-pro") and was able to get mine to work by specifying the gemini model to "gemini-1.5-pro-latest".
Author
Owner

@wanhong535 commented on GitHub (Feb 26, 2025):

Error message:404 models/gemini-pro is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.

I deployed it with docker, and this error occurred during binding. I tried to modify it, but it did not achieve the result I expected. I hope this problem can be solved in the next version! Thanks!

@wanhong535 commented on GitHub (Feb 26, 2025): Error message:404 models/gemini-pro is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods. I deployed it with docker, and this error occurred during binding. I tried to modify it, but it did not achieve the result I expected. I hope this problem can be solved in the next version! Thanks!
Author
Owner

@codeabelity commented on GitHub (Feb 26, 2025):

Same issue here

@codeabelity commented on GitHub (Feb 26, 2025): Same issue here
Author
Owner

@Catherina0 commented on GitHub (Feb 27, 2025):

same issue

@Catherina0 commented on GitHub (Feb 27, 2025): same issue
Author
Owner

@EraGuider commented on GitHub (Feb 27, 2025):

same issue

@EraGuider commented on GitHub (Feb 27, 2025): same issue
Author
Owner

@Ennazk commented on GitHub (Feb 27, 2025):

Same issue here

@Ennazk commented on GitHub (Feb 27, 2025): Same issue here
Author
Owner

@pr-maia commented on GitHub (Feb 27, 2025):

@crazywoola any chance the fix is already available in one of the images in the registry?

@pr-maia commented on GitHub (Feb 27, 2025): @crazywoola any chance the fix is already available in one of the images in the registry?
Author
Owner

@ghostxu97 commented on GitHub (Feb 27, 2025):

same issue here

@ghostxu97 commented on GitHub (Feb 27, 2025): same issue here
Author
Owner

@zylinzzz commented on GitHub (Feb 27, 2025):

Issues persist after updating to the latest version.

Gemini API integrates without errors, but calling Gemini 2.0 Pro results in an error.

Image

@zylinzzz commented on GitHub (Feb 27, 2025): Issues persist after updating to the latest version. Gemini API integrates without errors, but calling Gemini 2.0 Pro results in an error. ![Image](https://github.com/user-attachments/assets/782994ea-da7b-4b44-a3fe-ac9511ff3991)
Author
Owner

@happy-ryo commented on GitHub (Feb 27, 2025):

same issue. Im using 0.15.3.

@happy-ryo commented on GitHub (Feb 27, 2025): same issue. Im using 0.15.3.
Author
Owner

@hjlarry commented on GitHub (Feb 28, 2025):

Issues persist after updating to the latest version.

Gemini API integrates without errors, but calling Gemini 2.0 Pro results in an error.

Image

sorry for this, a PR has been submitted to address it: https://github.com/langgenius/dify-official-plugins/pull/324

@hjlarry commented on GitHub (Feb 28, 2025): > Issues persist after updating to the latest version. > > Gemini API integrates without errors, but calling Gemini 2.0 Pro results in an error. > > ![Image](https://github.com/user-attachments/assets/782994ea-da7b-4b44-a3fe-ac9511ff3991) sorry for this, a PR has been submitted to address it: https://github.com/langgenius/dify-official-plugins/pull/324
Author
Owner

@zylinzzz commented on GitHub (Feb 28, 2025):

Issues persist after updating to the latest version.
Gemini API integrates without errors, but calling Gemini 2.0 Pro results in an error.
Image

sorry for this, a PR has been submitted to address it: langgenius/dify-official-plugins#324

Problem solved. Many thx!

@zylinzzz commented on GitHub (Feb 28, 2025): > > Issues persist after updating to the latest version. > > Gemini API integrates without errors, but calling Gemini 2.0 Pro results in an error. > > ![Image](https://github.com/user-attachments/assets/782994ea-da7b-4b44-a3fe-ac9511ff3991) > > sorry for this, a PR has been submitted to address it: [langgenius/dify-official-plugins#324](https://github.com/langgenius/dify-official-plugins/pull/324) Problem solved. Many thx!
Author
Owner

@webjosh commented on GitHub (Feb 28, 2025):

Today I started having this error as well. I originally had model = genai.GenerativeModel("gemini-pro") and was able to get mine to work by specifying the gemini model to "gemini-1.5-pro-latest".

It is working in my case

@webjosh commented on GitHub (Feb 28, 2025): > Today I started having this error as well. I originally had model = genai.GenerativeModel("gemini-pro") and was able to get mine to work by specifying the gemini model to "gemini-1.5-pro-latest". It is working in my case
Author
Owner

@zylinzzz commented on GitHub (Feb 28, 2025):

Issues persist after updating to the latest version.
Gemini API integrates without errors, but calling Gemini 2.0 Pro results in an error.
Image

sorry for this, a PR has been submitted to address it: langgenius/dify-official-plugins#324

Problem solved. Many thx!

After several function calls, the issue again persists.

@zylinzzz commented on GitHub (Feb 28, 2025): > > > Issues persist after updating to the latest version. > > > Gemini API integrates without errors, but calling Gemini 2.0 Pro results in an error. > > > ![Image](https://github.com/user-attachments/assets/782994ea-da7b-4b44-a3fe-ac9511ff3991) > > > > > > sorry for this, a PR has been submitted to address it: [langgenius/dify-official-plugins#324](https://github.com/langgenius/dify-official-plugins/pull/324) > > Problem solved. Many thx! After several function calls, the issue again persists.
Author
Owner

@Tofuzhu commented on GitHub (Feb 28, 2025):

I have been trying this problem on Cloud Dify for the past two days, but it seems that I still get an error 404

@Tofuzhu commented on GitHub (Feb 28, 2025): I have been trying this problem on Cloud Dify for the past two days, but it seems that I still get an error 404
Author
Owner

@CedricNatix commented on GitHub (Mar 4, 2025):

bonjour , j ai eu le meme probleme et j ai pue le ressoudre

le probleme c est que le modele gemini-pro a ete modifie par gemini-2.0-flash

alor dans votre code il suffit de change le models utilise par gemini-2.0-flash

const model = genAI.getGenerativeModel({ model: "gemini-pro" }); ===> const model = genAI.getGenerativeModel({ model: "gemini-2.0-flash" });

@CedricNatix commented on GitHub (Mar 4, 2025): bonjour , j ai eu le meme probleme et j ai pue le ressoudre le probleme c est que le modele gemini-pro a ete modifie par gemini-2.0-flash alor dans votre code il suffit de change le models utilise par gemini-2.0-flash `const model = genAI.getGenerativeModel({ model: "gemini-pro" }); ===> const model = genAI.getGenerativeModel({ model: "gemini-2.0-flash" });`
Author
Owner

@aaag1980 commented on GitHub (Mar 6, 2025):

bonjour , j ai eu le meme probleme et j ai pue le ressoudre

le probleme c est que le modele gemini-pro a ete modifie par gemini-2.0-flash

alor dans votre code il suffit de change le models utilise par gemini-2.0-flash

const model = genAI.getGenerativeModel({ model: "gemini-pro" }); ===> const model = genAI.getGenerativeModel({ model: "gemini-2.0-flash" });

Où se trouve le fichier à modifier et quel est le nom du fichier ?

@aaag1980 commented on GitHub (Mar 6, 2025): > bonjour , j ai eu le meme probleme et j ai pue le ressoudre > > le probleme c est que le modele gemini-pro a ete modifie par gemini-2.0-flash > > alor dans votre code il suffit de change le models utilise par gemini-2.0-flash > > `const model = genAI.getGenerativeModel({ model: "gemini-pro" }); ===> const model = genAI.getGenerativeModel({ model: "gemini-2.0-flash" });` Où se trouve le fichier à modifier et quel est le nom du fichier ?
Author
Owner

@Hikmat344 commented on GitHub (Mar 13, 2025):

I have also faced the same issue first I was using the "gemini-pro" model but when I changed it to "gemini-1.5-flash" this resolved my issue.
I think this was due to the new update because this was working when I first implemented it in Oct 2024.

@Hikmat344 commented on GitHub (Mar 13, 2025): I have also faced the same issue first I was using the "gemini-pro" model but when I changed it to "gemini-1.5-flash" this resolved my issue. I think this was due to the new update because this was working when I first implemented it in Oct 2024.
Author
Owner

@arthur-leite commented on GitHub (Jun 22, 2025):

Hi, I'm using Dify Cloud and the problem persists:

404 models/gemini-pro is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.

I'm not currently using Gemini in any chat. Is there any forecast for a definitive fix? Why does Dify validate the list of models when registering the API Key? @hjlarry

@arthur-leite commented on GitHub (Jun 22, 2025): Hi, I'm using Dify Cloud and the problem persists: 404 models/gemini-pro is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods. I'm not currently using Gemini in any chat. Is there any forecast for a definitive fix? Why does Dify validate the list of models when registering the API Key? @hjlarry
Author
Owner

@fleed141 commented on GitHub (Jun 25, 2025):

Hi, to this day the problem persist, im using the docker installation and i can not add the gemini api key due to this error

@fleed141 commented on GitHub (Jun 25, 2025): Hi, to this day the problem persist, im using the docker installation and i can not add the gemini api key due to this error
Author
Owner

@Mozyanari commented on GitHub (Jul 3, 2025):

I had the same issue, but reinstalling the plugin fixed it.

Solution Steps

  1. Click on the plugin icon in the top right corner of the screen
    Image

  2. Remove the Gemini plugin
    Image

  3. Search for "gemini" from "Explore Marketplace" and reinstall the plugin
    Image

This allowed me to set up the API key successfully.

@Mozyanari commented on GitHub (Jul 3, 2025): I had the same issue, but reinstalling the plugin fixed it. ## Solution Steps 1. Click on the plugin icon in the top right corner of the screen ![Image](https://github.com/user-attachments/assets/00bfa153-b947-41b0-b258-ae5087560657) 3. Remove the Gemini plugin ![Image](https://github.com/user-attachments/assets/3e07fdfd-d5ec-46e5-8ead-bf5a77e23d9c) 5. Search for "gemini" from "Explore Marketplace" and reinstall the plugin ![Image](https://github.com/user-attachments/assets/1a13100e-e4b0-4264-ab8f-912683ed08ad) This allowed me to set up the API key successfully.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8621