Skip to main content

Overview

Kilo Code is an AI coding assistant that can be configured to use Antigravity Manager for multi-account support and automatic quota management.
Kilo Code requires specific protocol configuration to work correctly with Antigravity Manager. Always use the Gemini protocol, not OpenAI.

Prerequisites

  • Antigravity Manager installed and running
  • Kilo Code installed
  • Active accounts with Gemini models

Configuration

1

Start Antigravity proxy

  1. Open Antigravity Manager
  2. Go to API Proxy tab
  3. Enable the proxy server
  4. Note the port (default: 8045)
2

Configure Kilo Code

In Kilo Code settings:
  1. Base URL: http://127.0.0.1:8045
  2. Protocol: Select Gemini (not OpenAI)
  3. API Key: sk-antigravity (or your configured key)
3

Test connection

Send a test message to verify the integration works correctly.

Important: Protocol selection

Always use Gemini protocol with Kilo Code.Kilo Code has a known issue where OpenAI mode generates invalid request paths:
  • Correct: /v1/chat/completions
  • Kilo Code bug: /v1/chat/completions/responses
This causes 404 errors with Antigravity. The Gemini protocol works correctly.

Why Gemini protocol?

Model configuration

Configure these models in Kilo Code:

gemini-3-flash

Use for: Quick responses, code completion, simple refactoringQuota: High free tier limitsSpeed: Fastest response times

gemini-3-pro-high

Use for: Complex analysis, architecture discussions, debuggingQuota: Pro tier requiredQuality: Best reasoning capability

Model mapping

If Kilo Code’s model names don’t match Antigravity’s defaults:
1

Check Kilo Code logs

Find the exact model name Kilo Code is requesting:
# In Antigravity, enable debug logging
# Check logs for incoming model names
2

Create custom mapping

In Antigravity Model Routing:
  1. Add new mapping rule
  2. From: Kilo Code’s model name
  3. To: Your Gemini model (e.g., gemini-3-flash)
  4. Save configuration
3

Test mapping

Send a request from Kilo Code and verify it routes correctly.

Configuration examples

Basic setup

{
  "baseURL": "http://127.0.0.1:8045",
  "protocol": "gemini",
  "apiKey": "sk-antigravity",
  "models": [
    "gemini-3-flash",
    "gemini-3-pro-high"
  ]
}

With model mapping

If Kilo Code uses different model names:
// Antigravity model routing config
{
  "mappings": [
    {
      "from": "kilo-fast",
      "to": "gemini-3-flash"
    },
    {
      "from": "kilo-pro",
      "to": "gemini-3-pro-high"
    }
  ]
}

Remote server

For remote Antigravity deployments:
{
  "baseURL": "http://192.168.1.100:8045",
  "protocol": "gemini",
  "apiKey": "your-api-key"
}
Ensure Antigravity has Allow LAN Access enabled for remote connections.

Troubleshooting

Problem: All requests return 404Most likely cause: Using OpenAI protocol instead of GeminiSolution:
  1. Open Kilo Code settings
  2. Change protocol to Gemini
  3. Save and restart Kilo Code
  4. Test again
Problem: ECONNREFUSED 127.0.0.1:8045Solutions:
  1. Verify Antigravity proxy is running
  2. Check port in Antigravity API Proxy tab
  3. Test with: curl http://127.0.0.1:8045/health
  4. Check firewall settings
Problem: Model 'xyz' not foundSolutions:
  1. Check model name in Kilo Code matches Antigravity
  2. Create custom model mapping in Antigravity
  3. Enable debug logging to see requested model names
  4. Verify accounts support the requested model
Problem: Requests take a long timeSolutions:
  1. Check account quotas in Antigravity dashboard
  2. Verify using appropriate model (Flash for speed)
  3. Check network latency to Antigravity server
  4. Review rate limiting settings
Problem: 401 UnauthorizedSolutions:
  1. Check if authentication is enabled in Antigravity
  2. Use correct API key from API Proxy settings
  3. Verify API key in Kilo Code configuration
  4. Test with curl to isolate issue

Debugging guide

Enable debug logging

  1. In Antigravity, go to Settings
  2. Enable Debug Logging
  3. Save configuration

Check logs

tail -f ~/Library/Logs/com.lbjlaq.antigravity-tools/antigravity.log

Test manually

Verify Antigravity is working correctly:
# Test health endpoint
curl http://127.0.0.1:8045/health

# Test Gemini endpoint
curl -X POST http://127.0.0.1:8045/v1/models/gemini-3-flash:generateContent \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-antigravity" \
  -d '{
    "contents": [{
      "parts": [{"text": "Hello"}],
      "role": "user"
    }]
  }'

Performance optimization

Model selection

Code completion

Use gemini-3-flash
  • Fastest responses
  • Sufficient for completions
  • High quota limits

Complex tasks

Use gemini-3-pro-high
  • Better reasoning
  • For refactoring/architecture
  • Lower quota, use sparingly

Quota management

  1. Monitor usage: Check Antigravity dashboard regularly
  2. Enable quota protection: Prevent exhaustion
  3. Add accounts: More accounts = better distribution
  4. Smart routing: Let Antigravity balance load automatically

Best practices

1

Always use Gemini protocol

Avoid OpenAI protocol due to Kilo Code’s path bug
2

Configure model mappings early

Set up custom mappings before extensive use
3

Enable debug logging initially

Helps catch configuration issues early
4

Test with curl first

Verify Antigravity works before debugging Kilo Code
5

Monitor quotas

Regular checks prevent unexpected interruptions

Build docs developers (and LLMs) love