OPTXOPTX DOCS
JOE β€” Jett Optics Engine

HEDGEHOG Gateway

Handshake Encrypted Delegated Gesture Envelope Handler Optical Gateway β€” multi-API AI MCP server.

HEDGEHOG (Handshake Encrypted Delegated Gesture Envelope Handler Optical Gateway) is the AI gateway that powers AstroJOE's intelligence. It runs on OPTX Validator Nodes and proxies requests to Grok 4.20 via the xAI API.

Architecture

HEDGEHOG serves two roles:

  1. MCP Server (stdio) β€” 12 tools for Claude Code / Cursor integration
  2. HTTP Service (port 8811) β€” OpenAI-compatible shim for Hermes Agent and AgenC

HTTP Endpoints

OpenAI-Compatible Chat Completions

POST /v1/chat/completions

SSE streaming support. Used by Hermes Agent and AgenC for LLM inference.

Multi-Agent Responses

POST /v1/responses

Proxies to xAI's /v1/responses with Grok 4.20 multi-agent mode. Supports built-in tools:

  • web_search β€” Search the web
  • x_search β€” Search X/Twitter

Memory Endpoints

POST /memory/store    β€” Store a key-value memory
GET  /memory/recall   β€” Recall by key
GET  /memory/recent   β€” Get recent memories

Models

GET /v1/models        β€” List available models

MCP Tools (12 total)

ToolDescription
hedgehog_grok_queryQuery Grok 4.20 with project context
hedgehog_get_contextRetrieve jOSH-spatial work context
hedgehog_store_gaze_dataStore COG/ENV/EMO gaze tensors
hedgehog_retrieve_gaze_dataRetrieve gaze tracking history
hedgehog_analyze_gaze_patternAI-powered gaze pattern analysis
hedgehog_chat_completionMulti-model AI chat
hedgehog_xai_api_historyxAI API call audit trail
hedgehog_xai_api_statsxAI API usage statistics
hedgehog_gatewayxAI API Gateway with embedded key
hedgehog_memory_storeStore memory in SpacetimeDB
hedgehog_memory_recallRecall memory by key
hedgehog_memory_searchSearch memories

Model Routing

PriorityModelUse Case
Primarygrok-4.20-multi-agent-beta-0309Web search, X search, research, spatial reasoning
Fallbackgrok-4.20-0309-reasoningComplex reasoning without multi-agent tools
Chatgrok-3-fastStandard chat completions (AgenC, Hermes)

Multi-Agent Fallback

If the /v1/responses endpoint fails, HEDGEHOG automatically falls back to /v1/chat/completions with the reasoning model.

On this page