Chat route with Geminiv3.6+

Configure a chat route using the Gemini 1.5 Flash model.

Prerequisites

  • Google Cloud account with access to Gemini

Environment variables

  • GEMINI_API_KEY: The API key to use to connect to Gemini.

Set up the plugin

Add this section to your declarative configuration file:

_format_version: "3.0"
plugins:
  - name: ai-proxy
    config:
      route_type: llm/v1/chat
      auth:
        param_name: key
        param_value: ${{ env "DECK_GEMINI_API_KEY" }}
        param_location: query
      model:
        provider: gemini
        name: gemini-1.5-flash
Copied to clipboard!

Did this doc help?

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!