Skip to main content

◆ APEX v2.0.0

The universal AI coding agent. Every model. One terminal.

PyPI version Python 3.11+ License: Proprietary Docker Stars


Install · Docs · CLI · Security · Models · Sponsor


APEX runs any LLM in your terminal as a coding agent — Anthropic, OpenAI, Google, Groq, Mistral, DeepSeek, Ollama (local), and 170+ more via litellm. Switch models mid-session. Track costs live. Never leave your terminal.


✨ Why APEX?

APEX OpenCode Claude Code Aider
Every model (170+) ✅ ⚠️ ❌ ⚠️
11 specialized agents ✅ ✅ ❌ ❌
Primary + Subagent system ✅ ✅ ❌ ❌
Hierarchical JSON config ✅ ✅ ❌ ❌
12 themes (dark/light) ✅ ✅ ❌ ❌
Session sharing (URL) ✅ ✅ ❌ ❌
Auto-formatting ✅ ✅ ❌ ❌
Custom commands (.md) ✅ ✅ ❌ ❌
Switch model mid-session ✅ ❌ ❌ ❌
Works offline (Ollama) ✅ ❌ ❌ ✅
Leader key shortcuts ✅ ✅ ❌ ❌
Command palette (Ctrl+P) ✅ ✅ ❌ ❌
@file references / !bash ✅ ✅ ❌ ❌
Beautiful Ink TUI + WebSocket EventBus ✅ ✅ ✅ ❌
Live token cost tracker ✅ ❌ ❌ ✅
Shell security analysis ✅ ❌ ❌ ❌
File watcher with ignores ✅ ✅ ❌ ❌
pip install ✅ ❌ ❌ ✅
Built in Africa 🇬🇦 ✅ ❌ ❌ ❌

🚀 Quick Start

# 1. Set your API key
export ANTHROPIC_API_KEY=sk-ant-...

# 2. Launch APEX (TUI auto-starts)
apex

# 3. Ask anything
> fix the authentication bug in auth.py
> add TypeScript types to all functions
> write tests for the payment module

Switch models / agents anytime

apex --model gpt-4o            # Start with GPT-4o
apex --model ollama-llama3      # Local, no API key needed
apex --agent plan               # Start in read-only plan mode
apex --continue                 # Resume last session
apex --session mysession        # Load a specific session

🎨 TUI — Terminal User Interface

APEX's terminal UI is built with Ink (React for terminals). It connects to the APEX backend over HTTP SSE for real-time token streaming, live cost tracking, and context percentage monitoring. The backend runs on a localhost port with a WebSocket EventBus for real-time state synchronization, following the OpenCode architecture pattern.

apex                          # Launch TUI (default)
apex --model gpt-4o          # Start with GPT-4o

Keybindings

Key Action
Tab / Shift+Tab Cycle agents
Ctrl+P Command palette
Ctrl+K Model selector
Ctrl+X Leader key (prefix)
Ctrl+X N New session
Ctrl+X U Undo
Ctrl+X R Redo
Ctrl+X C Compact context
Ctrl+X M List models
Ctrl+X T Theme selector
Ctrl+X S Status overview
Ctrl+X A Agent list
Ctrl+X L Sessions list
Ctrl+X B Toggle sidebar
Ctrl+X E Open editor
Ctrl+X X Export session
Ctrl+X Q Quit
@ File references (fuzzy search)
! Bash commands inline
? Help panel
Ctrl+O Toggle sidebar
Ctrl+L Clear messages
Ctrl+T Cycle reasoning variants
Escape Close overlay
Ctrl+Q Quit

Features

  • 11 Agents: 4 primary (Tab) + 4 subagents (@mention) + 3 system
  • 170+ Models: OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek, xAI, etc.
  • Live Metrics: token streaming, per-message cost, total spent, context %
  • 12 Themes: apex, nord, catppuccin, tokyonight, gruvbox, matrix, etc.
  • Agent Theming: title bar and status bar change color per agent
  • 100+ Tools: file, code, shell, git, web, database, docker, k8s, security
  • Reversible Workspaces: git-backed snapshots, turn history, one-command restore
  • MCP/LSP: server/client status and tool bridging
  • Leader Keys: Ctrl+X + mnemonic for all actions
  • Command Palette: Ctrl+P with fuzzy search
  • @ References: fuzzy file search with @filename
  • ! Bash: run shell commands inline with !command
  • HTTP Backend: local SSE server with WebSocket EventBus

🎮 Agents

APEX ships with 11 built-in agents — 4 primary (cycle with Tab), 4 subagents (invoke with @mention), and 3 hidden system agents.

