System diagram

Request lifecycle
1
Authentication
The gateway validates the
x-wallet-address header and checks the Authorization bearer token against the API key database. If credits are enabled, it verifies the user has sufficient balance.2
Model routing
The gateway routes the request to the appropriate inference backend based on the
model field. The default production model is the 32B Conductor.3
Knowledge injection
Before inference, the gateway scans the user’s message against 85+ keyword triggers. If a match is found (e.g., the user mentions “aerodrome” or “virtuals”), relevant project context is injected as a system message — up to 2 projects, ~500 tokens.
4
Agentic tool loop
The model’s response is checked for tool calls. If found, the gateway executes the tool, feeds the result back to the model, and loops — up to 8 rounds. The gateway also detects when the model is “stalling” (saying “let me check…” without actually calling a tool) and nudges it.
5
Auto-chaining
When a
web_search returns results, the gateway automatically reads any tweet URLs via read_tweet and extracts the top non-tweet page via web_extract — all without additional model round-trips.6
Response + billing
The final text response is returned in OpenAI format. Credits are deducted based on total token usage across all tool rounds.
Tool system
The gateway has 16 built-in tools, all read-only:
Tools are defined as a registry with descriptions, parameter schemas, and async execution functions. The gateway generates tool definitions from this registry and sends them with every inference call.
Knowledge base (RAG)
The gateway includes a curated knowledge base of Base ecosystem projects, loaded at startup. Each entry contains metadata, keywords, and detailed context. Two retrieval modes:- Auto-injection — Keywords in the user’s message trigger automatic context injection before inference. Top 2 matches, ~500 tokens.
- Explicit search — The
knowledge_searchtool lets the model query the knowledge base directly. Returns up to 5 results with fuzzy scoring.
Inference engine
The gateway manages model routing, cold start handling, and response formatting. It supports multiple backends and handles the translation between different inference APIs transparently. Key features:- Cold start management — Automatic polling and retry for models scaling from zero
- Fallback routing — Graceful degradation if the primary backend is unavailable
- Format normalization — All responses are returned in OpenAI Chat Completions format regardless of the underlying backend