Skip to content

Overview

GodeX bridges the gap between the OpenAI Responses API and the diverse ecosystem of non-OpenAI large language model providers. Instead of rewriting every client SDK to speak each provider's proprietary protocol, you point your OpenAI-compatible tooling at GodeX and it transparently translates requests and responses behind the scenes. This eliminates vendor lock-in and lets teams switch or combine LLM providers with a single configuration change.

At a Glance

AspectDetail
WhatOpenAI-compatible Responses API gateway
ProtocolAccepts OpenAI Responses API; translates to Chat Completions
RuntimeBuilt on Bun for high-performance HTTP serving
Built-in ProvidersDeepSeek, Zhipu, MiniMax
Session BackendsIn-memory, SQLite
ConfigurationYAML file with ${VAR} environment interpolation
CLIgodex init wizard, godex serve runtime
ObservabilityBuilt-in trace recorder with payload capture

Architecture

GodeX is organized as a layered gateway where each layer has a single responsibility: CLI parsing, configuration building, provider registration, request bridging, and response reconstruction.

Request Lifecycle

Every incoming request follows a deterministic path through the system. The bridge kernel validates compatibility, plans tool transformations, dispatches to the correct provider edge, and then reconstructs the response into the OpenAI Responses API format.

The SyncRequestPipeline orchestrates this flow: it delegates to ProviderExchange, which calls buildChatCompletionRequest to translate the incoming Responses API payload into a Chat Completions request tailored to the target provider's capabilities (src/responses/sync-request-pipeline.ts:31-46).

Provider Spec Contract

Every provider implements the ProviderSpec interface, which defines a uniform contract for capabilities, endpoint configuration, authentication, tool name translation, and response/stream accessors (src/bridge/provider-spec/contract.ts:54-74).

Contract FieldPurpose
nameUnique provider identifier (e.g. deepseek)
protocolAlways chat_completions
capabilitiesDeclares supported parameters, tools, formats
endpointDefault base URL
authAuthentication scheme (always Bearer)
toolNameCodec for translating tool names between API and provider
responseAccessors for extracting text, usage, finish reason
streamAccessor for extracting deltas from SSE chunks
hooksOptional patchRequest, normalizeResponse, normalizeChunk

Session Management

GodeX supports multi-turn conversations by persisting responses and replaying previous messages when a client sends previous_response_id. Two backends are available:

BackendDescriptionDefault
memoryIn-process map; lost on restartYes
sqliteFile-based persistence via SQLiteOpt-in

Session configuration is parsed in src/config/sections/session.ts:5-27 and the store is created during ApplicationContext initialization (src/context/application-context.ts:20-30).

Compatibility Planning

Before any request reaches a provider, the bridge kernel builds a compatibility plan that checks every requested parameter, tool type, and response format against the provider's declared capabilities. Unsupported features are either degraded to a compatible alternative or rejected with a diagnostic (src/bridge/compatibility/compatibility-plan.ts:38-50).

Streaming Pipeline

For streaming requests, the StreamPipeline wires together multiple TransformStream stages: raw SSE ingestion, event bridging, output contract validation, trace recording, logging, session persistence, and compatibility diagnostics (src/responses/stream-pipeline.ts:37-85).

Next Steps

TopicDescription
Quick StartInstall GodeX and make your first API call
ConfigurationFull godex.yaml reference
Built-in ProvidersDeepSeek, Zhipu, and MiniMax comparison

References