Skip to content

Unable to configure an API obtained from google ai studio — cc-switch

Quick fix

For Gemini, the thread recommends enabling the ccs proxy and testing in the CLI because model checks were unavailable. Claude Code has no verified fix.

Error output
从google ai studio申请的API怎么配置也无法成功。
English translation

Unable to configure an API obtained from google ai studio successfully.

The reporter could retrieve model data through the model list endpoint, but connection tests still failed after adding a provider in ccs. A respondent reported success with a custom provider and the ccs proxy enabled. They explained that the proxy settings in the screenshot controlled the request proxy used by ccs after enabling its proxy. The reporter still encountered errors after following these instructions. The respondent then explained that model checks were unavailable at the time and that actual CLI usage should determine whether the configuration worked. This evidence does not establish the root cause of the initial connection failure. The specific settings in the screenshots were not provided as text.

The respondent explicitly stated that their configuration was for Gemini and advised against mixing the usage paths for Claude Code, Codex, and Gemini. Another user tried a Gemini model in Claude Code and received a model-unavailable message referring to claude-haiku-4-5-20251001. The respondent said that this usage was not supported at the time. Later questions about configuring the Gemini API for Claude Code received no verifiable direct configuration solution. Routing through OpenRouter was only another user's suggestion, with no reported success. The issue being closed does not mean all these problems were fixed.

  1. First identify whether the target is Gemini CLI, Claude Code, or Codex. The reported successful test in the thread applies only to Gemini and does not establish compatibility with the other tools.

  2. For Gemini, refer to the custom provider configuration screenshot in the thread replies and enable the ccs proxy. The respondent reported a successful test, but another user still encountered errors. The corpus does not include the screenshot's specific fields, so a complete reproducible configuration cannot be provided.

  3. Test an actual call in Gemini CLI. The respondent said model checks were unavailable at the time, so do not rely solely on those results to determine whether the configuration works.

  4. For Claude Code, the thread provides no verified solution. Continue following the source thread. Configuring a Gemini API Key in OpenRouter for routing was a user suggestion whose effectiveness was not confirmed in the thread.

ToolGemini CLI / Claude Code
VersionUnknown
PlatformsUnknown

This page is distilled from 1 real issues

I still get errors after following the settings. Did the respondent actually test them?
The respondent said they had tested them and explained that model checks were unavailable at the time, so actual CLI usage should determine whether they worked. They later clarified that the configuration was for Gemini.
Why does Claude Code report claude-haiku-4-5-20251001 as unavailable when I configure a Gemini model?
The respondent explained that the supplied configuration was for Gemini and could not be used with Claude Code at the time. The thread did not establish the specific root cause of that model message.
Can I configure the Gemini API for Claude Code now, and how?
The thread provides no verified solution. A later user only suggested configuring a Gemini API Key in OpenRouter for routing, with no record of successful verification.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.