Primary Agents (Tab to cycle)

Agent Color Description
build Cyan Default agent with full tool access for development
plan Purple Read-only planning & analysis (does not modify files)
planner Yellow Read-only detailed planning (no delegation)
shell Orange Infrastructure, DevOps, CI/CD (asks before system changes)

Subagents (@mention to invoke)

Agent Description
@reviewer Code review & audit specialist (read-only)
@general General-purpose multi-task assistant
@explore Fast read-only codebase exploration
@scout External docs & dependency research

System Agents (automatic, hidden)

Agent Role
@compaction Context window compression
@title Session title generation
@summary Session summary generation

Custom agents can be defined via Markdown files in .apex/agents/*.md or ~/.config/apex/agents/*.md, or as JSON in apex.json.


📋 CLI Commands

apex                          # Launch TUI (default)
apex run <prompt>             # Non-interactive mode
apex serve                    # Start headless HTTP API server
apex web                      # Server + web interface
apex gateway start            # Start APEX Gateway (proxy + auth + rate limits)
apex gateway key <tier>       # Generate a gateway API key
apex gateway status           # Show gateway keys and usage
apex auth login               # Interactive provider login
apex auth list                # List configured providers
apex auth logout              # Remove provider config
apex agent create             # Interactive agent wizard
apex agent list               # List all agents
apex session list             # List sessions
apex session delete <id>      # Delete a session
apex stats                    # Token usage & cost stats
apex export <id>              # Export session as JSON
apex import <file|url>        # Import session
apex upgrade                  # Upgrade APEX
apex uninstall                # Remove APEX
apex mcp add                  # Add MCP server
apex mcp list                 # List MCP servers
apex mcp auth <name>          # Authenticate MCP server
apex db path                  # Show database path
apex pr <number>              # Fetch & checkout PR
apex attach <url>             # Attach to remote backend
apex connect                  # Interactive provider config
apex init                     # Initialize project
apex compact                  # Compact context
apex details                  # Toggle tool output
apex thinking                 # Toggle reasoning blocks
apex models [provider]        # List models
apex --model <name>           # Set model
apex --agent <name>           # Set agent
apex --continue               # Resume last session

🔧 Configuration

APEX uses hierarchical JSON/JSONC config (like OpenCode):

# Global config
~/.config/apex/apex.json       # Main config
~/.config/apex/tui.json        # TUI-specific config

# Project config (overrides global)
./apex.json
./apex.jsonc

# Env vars (inline override)
APEX_CONFIG=./custom.json
APEX_CONFIG_CONTENT='{"model": "gpt-4o"}'

apex.json schema

{
  "$schema": "https://apex-ai.dev/config.json",
  "model": "claude-sonnet-4-5",
  "theme": "nord",
  "agent": {
    "code-reviewer": {
      "description": "Reviews code for best practices",
      "mode": "subagent",
      "permission": { "edit": "deny" }
    }
  },
  "command": {
    "test": {
      "template": "Run tests with coverage",
      "description": "Run tests"
    }
  },
  "permission": { "edit": "ask", "bash": "ask" },
  "formatter": true,
  "lsp": true,
  "share": "manual",
  "snapshot": true,
  "server": { "port": 0, "hostname": "127.0.0.1" },
  "watcher": {
    "ignore": ["**/node_modules/**", "**/.git/**"]
  }
}

Variables in config

{
  "model": "{env:APEX_MODEL}",
  "provider": {
    "anthropic": { "apiKey": "{file:~/.secrets/anthropic-key}" }
  }
}

🛠️ What APEX Can Do

  • Read & edit files — understands your whole codebase
  • Run commands — tests, builds, installs, git
  • Search code — grep-style across your project
  • 11 agents — specialized for different tasks
  • Subagents — invoke via @mention for parallel tasks
  • Custom commands — define via .apex/commands/*.md
  • Auto-formatting — ruff, prettier, gofmt, rustfmt, etc.
  • File watching — configurable ignore patterns
  • Roll back safely — snapshot the workspace and restore any turn
  • Session sharing — public URLs for collaboration
  • Fix bugs — diagnoses, patches, and verifies
  • Write features — complete implementations
  • Refactor code — preserves your style
  • Write tests — pytest, jest, go test, and more
  • Explain code — line by line if needed

🦀 Rust Backend (Internal GA)

rust/apex-rs/ is the progressively ported Rust backend. It is an internal GA: the agent loop, HTTP server, and tool registry are usable, but nothing is published (see ADR-0004). The wired surface includes workspace awareness, workspace rollback, shell security, HTTP auth, rate limiting, the permission gate, the gateway, and the full route-parity surface:

cd rust/apex-rs
cargo run -- workspace                  # repository context prompt block
cargo run -- workspace --json           # same context as JSON
cargo run -- rollback snapshot [LABEL]  # snapshot the workspace
cargo run -- rollback list [--json]     # snapshots (text view shows the last 10)
cargo run -- rollback restore <NAME>    # restore a snapshot
cargo run -- rollback record --data '{"query":"…"}'
cargo run -- rollback revert 1          # restore the turn recorded 1 turn ago

Snapshots live in .apex/snapshots/; turn history is .apex/turns.json. Python ↔ Rust parity and divergences are tracked in rust/apex-rs/PARITY.md.


🎭 Themes

12 built-in themes with dark/light mode support:

apex          ayu           catppuccin    catppuccin-macchiato
everforest    gruvbox       kanagawa      matrix
nord          one-dark      system        tokyonight
# Via TUI
Ctrl+X T         # Theme selector

# Via config
echo '{"theme": "nord"}' > ~/.config/apex/tui.json

Custom themes in ~/.config/apex/themes/*.json or .apex/themes/*.json.


🔗 Session Sharing

Share conversations with your team:

/share          # Create shareable URL → https://apex-ai.dev/s/abc123
/unshare        # Remove shared session

Modes: manual (default) | auto | disabled (set in config)


🎨 Formatters

Auto-formatting support for 11 languages:

Python:     ruff
JS/TS/JSON: prettier
Rust:       rustfmt
Go:         gofmt
Java:       google-java-format
C/C++:      clang-format
Ruby:       rubocop
Scala:      scalafmt
Kotlin:     ktlint
Swift:      swift-format
Zig:        zig fmt
# Enable all formatters
echo '{"formatter": true}' > apex.json

# Per-formatter config
echo '{"formatter": {"prettier": {"disabled": true}}}' > apex.json

🔒 Security

APEX includes comprehensive security features:

Shell Command Analysis

Blocks dangerous patterns: rm -rf /, curl | sh, fork bombs, disk writes.

Permission System

Fine-grained ALLOW/DENY/ASK per tool with glob pattern support.

Rate Limiting & API Keys

Database-backed rate limiting with workspace-based API keys.

HTTP API Security

Bearer token auth on all endpoints, configurable via config.


⚡ Installation

Quick install

npm (provisions the Python CLI/TUI on first run):

npm install -g apex-ai
apex

macOS / Linux:

curl -fsSLO https://apex-ai.dev/install.sh
bash install.sh                    # auto: pipx > uv > pip
bash install.sh --method native    # headless Rust backend (opt-in)

Windows (PowerShell):

Invoke-WebRequest https://apex-ai.dev/install.ps1 -OutFile install.ps1
powershell -ExecutionPolicy Bypass -File .\install.ps1

Both installers accept --method, --version, --prefix, --no-path, --yes, --dry-run and --uninstall [--purge]. See the installation guide for the full matrix.

Package managers

Method Command
npm (zero-dependency wrapper) npm install -g apex-ai
uv (fastest) uv tool install apex-ai
pipx (isolated) pipx install apex-ai
pip pip install apex-ai
Homebrew (rendered formula) brew install --formula ./apex-ai.rb
Docker docker run -it -v $(pwd):/workspace ghcr.io/ggboykxz/apex
Native backend (headless) bash install.sh --method native

From source

git clone https://github.com/Ggboykxz/APEX
cd APEX
pip install -e ".[dev]"

⚡ APEX Gateway (Zero-Config Free Models)

APEX Gateway is a built-in proxy server that gives you access to free + paid models without configuring API keys.

# 1. Get your free OpenRouter API key
#    → https://openrouter.ai/keys (no credit card needed)

# 2. Add it to .env
echo "OPENROUTER_API_KEY=sk-or-v1-..." >> .env

# 3. Start the gateway
apex gateway start
# → Gateway running on http://127.0.0.1:9090

# 4. Generate user keys
apex gateway key free "alice"      # Free tier: 50 req/day
apex gateway key pro "bob"         # Pro tier: 500 req/day

Tiers

Tier Req/day Tokens/day Req/min Models
Free 50 500K 10 Qwen3 Coder, Nemotron Super, DeepSeek R1, Gemma 4, Ring 2.6 1T...
Pro 500 5M 60 GLM-5.1, Kimi K2.6, MiniMax M2.7, DeepSeek V4 Pro...
Unlimited ∞ ∞ 300 All models

API

# Register a new user
curl -X POST http://127.0.0.1:9090/v1/register \
  -H "Content-Type: application/json" \
  -d '{"tier": "free", "label": "new-user"}'

# Chat via gateway
curl -X POST http://127.0.0.1:9090/v1/chat/completions \
  -H "Authorization: Bearer apex_..." \
  -H "Content-Type: application/json" \
  -d '{"model": "free-or-qwen3-coder", "messages": [{"role": "user", "content": "Hello"}]}'

# Check usage
curl -H "Authorization: Bearer apex_..." http://127.0.0.1:9090/v1/status

🤖 Supported Models (170+)

Bring Your Own Key (BYOK)

Use your own API keys from any provider:

Anthropic (Claude)
export ANTHROPIC_API_KEY=sk-ant-...
apex --model claude-sonnet-4-5   # Recommended
apex --model claude-opus-4-5     # Most powerful
apex --model claude-haiku-4-5    # Fastest
apex --model claude-sonnet-4-6   # Latest
apex --model claude-opus-4-7     # Most advanced
OpenAI (GPT / o-series)
export OPENAI_API_KEY=sk-...
apex --model gpt-4o
apex --model gpt-4o-mini
apex --model gpt-5
apex --model o3
apex --model o4-mini
Google (Gemini / Gemma)
export GEMINI_API_KEY=...
apex --model gemini-2.5-pro
apex --model gemini-2.5-flash
apex --model gemini-3-flash
apex --model gemma-4-31b
Groq (Ultra-fast inference)
export GROQ_API_KEY=gsk_...
apex --model llama-groq-4-maverick
apex --model mixtral-groq-8x7b
apex --model qwq-groq-32b
🔒 Ollama (100% local, no API key)
ollama pull llama3
apex --model ollama-llama3
apex --model ollama-deepseek-r1
apex --model ollama-qwen2.5-coder
DeepSeek
export DEEPSEEK_API_KEY=...
apex --model deepseek-chat
apex --model deepseek-reasoner
apex --model deepseek-v4-flash
apex --model deepseek-v4-pro
More providers
  • xAI: grok-3, grok-4, grok-4-fast
  • Mistral: codestral, pixtral, ministral, mixtral
  • Meta: llama-4-maverick, llama-4-scout
  • Qwen: qwen3-235b, qwen3-coder, qwq-plus
  • Cohere: command-a, command-a-reasoning
  • Cerebras: ultra-fast inference
  • Fireworks AI: deepseek, qwen, kimi
  • Together AI: deepseek, llama, qwen
  • Hugging Face: open models
  • Perplexity: sonar models
  • NVIDIA NIM: enterprise models
  • Cloudflare Workers AI: edge inference
  • OpenRouter: 200+ models via single API

💖 Sponsors

APEX is free to use. If it saves you time, consider sponsoring.

🥇 Gold Sponsors

Your logo here — become a sponsor

🥈 Silver Sponsors

Your logo here

🥉 Individual Backers

Sponsor APEX →


🤝 Contributing

git clone https://github.com/Ggboykxz/APEX
cd APEX
pip install -e ".[dev]"
pytest

Customize with commands in .apex/commands/*.md, agents in .apex/agents/*.md, and themes in .apex/themes/*.json.

See CONTRIBUTING.md for guidelines.


📄 License

Proprietary — All rights reserved by Ggboykxz (Copyright © 2026).

See LICENSE for full terms.


If APEX helps you, please ⭐ the repo — it means everything to an indie developer.

Metadata

Release files for apex-ai 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apex-ai 0.1.0
File Size Uploaded Provenance Actions
apex_ai-0.1.0.tar.gz 540.3 kB Without provenance Details for apex_ai-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for apex-ai 0.1.0
File Interpreter ABI Platform Actions
apex_ai-0.1.0-py3-none-any.whl Python 3 none any Details for apex_ai-0.1.0-py3-none-any.whl

Total release size: 788.4 kB

Release files / apex_ai-0.1.0.tar.gz

Download URL apex_ai-0.1.0.tar.gz
Size 540.3 kB
Tags Source
SHA-256 checksum
How to use checksums
15b70ad9df3859acd73268da2f912c64e58232313750b524dfb84c9c900bec8f
BLAKE2b-256 checksum
How to use checksums
5f1b31f31cc2ed0ad651539263dad82e3094a18444831c8da3119ac773a52134
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / apex_ai-0.1.0-py3-none-any.whl

Download URL apex_ai-0.1.0-py3-none-any.whl
Size 248.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb48a48ec01dfb2a4eca5c5e8e7858785c18f2c80a300f5d838c173d80e8a565
BLAKE2b-256 checksum
How to use checksums
27ba699121f99c651cb7c65a060255528f1fe8183866611d8312efdb7afa5614
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for apex-ai 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page