First Request: Verify Installation Success
What You'll Learn
- Send your first Antigravity model request
- Understand how
--modeland--variantparameters work - Choose the right model and thinking configuration based on your needs
- Troubleshoot common model request errors
Your Current Challenge
You've just installed the plugin, completed OAuth authentication, and configured model definitions, but you're unsure about:
- Is the plugin actually working?
- Which model should I use to start testing?
- How do I use the
--variantparameter? - If the request fails, how do I know which step has a problem?
When to Use This Approach
Use the verification methods from this lesson in these scenarios:
- After initial installation — Confirm authentication, configuration, and models all work correctly
- After adding a new account — Verify the new account is available
- After changing model configuration — Confirm the new model configuration is correct
- Before encountering problems — Establish a baseline for easier comparison later
🎒 Preparation
Prerequisite Checks
Before proceeding, please confirm:
- ✅ Completed Quick Installation
- ✅ Ran
opencode auth loginto complete OAuth authentication - ✅ Model definitions have been added to
~/.config/opencode/opencode.json - ✅ OpenCode terminal or CLI is available
Core Concepts
Why Verify First
The plugin involves collaboration of multiple components:
- OAuth Authentication — Obtain access tokens
- Account Management — Select available accounts
- Request Transformation — Convert OpenCode format to Antigravity format
- Streaming Response — Process SSE responses and convert back to OpenCode format
Sending the first request can verify whether the entire pipeline is unobstructed. If successful, all components are working properly. If it fails, you can locate the problem based on error messages.
Model and Variant Relationship
In the Antigravity plugin, model and variant are two independent concepts:
| Concept | Role | Example |
|---|---|---|
| Model | Select the specific AI model | antigravity-claude-sonnet-4-5-thinking |
| Variant | Configure the model's thinking budget or mode | low (lightweight thinking), max (maximum thinking) |
What is Thinking Budget?
Thinking budget refers to the number of tokens a model can use for "thinking" before generating a response. Higher budgets mean the model has more time for reasoning, but also increase response time and cost.
- Claude Thinking models: Configure with
thinkingConfig.thinkingBudget(unit: token) - Gemini 3 models: Configure with
thinkingLevel(string level: minimal/low/medium/high)
Recommended Beginner Combinations
Recommended model and variant combinations for different needs:
| Need | Model | Variant | Characteristics |
|---|---|---|---|
| Quick Testing | antigravity-gemini-3-flash | minimal | Fastest response, ideal for verification |
| Daily Development | antigravity-claude-sonnet-4-5-thinking | low | Balanced speed and quality |
| Complex Reasoning | antigravity-claude-opus-4-5-thinking | max | Strongest reasoning capability |
| Visual Tasks | antigravity-gemini-3-pro | high | Multimodal support (images/PDFs) |
Follow Along
Step 1: Send the Simplest Test Request
First, use the simplest command to test whether the basic connection is working.
Why This request doesn't use thinking functionality and returns extremely fast, making it suitable for quickly verifying authentication and account status.
Run Command
opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5You Should See
Hello! I'm Claude Sonnet 4.5, an AI assistant...Success Indicator
If you see the AI's response, it means:
- ✅ OAuth authentication successful
- ✅ Account has access permission
- ✅ Request transformation working correctly
- ✅ Streaming response properly parsed
Step 2: Use Thinking Model and Variant
Now test the complete thinking workflow, including the variant parameter.
Why Thinking models require additional request transformation logic, which is one of the plugin's core features.
Run Command
opencode run "Explain what closures are, use a simple analogy" --model=google/antigravity-claude-sonnet-4-5-thinking --variant=maxYou Should See
- Streaming thinking output: You'll see the model first output the thinking process (with
<thinking>tags) - Thinking process: The model will analyze in detail how to organize the answer
- Final answer: After thinking completes, the final content is output
See a Complete Response Example
<thinking>
The user is asking what closures are, needs to be explained with a simple analogy.
Closure concepts:
1. Functions can access variables in their outer scope
2. Even after the outer function has finished executing
3. This ability is like a "backpack"
Analogy approach:
- Can use "backpack" as analogy
- Function returns carrying some variables
- Like packing things from home in a bag when going out
</thinking>
A closure is like a function's "backpack".
When a function is created, it "packs up" the outer variables it can access, like putting needed items from home into a backpack before leaving. Even if the function leaves the place where it was created (the outer function finishes executing), it can still access those variables through this "backpack".
For example:
```javascript
function createCounter() {
let count = 0; // This variable gets packed into the "backpack"
return function() {
count++; // Can still access variables in the backpack
return count;
};
}Checkpoint ✅
- [ ] See
<thinking>block (ifkeep_thinking: trueis configured) - [ ] Response content is reasonable and logical
- [ ] Response time is within acceptable range (typically 2-10 seconds)
Step 3: Test Gemini 3 Models
Test different thinking levels of Gemini 3 Pro.
Why Gemini 3 uses string-level thinkingLevel, verifying support for different model families.
Run Commands
# Test Gemini 3 Flash (fast response)
opencode run "Write a bubble sort" --model=google/antigravity-gemini-3-flash --variant=low
# Test Gemini 3 Pro (deep thinking)
opencode run "Analyze the time complexity of bubble sort" --model=google/antigravity-gemini-3-pro --variant=highYou Should See
- Flash model responds faster (suitable for simple tasks)
- Pro model thinks more deeply (suitable for complex analysis)
- Both models work normally
Step 4: Test Multimodal Capabilities (Optional)
If your model configuration supports image input, you can test multimodal functionality.
Why Antigravity supports image/PDF input, a feature needed in many scenarios.
Prepare a test image: Any image file (e.g., test.png)
Run Command
opencode run "Describe the content of this image" --model=google/antigravity-gemini-3-pro --image=test.pngYou Should See
- Model accurately describes the image content
- Response includes visual analysis results
Checklist ✅
After completing the above tests, confirm the following checklist:
| Check Item | Expected Result | Status |
|---|---|---|
| Basic Connection | Simple request from Step 1 succeeds | ☐ |
| Thinking Model | See thinking process in Step 2 | ☐ |
| Gemini 3 Model | Both models from Step 3 work normally | ☐ |
| Variant Parameter | Different variants produce different results | ☐ |
| Streaming Output | Response displays in real-time without interruption | ☐ |
All Passed?
If all check items pass, congratulations! The plugin is fully configured and ready for formal use.
Next steps you can take:
Common Pitfalls
Error 1: Model not found
Error Message
Error: Model 'antigravity-claude-sonnet-4-5' not foundCause The model definition wasn't correctly added to provider.google.models in opencode.json.
Solution
Check the configuration file:
cat ~/.config/opencode/opencode.json | grep -A 10 "models"Confirm the model definition format is correct:
{
"provider": {
"google": {
"models": {
"antigravity-claude-sonnet-4-5": {
"name": "Claude Sonnet 4.5 (Antigravity)",
"limit": { "context": 200000, "output": 64000 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
}
}
}
}
}Watch Your Spelling
The model name must exactly match the key in the configuration file (case-sensitive):
- ❌ Incorrect:
--model=google/claude-sonnet-4-5 - ✅ Correct:
--model=google/antigravity-claude-sonnet-4-5
Error 2: 403 Permission Denied
Error Message
403 Permission denied on resource '//cloudaicompanion.googleapis.com/...'Cause
- OAuth authentication not completed
- Account doesn't have access permission
- Project ID configuration issue (for Gemini CLI models)
Solution
Check authentication status:
bashcat ~/.config/opencode/antigravity-accounts.jsonYou should see at least one account record.
If account is empty or authentication failed:
bashrm ~/.config/opencode/antigravity-accounts.json opencode auth loginIf Gemini CLI model reports error: Need to manually configure Project ID (see FAQ - 403 Permission Denied)
Error 3: Invalid variant 'max'
Error Message
Error: Invalid variant 'max' for model 'antigravity-gemini-3-pro'Cause Different models support different variant configuration formats.
Solution
Check the variant definition in the model configuration:
| Model Type | Variant Format | Example Value |
|---|---|---|
| Claude Thinking | thinkingConfig.thinkingBudget | { "thinkingConfig": { "thinkingBudget": 32768 } } |
| Gemini 3 | thinkingLevel | { "thinkingLevel": "high" } |
| Gemini 2.5 | thinkingConfig.thinkingBudget | { "thinkingConfig": { "thinkingBudget": 8192 } } |
Correct Configuration Example:
{
"antigravity-claude-sonnet-4-5-thinking": {
"name": "Claude Sonnet 4.5 Thinking",
"variants": {
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
}
},
"antigravity-gemini-3-pro": {
"name": "Gemini 3 Pro",
"variants": {
"low": { "thinkingLevel": "low" },
"high": { "thinkingLevel": "high" }
}
}
}Error 4: Request Timeout or No Response
Symptoms No output for a long time after command execution, or eventually times out.
Possible Causes
- Network connection issues
- Server responding slowly
- All accounts are in rate-limited state
Solution
Check network connection:
bashping cloudaicompanion.googleapis.comView debug logs:
bashOPENCODE_ANTIGRAVITY_DEBUG=1 opencode run "test" --model=google/antigravity-claude-sonnet-4-5Check account status:
bashcat ~/.config/opencode/antigravity-accounts.jsonIf you see all accounts have
rateLimittimestamps, it means they're all rate-limited and you need to wait for reset.
Error 5: SSE Streaming Output Interrupted
Symptoms Response stops midway, or you only see partial content.
Possible Causes
- Unstable network
- Account token expired during request
- Server error
Solution
Enable debug logs for detailed information:
bashOPENCODE_ANTIGRAVITY_DEBUG=2 opencode run "test"Check log file:
bashtail -f ~/.config/opencode/antigravity-logs/latest.logIf interruptions are frequent:
- Try switching to a more stable network environment
- Use non-Thinking models to reduce request time
- Check if accounts are approaching quota limits
Lesson Summary
Sending the first request is a key step to verify successful installation. Through this lesson, you've learned:
- Basic Requests: Use
opencode run --modelto send requests - Variant Usage: Configure thinking budget through
--variant - Model Selection: Choose Claude or Gemini models based on your needs
- Troubleshooting: Locate and solve problems based on error messages
Recommended Practices
In daily development:
- Start with simple tests: After each configuration change, send a simple request first to verify
- Gradually increase complexity: From no thinking → low thinking → max thinking
- Record baseline response: Remember the response time under normal conditions for easier comparison
- Use debug logs wisely: When encountering problems, enable
OPENCODE_ANTIGRAVITY_DEBUG=2
Coming Up Next
Next, we'll learn Available Models Overview.
You'll learn:
- Complete list and characteristics of all available models
- Guide to choosing between Claude and Gemini models
- Comparison of context limits and output limits
- Best use cases for Thinking models
Appendix: Source Code Reference
Click to expand source code locations
Last updated: 2026-01-23
| Function | File Path | Lines |
|---|---|---|
| Request transformation entry | src/plugin/request.ts | 1-100 |
| Account selection and token management | src/plugin/accounts.ts | 1-50 |
| Claude model transformation | src/plugin/transform/claude.ts | Full file |
| Gemini model transformation | src/plugin/transform/gemini.ts | Full file |
| Streaming response handling | src/plugin/core/streaming/index.ts | Full file |
| Debug logging system | src/plugin/debug.ts | Full file |
Key Functions:
prepareAntigravityRequest(): Converts OpenCode request to Antigravity format (request.ts)createStreamingTransformer(): Creates streaming response transformer (core/streaming/)resolveModelWithVariant(): Resolves model and variant configuration (transform/model-resolver.ts)getCurrentOrNextForFamily(): Selects account for request (accounts.ts)
Configuration Examples:
- Model configuration format:
README.md#models - Variant detailed explanation:
docs/MODEL-VARIANTS.md