Getting "Requests Error" or "Service Unavailable" when using Gemini with Roocode in VSCode.
The model name "Gemini-3-Pro-Preview" does not exist. This is not a valid Google Gemini model name.
- Open VSCode Settings:
Ctrl+,(Windows/Linux) orCmd+,(Mac) - Type "Roocode" in the search box
- Look for the model/API configuration section
Change the model name from:
❌ Gemini-3-Pro-Preview
To one of these valid model names:
✅ gemini-2.0-flash (recommended - newest & fast)
✅ gemini-1.5-pro (more capable for complex tasks)
✅ gemini-1.5-flash (fast & efficient)
Make sure your Google AI API key is correctly set:
- Get your API key: https://aistudio.google.com/app/apikey
- In Roocode settings: Look for "API Key" field
- Format: Should be a long string like
AIzaSy...
- Save settings
- Reload VSCode window:
Ctrl+Shift+P→ "Reload Window" - Try using Roocode again
Run this command to test your API key:
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash?key=YOUR_API_KEY"If you get an error, your API key might be invalid or expired.
Make sure you can reach Google's API:
ping generativelanguage.googleapis.com- Update Roocode to the latest version
- Check Roocode's GitHub issues: https://github.com/roocode/roocode (or their official repo)
| Model Name | Best For | Speed |
|---|---|---|
gemini-2.0-flash |
Most use cases, newest | ⚡⚡⚡ Very Fast |
gemini-1.5-flash |
General tasks | ⚡⚡⚡ Very Fast |
gemini-1.5-pro |
Complex reasoning, analysis | ⚡⚡ Fast |
gemini-1.5-flash-latest |
Auto-updates to latest flash | ⚡⚡⚡ Very Fast |
gemini-1.5-pro-latest |
Auto-updates to latest pro | ⚡⚡ Fast |
Gemini-3-Pro-Preview← This doesn't exist!gemini-3.0gemini-pro(old naming, usegemini-1.5-proinstead)gpt-4(that's OpenAI, not Google)
- Gemini API Documentation: https://ai.google.dev/gemini-api/docs
- Community Forum: https://discuss.ai.google.dev/c/gemini-api/4
- Get API Key: https://aistudio.google.com/app/apikey
- Report Roocode Issues: Contact Roocode support directly
If you're developing a tool like Roocode that integrates with Gemini:
- Validate model names before making API calls
- Provide a dropdown with valid model names (not free text)
- Handle errors gracefully with clear messages
- Use the new SDK: https://github.com/googleapis/python-genai
Example valid model check:
VALID_MODELS = [
"gemini-2.0-flash",
"gemini-1.5-flash",
"gemini-1.5-pro",
"gemini-1.5-flash-latest",
"gemini-1.5-pro-latest"
]
if user_selected_model not in VALID_MODELS:
# Fetch from API to get current list
models = fetch_available_models()
# Show error with valid optionsLast Updated: December 2024
Issue Reference: #759 in google-gemini/deprecated-generative-ai-python