Skip to content

⚙️ Google Gemini Provider Setup

Integrate Google AI's Gemini models with Flexpilot, a powerful AI code assistant in VS Code, similar to GitHub Copilot. Follow this straightforward guide to get started!

🔑 Getting API Key

  1. Visit the AI Studio and sign in with your Google Account.
  2. Generate Your API Key:
    • Click on "Get API key."
    • If you have existing keys, select "Create API key." For a new project, choose "Create API key in new project."
    • Your new API key will be displayed.
  3. Important Security Notes:
    • Save your API key immediately — it won't be shown again.
    • Keep your API key secure and never share it publicly.
    • You can create multiple API keys for different projects and delete or regenerate them as needed.

NOTE

Keep your API key secure! Never share it publicly.

🛠️ Configuration

  1. Access Flexpilot settings from VS Code:

    • Press Ctrl+Shift+P (Windows) or Cmd+Shift+P (Mac).
    • Select Flexpilot: Configure the Language Model Provider.
    • Choose Add New Configuration.
    • Select Google Generative AI (google-generative-ai-chat) as the provider.
  2. Enter a Nickname when prompted. Pressing Escape will cancel the configuration.

  3. Enter Your API Key when prompted.

  4. Enter the base URL when prompted. The default value is https://generativelanguage.googleapis.com/v1beta. Use a different URL value for API calls if required, such as for proxy servers, gateways, etc.

  5. Select Your Preferred Gemini Model from the list.

📌 Important Notes

  • 💸 API Billing: Usage is billed through Google Cloud. Check the pricing page for details.
  • 🔒 Key Security: Set up API key restrictions and usage quotas for enhanced security.

🚫 Troubleshooting

  • Gemini API Activation: Ensure the Gemini API is enabled in your project settings.
  • Billing Setup: Confirm that billing is active and correctly configured in your Google Cloud account.
  • Quota Limits: Check that you haven’t exceeded your quota limits for API calls.

For more details on API usage, refer to the Google AI documentation.