Getting Started
This is a quick-start for running Ekai Gateway locally. For detailed client setup, see:
Prerequisites
Node.js v18 or newer
npm or Docker
At least one provider API key (OpenAI, Anthropic, xAI, or OpenRouter)
Local Setup (npm)
Clone the repository
git clone https://github.com/ekailabs/ekai-gateway.git cd ekai-gatewayInstall dependencies
npm installCopy and edit the environment file
cp .env.example .envAdd your API keys to
.env:OPENAI_API_KEY= ANTHROPIC_API_KEY= XAI_API_KEY= OPENROUTER_API_KEY=Build and start the Gateway
npm run build npm start
After startup:
Gateway API →
http://localhost:3001Dashboard →
http://localhost:3000
You can now send requests through the Gateway.
Docker Setup
cp .env.example .env
# Add API keys
docker compose up --build -dThis runs both the Gateway API (3001) and Dashboard (3000). Visit http://localhost:3000 to confirm the dashboard is active.
Environment Variables
OPENAI_API_KEY
Key for OpenAI models
ANTHROPIC_API_KEY
Key for Anthropic models
XAI_API_KEY
Key for xAI Grok models
OPENROUTER_API_KEY
Key for OpenRouter models
PORT_GATEWAY
Port for Gateway API (default 3001)
PORT_DASHBOARD
Port for Dashboard UI (default 3000)
DATABASE_PATH
SQLite file path (default data/usage.db)
Running the Gateway and Dashboard
When you start the services:
The Gateway listens for OpenAI and Anthropic API calls on
http://localhost:3001.The Dashboard runs at
http://localhost:3000and automatically reads usage data.A new SQLite database file is created the first time you send a request.
Using with Clients (Summary)
Claude Code
Set
ANTHROPIC_BASE_URL=http://localhost:3001Pick a model (e.g.,
claude-sonnet-4-20250514,grok-code-fast-1)Full guide → USAGE_WITH_CLAUDE_CODE.md
Codex
Set
OPENAI_BASE_URL=http://localhost:3001/v1Optional: configure
$CODEX_HOME/config.tomlwithmodel_provider = "ekai"Full guide → USAGE_WITH_CODEX.md
Next Steps
Explore the Dashboard at
http://localhost:3000Try switching models (
claude-sonnet-4-20250514,gpt-4o,grok-code-fast-1)Read the detailed guides for Claude Code and Codex
Last updated