Docs · Provider

Gemini in Claude Code, Codex, Gemini CLI and OpenCode

Google serves Gemini on the Gemini Developer API, the one an AI Studio key opens, and on Vertex AI in your own Google Cloud project. Add either to packinggoods once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use Gemini 3 models such as gemini-3.1-pro-preview through packinggoods’s gateway at 127.0.0.1:3425, each agent on a model of its own.

Add a Gemini API key

  1. Get a keyMake one on aistudio.google.com/apikey.
  2. Add the providerIn packinggoods’s Providers tab, press + Add provider, pick Google Gemini, paste the key and save. packinggoods asks Google which models it serves.
  3. Pick it for an agentIn the Agents tab, click the model on the agent’s row and choose a Gemini model such as gemini-3.1-pro-preview.
Terminal
packinggoods provider add google AIza…
packinggoods provider test google

Model ids in packinggoods are provider/model, so the Gemini API’s read google/gemini-3.1-pro-preview: the provider, then Google’s own id. The key is kept in packinggoods’s settings; packinggoods doesn’t take it from your shell.

Endpoints

APIBase URLUsed for
Chat Completions (OpenAI-compatible)https://generativelanguage.googleapis.com/v1beta/openaithe model list, and requests from Claude Code, Codex, OpenCode and other agents
Gemini APIhttps://generativelanguage.googleapis.com/v1betaGemini CLI’s requests, Google Search, image models

The preset fills in the Gemini API URL once. If you clear it, it stays empty. Every request that doesn’t come from a Gemini client goes to Chat Completions.

Model list

In each agent

Pick the model on an agent’s row in the Agents tab, or from a terminal. Each guide says what packinggoods writes in that agent’s config and how to switch back.

Terminal
packinggoods claude google/gemini-3.1-pro-preview
packinggoods codex google/gemini-3.1-pro-preview
packinggoods gemini model google/gemini-3.8-flash
packinggoods opencode google/gemini-3.1-pro-preview

Thinking

Thought signatures and tools

Cache, cost and search

Several keys and rate limits

One Google Gemini provider can hold several keys: press Add another key under it, or paste several at once. Requests go to the first key that’s on, and when it runs out or is rate limited the next one takes over. The provider’s routing can also rotate, weight or drain them instead.

Terminal
packinggoods provider rpm google 10
packinggoods provider spend-cap google <key> 20 month
packinggoods provider fallback google google-vertex/gemini-3.1-pro-preview

Vertex AI

The Google Vertex AI preset asks Gemini in your Google Cloud project, with no API key. Give it the project’s id; the project in each request is the one billed.

Terminal
gcloud auth application-default login
packinggoods provider add google-vertex project=my-project
packinggoods claude google-vertex/gemini-3.1-pro-preview

Google sign-ins

Two Google sign-ins give Gemini models without a key. They are subscriptions, set up as on Subscriptions in any agent.

Troubleshooting

More on Vertex AI: Google Vertex AI in Claude Code, Codex and other agents.

FAQ

How do I use Gemini in Claude Code?

Add a Gemini API key in packinggoods (Providers, Add provider, Google Gemini), then pick a model such as gemini-3.1-pro-preview on Claude Code’s row, or run packinggoods claude google/gemini-3.1-pro-preview. packinggoods writes Claude Code’s settings.json and translates each Messages request to Gemini’s Chat Completions, tool calls and streaming included.

Can Codex use Gemini models?

Yes. Codex speaks only the Responses API. packinggoods translates each Codex request to Gemini’s Chat Completions and the reply back to Responses. Run packinggoods codex google/gemini-3.1-pro-preview, or pick the model on Codex’s row.

Does Gemini 3 Pro keep working across tool calls in Claude Code?

Yes. Gemini 3 signs its function calls and refuses the next request without the signature. packinggoods carries each signature in the call id the agent gets and puts it back on the way to Gemini, so tool loops keep going, and a call from another model is sent as unsigned.

Can Gemini CLI and OpenCode use my Gemini key through packinggoods?

Yes. Gemini CLI’s requests go to the Gemini API as it sends them, Google Search included. OpenCode speaks Chat Completions, so its requests go to Gemini’s OpenAI-compatible API as they are.

Why does Gemini answer 429 with “Please retry in 33s”?

That is a per-minute limit, not a spent quota. packinggoods reads it as a rate limit and rests the key briefly. Run packinggoods provider rpm google 10, with your own limit, and packinggoods holds requests to that rate.

Can I use Gemini through Vertex AI instead of an API key?

Yes. Add the Google Vertex AI preset with your project’s id, for example packinggoods provider add google-vertex project=my-project. packinggoods signs with gcloud’s Application Default Credentials or a credentials file, and your project is billed.

Can I use my Gemini Code Assist or Antigravity sign-in instead?

Yes. Both are subscriptions: packinggoods accounts add gemini or packinggoods accounts add antigravity, then pick a gemini/… or antigravity/… model. Code Assist needs a Standard or Enterprise account with a Google Cloud project of its own.

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · OpenAI · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. To run Google’s Antigravity app on other models, see Antigravity on any model. Ask on Discord if you get stuck.