Skip to content

Endpoint Cheat Sheet: External HTTP Routes Overview ​

What You'll Learn ​

  • Quickly locate the endpoint paths you need to call
  • Understand the distribution of endpoints across different protocols
  • Learn special rules for authentication modes and health checks

Endpoint Overview ​

The local reverse proxy service of Antigravity Tools provides the following categories of endpoints:

Protocol CategoryPurposeTypical Clients
OpenAI ProtocolGeneral AI application compatibilityOpenAI SDK / Compatible clients
Anthropic ProtocolClaude series callsClaude Code / Anthropic SDK
Gemini ProtocolGoogle official SDKGoogle Gemini SDK
MCP EndpointsTool call enhancementsMCP clients
Internal/UtilityHealth checks, interception/internal capabilitiesAutomation scripts / Monitoring probes

OpenAI Protocol Endpoints ​

These endpoints are compatible with OpenAI API format, suitable for most clients that support OpenAI SDK.

MethodPathRoute Entry (Rust handler)Remarks
GET/v1/modelshandlers::openai::handle_list_modelsOpenAI compatible: Model list
POST/v1/chat/completionshandlers::openai::handle_chat_completionsOpenAI compatible: Chat Completions
POST/v1/completionshandlers::openai::handle_completionsOpenAI compatible: Legacy Completions
POST/v1/responseshandlers::openai::handle_completionsOpenAI compatible: Codex CLI requests (same handler as /v1/completions)
POST/v1/images/generationshandlers::openai::handle_images_generationsOpenAI compatible: Images Generations
POST/v1/images/editshandlers::openai::handle_images_editsOpenAI compatible: Images Edits
POST/v1/audio/transcriptionshandlers::audio::handle_audio_transcriptionOpenAI compatible: Audio Transcriptions

Compatibility Note

The /v1/responses endpoint is designed specifically for Codex CLI and actually uses the same processing logic as /v1/completions.


Anthropic Protocol Endpoints ​

These endpoints follow Anthropic API's path and request format for use by Claude Code / Anthropic SDK.

MethodPathRoute Entry (Rust handler)Remarks
POST/v1/messageshandlers::claude::handle_messagesAnthropic compatible: Messages
POST/v1/messages/count_tokenshandlers::claude::handle_count_tokensAnthropic compatible: count_tokens
GET/v1/models/claudehandlers::claude::handle_list_modelsAnthropic compatible: Model list

Gemini Protocol Endpoints ​

These endpoints are compatible with Google Gemini API format and can be used directly with Google's official SDK.

MethodPathRoute Entry (Rust handler)Remarks
GET/v1beta/modelshandlers::gemini::handle_list_modelsGemini native: Model list
GET/v1beta/models/:modelhandlers::gemini::handle_get_modelGemini native: GetModel
POST/v1beta/models/:modelhandlers::gemini::handle_generateGemini native: generateContent / streamGenerateContent
POST/v1beta/models/:model/countTokenshandlers::gemini::handle_count_tokensGemini native: countTokens

Path Note

/v1beta/models/:model registers both GET and POST methods under the same path (see route definition).


MCP Endpoints ​

MCP (Model Context Protocol) endpoints expose "tool call" interfaces externally (handled by handlers::mcp::*). Whether they are enabled and their specific behavior depends on configuration; see MCP Endpoints for details.

MethodPathRoute Entry (Rust handler)Remarks
ANY/mcp/web_search_prime/mcphandlers::mcp::handle_web_search_primeMCP: Web Search Prime
ANY/mcp/web_reader/mcphandlers::mcp::handle_web_readerMCP: Web Reader
ANY/mcp/zai-mcp-server/mcphandlers::mcp::handle_zai_mcp_serverMCP: z.ai MCP Server
MCP Related Notes

For availability and boundary explanations of MCP, see z.ai Integration Capability Boundaries (Implemented vs Explicitly Not Implemented).


Internal and Utility Endpoints ​

These endpoints are used for internal system functions and external monitoring.

