Gemini
An llm · client with dialect: gemini sends requests to the Google Gemini API. Requests that arrived in the OpenAI or Anthropic API are translated to the Gemini format and back.
Configuration
gemini_llm_client:
type: llm
kind: client
options:
dialect: gemini
server: https://generativelanguage.googleapis.com
authorization:
api_key:
credentials: "{credentials}"
telemetry:
metrics:
- llm.*
exit: sys:http_clientServer URL
Zilla appends /models/{model}:generateContent, or /models/{model}:streamGenerateContent when the reply is streamed, to the server URL, with {model} taken from the request. When the URL has no path, or only /, the path defaults to /v1beta, so https://generativelanguage.googleapis.com sends requests to https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent. Set a path, such as https://generativelanguage.googleapis.com/v1, to use the stable API instead.
A request that arrived in the Gemini API is sent with the same operation the caller used. A request translated from another API always calls :streamGenerateContent with alt=sse, and the reply is translated as it arrives.
Credentials
The Gemini API takes the API key in the x-goog-api-key header, without a prefix, so set credentials: "{credentials}" instead of the default Bearer {credentials}. With an inline guard, the key is the one the caller sent, forwarded unchanged. See LLM Credentials.
Routing to Gemini
north_llm_proxy:
type: llm
kind: proxy
routes:
- when:
- model:
- gemini-*
exit: gemini_llm_clientNext Steps
- Client Setup: point the OpenAI, Anthropic or Gemini SDK at the gateway.
- llm · client: the full
llm · clientreference.

