Google Antigravity CLI Integration
Configure Google Antigravity CLI with your QCode.cc API key: edit ~/.config/antigravity/config.toml, set an OpenAI-compatible base_url and a model
Google Antigravity CLI Integration¶
⚠️ Migrating from Gemini CLI to Antigravity CLI: Google Antigravity became available on 2026-05-19, and Gemini CLI reached end-of-life (EOL) for Pro / free users on 2026-06-18; enterprise paid keys are unaffected and can keep using Gemini CLI after EOL. If you previously set things up via the Gemini CLI integration, we recommend switching to the Antigravity CLI approach on this page.
Google Antigravity is Google's next-generation AI coding command-line tool, meant to replace the now-retired Gemini CLI. It supports custom / OpenAI-compatible model endpoints, so you can configure QCode.cc as the upstream and use a single QCode key to call models from Claude, GPT, Gemini, and more.
🚧 The tool is still evolving fast: Antigravity is new, and its configuration options and behavior are still changing. This page reflects the currently known working approach; for the exact config key names, default paths, and field meanings, follow the official docs: https://antigravity.google/docs. Anything uncertain below is flagged explicitly.
Why put QCode upstream of Antigravity¶
- One key, many models: a single QCode
cr_key covers Claude, GPT, Gemini, image models, and more - OpenAI-compatible: Antigravity supports custom / OpenAI-compatible models, so just point it at QCode's OpenAI Chat endpoint
- Shared quota: shares the same plan quota with tools like Claude Code and OpenAI Codex, so you can switch freely
- Region-friendly domains: besides
api.qcode.ccthere areasia/us/euentrypoints — users in China should preferasia.qcode.cc
Prerequisites¶
- Google Antigravity installed (follow the official docs for installation)
- A QCode.cc API key (starts with
cr_), from the dashboard - Familiarity with QCode's endpoints and API formats
Available models¶
Antigravity connects through an OpenAI-compatible endpoint. Below are some commonly used QCode models (put these in the model field of your config):
| Model | Notes | Context |
|---|---|---|
claude-opus-4-8 |
Flagship, most capable | 1M |
claude-sonnet-4-6 |
Balanced, everyday default | 1M |
claude-haiku-4-5 |
Lightweight, fast, cheap | 200K |
gpt-5.5 |
OpenAI flagship | 1M |
gpt-5.4 |
OpenAI balanced | 1M |
gemini-3.5-flash |
Gemini fast model (billed ×2) | — |
See the full model and pricing list under model selection. The Gemini family is billed at ×2.
Setup¶
Antigravity's config file lives at ~/.config/antigravity/config.toml (confirm the exact path in the official docs). The key idea is to point base_url at QCode's OpenAI Chat endpoint and provide a QCode key plus a model.
Step 1: Prepare the base_url and key¶
QCode's OpenAI Chat endpoint is:
https://api.qcode.cc/openai/v1
Users in China should prefer
https://asia.qcode.cc/openai/v1(same idea forus/eu). Do not put a trailing slash/on thebase_url. Antigravity appends/chat/completionsto it automatically.
Step 2: Edit config.toml¶
Open (or create) ~/.config/antigravity/config.toml and write something like this:
# ~/.config/antigravity/config.toml
# Note: the key names below are the currently known usage — confirm exact fields at https://antigravity.google/docs
# QCode upstream (OpenAI-compatible endpoint)
base_url = "https://api.qcode.cc/openai/v1" # in China you can use https://asia.qcode.cc/openai/v1
# The model to use (see table above)
model = "claude-opus-4-8"
# API key: prefer injecting it via an environment variable rather than hardcoding it
# e.g. read from the OPENAI_API_KEY environment variable
api_key_env = "OPENAI_API_KEY"
Put the key in an environment variable (persist it in ~/.zshrc / ~/.bashrc):
export OPENAI_API_KEY="cr_xxxxxxxxxxxxxxxx"
🚧 Field names follow the official docs: the
base_url/model/api_key_envabove are common conventions for OpenAI-compatible tools, but Antigravity's exact key names (e.g. whether it'sapi_key,apiKey, a nestedprovidersection, etc.) may differ — follow the official docs. If a key isn't recognized, adjust to match the official examples rather than copying this page verbatim.
Step 3: Verify connectivity¶
The most direct check is to bypass the tool and hit the QCode endpoint directly. This curl sends a minimal request with your key:
curl -s https://api.qcode.cc/openai/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-8",
"messages": [{"role": "user", "content": "ping"}]
}'
- A normal chat-completion JSON response → endpoint and key are both fine
- A 401 → the path is correct, the key is just missing or wrong (this is the expected self-check signal; set
Authorizationcorrectly)
Once the endpoint works, go back into Antigravity and run a simple chat to confirm it's actually reaching the QCode upstream.
Vision input (reading images) vs. image generation¶
Tools like Antigravity / Claude Code can read images — feed a UI screenshot, an error screenshot, or an architecture diagram to a vision-capable model so it can write code or debug from it. This is different from generating images:
- Reading images (vision input): reference an image file path in your prompt, or paste / drag-drop an image. Vision-capable models include Claude Opus 4.8 / Sonnet 4.6 and GPT-5.x. Typical uses: rebuild a UI from a mockup, locate a bug from an error screenshot, read architecture diagrams / charts.
- Generating images: this requires the dedicated image model
gpt-image-2via QCode's image endpoint — see gpt-image-2 image generation.
Don't conflate the two: use vision input to make a model "understand an image"; use
gpt-image-2to make a model "draw an image".
Troubleshooting¶
| Symptom | Likely cause | Fix |
|---|---|---|
| Self-check curl returns 401 | Key not injected or wrong | Check OPENAI_API_KEY, confirm it starts with cr_ |
| 404 / wrong path | Bad base_url or extra slash |
No trailing /, confirm it's /openai/v1 |
| Slow / timeouts in China | Using the api main domain |
Switch to https://asia.qcode.cc/openai/v1 |
| Model name error | Model name typo or wrong case | Cross-check the model selection table |
| A config key has no effect | Antigravity field name differs from this page | Adjust per the official docs |
Next steps¶
- Endpoints and API formats — full table of the four domains and per-protocol paths
- Gemini CLI integration — the old tool before migration (enterprise keys still work)
- Subagents — orchestrate multiple background agents
- Automation and CI/CD — headless mode and scripting
Don't have a QCode key yet? A single
cr_key covers Claude, GPT, Gemini, and image models. Check out the pricing plans to get started.