MethodPathRoute Entry (Rust handler)Remarks
POST/internal/warmuphandlers::warmup::handle_warmupInternal warmup endpoint
POST/v1/api/event_loggingsilent_ok_handlerTelemetry log interception: Returns 200 directly
POST/v1/api/event_logging/batchsilent_ok_handlerTelemetry log interception: Returns 200 directly
GET/healthzhealth_check_handlerHealth check: Returns {"status":"ok"}
POST/v1/models/detecthandlers::common::handle_detect_modelModel auto-detection

Silent Processing

Event log endpoints return 200 OK directly without actual processing, used to intercept client telemetry reporting.

Do These Endpoints Require an API Key?

Except that GET /healthz may be exempt, whether other routes require a key is determined by the "valid mode" of proxy.auth_mode (see "Authentication Mode" below and auth_middleware in source code).


Authentication Mode ​

Access permissions for all endpoints are controlled by proxy.auth_mode:

ModeDescription/healthz Requires Auth?Other Endpoints Require Auth?
offFully open❌ No❌ No
strictAll require authentication✅ Yes✅ Yes
all_except_healthOnly health check is open❌ No✅ Yes
autoAutomatic (default)❌ NoDepends on allow_lan_access

auto Mode Logic

auto is not an independent policy, but derived from configuration: when proxy.allow_lan_access=true it's equivalent to all_except_health, otherwise equivalent to off (see docs/proxy/auth.md).

Authentication Request Format:

bash
 # Authorization: Bearer
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "http://127.0.0.1:<PORT>/v1/messages"

 # x-api-key (OpenAI style)
curl -H "x-api-key: YOUR_API_KEY" \
  "http://127.0.0.1:<PORT>/v1/chat/completions"

 # x-goog-api-key (Gemini style)
curl -H "x-goog-api-key: YOUR_API_KEY" \
  "http://127.0.0.1:<PORT>/v1beta/models/gemini-2-pro"
powershell
 # Authorization: Bearer
curl.exe -H "Authorization: Bearer YOUR_API_KEY" `
  "http://127.0.0.1:<PORT>/v1/messages"

 # x-api-key (OpenAI style)
curl.exe -H "x-api-key: YOUR_API_KEY" `
  "http://127.0.0.1:<PORT>/v1/chat/completions"

 # x-goog-api-key (Gemini style)
curl.exe -H "x-goog-api-key: YOUR_API_KEY" `
  "http://127.0.0.1:<PORT>/v1beta/models/gemini-2-pro"

Summary ​

Antigravity Tools provides a complete set of multi-protocol compatible endpoints, supporting three mainstream API formats: OpenAI, Anthropic, and Gemini, plus MCP tool call extensions.

  • Quick Integration: Prioritize OpenAI protocol endpoints for strongest compatibility
  • Native Features: Use Anthropic protocol endpoints when you need full Claude Code functionality
  • Google Ecosystem: Choose Gemini protocol endpoints when using Google's official SDK
  • Security Configuration: Select appropriate authentication mode based on usage scenario (local/LAN/public)

Next Lesson Preview ​

In the next lesson, we'll learn Data and Models.

You'll learn:

  • Storage structure of account files
  • SQLite statistics database table structure
  • Key field definitions and backup strategies

Appendix: Source Code Reference ​

Click to expand source code locations

Last updated: 2026-01-23

FeatureFile PathLine Numbers
Route registration (all endpoints)src-tauri/src/proxy/server.rs120-194
Authentication middleware (Header compatibility + /healthz exemption + OPTIONS passthrough)src-tauri/src/proxy/middleware/auth.rs14-78
auth_mode modes and auto derivation rulesdocs/proxy/auth.md9-24
/healthz return valuesrc-tauri/src/proxy/server.rs266-272
Telemetry log interception (silent 200)src-tauri/src/proxy/server.rs274-277

Key Functions:

  • AxumServer::start(): Starts Axum server and registers routes (lines 79-254)
  • health_check_handler(): Health check handler (lines 266-272)
  • silent_ok_handler(): Silent success handler (lines 274-277)