GOOGLE_GEMINI_BASE_URL environment variable. DreamTo supports this protocol natively.
Prerequisites
- A recent version of Gemini CLI is installed (
gemini --version), for example vianpm i -g @google/gemini-cli.GOOGLE_GEMINI_BASE_URLrequires a recent version; if yours doesn’t recognize it, upgrade first. - You have created an API Key on the API Keys page of the DreamTo console.
- You have a Gemini model ID, such as
gemini-4-hydrogen. For the full list, see Gemini generateContent.
Key settings
Setup
1
Set the environment variables
We recommend putting them in You can also set them directly in your shell:
~/.gemini/.env, which Gemini CLI loads automatically (%USERPROFILE%\.gemini\.env on Windows):~/.gemini/.env
2
Choose API Key authentication
Start
gemini. If asked to choose an authentication method, pick Use Gemini API Key, not Google sign-in or Vertex AI. If you previously signed in with a Google account, type /auth in the CLI to choose again.3
Verify
/model to confirm the current model.FAQ
401 / API key not valid
401 / API key not valid
- Make sure you’re using API Key authentication, not Google sign-in (use
/authto choose again). - Check whether variables such as
GOOGLE_API_KEYorGOOGLE_GENAI_USE_VERTEXAI=trueare still set in your shell and interfering;unsetthem if needed.
404 / model not found
404 / model not found
- Set
GOOGLE_GEMINI_BASE_URLto justhttps://api.dreamto.ai. Adding/v1betaresults in/v1beta/v1beta/.... - The model ID must be a Gemini model ID from the DreamTo Model Marketplace. Gemini CLI’s built-in default model may not exist on DreamTo, so set
GEMINI_MODELexplicitly.
Warning that the Base URL is insecure
Warning that the Base URL is insecure
Gemini CLI requires custom addresses to use HTTPS (except localhost). Make sure the address starts with
https://.Streaming breaks
Streaming breaks
Gemini CLI uses
streamGenerateContent, which DreamTo supports. If the stream drops midway, first check whether a local proxy or corporate gateway is buffering the SSE response.
