The base URL is the gateway root
The Gemini SDK adds the /v1beta path itself, so set the root URL without a version path.
Gemini CLI
Gemini CLI and the @google/genai SDK send Gemini generateContent requests to the base URL you set. Aiduct answers them at /v1beta with the same API key you use everywhere else.
export GOOGLE_GEMINI_BASE_URL=https://api.aiduct.ai export GEMINI_API_KEY=sk-aiduct-... gemini --model gemini-3.7-flash
ENV VAR
GOOGLE_GEMINI_BASE_URL
PROTOCOL
generateContent
ENDPOINT
/v1beta
The Gemini SDK adds the /v1beta path itself, so set the root URL without a version path.
Gemini models are served natively. Other models are translated to and from generateContent, with function calls and thinking kept.
FAQ
No. Use https://api.aiduct.ai; the Gemini SDK adds /v1beta itself.
As the x-goog-api-key header, which Aiduct accepts like a bearer token.
Yes. A model served natively is counted by its upstream; any other count is an estimate, marked by the x-aiduct-token-count: estimated header.