DeepSeekDSH
Independent community guideNot affiliated with DeepSeek.Official source snapshot

Configure Google Gemini in DeepSeek Harness

Create a Gemini API key in Google AI Studio, choose the built-in Google provider and select a current Gemini model.

On this page
Use the current model list first

The endpoint, protocol and environment variable below come from the provider's official documentation or the current upstream provider source. Model catalogs change, so use the ID shown by your installed DSH version.

Before you start

Make sure DSH is already running from npx @deepseek-ai/dsh web; the default Web UI address is http://127.0.0.1:3080. If DSH itself does not start, use the startup checks first.

Keep the API key private

Do not put a real key in a repository, screenshot, prompt or public error report.

STEP 1

Get a Google Gemini API key

Open Gemini API keys, sign in, create a key and copy it before leaving the page.

Environment variable

If you use YAML, the variable name must exactly match the apiKeyEnv value below; the variable name is not the key itself.

STEP 2

Add the provider to DSH

Open Settings → Models. If Google Gemini appears in the installed catalog, choose Add provider, paste the API key and save it.

Choose Google under Add provider. DSH's installed provider uses Google's native Generative AI protocol, so use the built-in card rather than trying to force the native route into the custom provider form.

A restart is not the first fix

The official provider guide says model and provider changes take effect on the next request. Save, then start a fresh session for the test.

STEP 3

Check the route values

RouteProvider IDapiKeyEnvBase URLAPI
Google / Gemini · built-ingoogleGEMINI_API_KEYhttps://generativelanguage.googleapis.com/v1betagoogle-generative-ai

Do not mix a key from one region or plan with another route or protocol. Use a built-in row only when that catalog is actually present in your DSH version.

STEP 4

Select a model

Choose Gemini from the current Google section of the picker. Google AI Studio's key rules and available models can change, so verify the key in AI Studio before debugging DSH.

Copy the Model ID, not the page title

If a model is missing from the picker, do not keep guessing names. For an OpenAI-compatible custom route, use Fetch available models; if discovery fails, add the exact ID returned by the provider manually.

If the built-in catalog is missing: create a custom provider

Use the built-in route for this provider

The custom-provider form currently offers OpenAI Completions, OpenAI Responses and Anthropic Messages. It does not replace the built-in Google-native route.

Test one safe request

Choose a disposable test workspace, start a fresh session, select the configured model and send:

Reply with “Google Gemini connected”. Do not edit files or run commands.

Once the reply is successful, move on to file-reading or tool tasks. This keeps credential and routing failures separate from workspace and permission issues.

Common errors

MISSING_CREDENTIAL

Return to Settings → Models and save the key. With YAML, make sure the variable named by apiKeyEnv existed before DSH started.

UNKNOWN_MODEL

Use a Model ID that actually exists under the current provider. Do not substitute a display name, alias or an old tutorial's model name.

401 / authentication failed

The custom-provider form currently offers OpenAI Completions, OpenAI Responses and Anthropic Messages. It does not replace the built-in Google-native route.

Fetch available models is empty or fails

Check the base URL, protocol and key currently shown in the form. If the provider does not expose a compatible model-list endpoint, confirm the model ID and add it manually.

The old model still appears to be used

A session that has already sent a request keeps its own recorded model. Start a new session when verifying the switch.

NEXTBrowse all provider tutorials
Back to the list →