Configs2026年7月24日·1 分钟阅读

OpenCodex — Universal LLM Proxy for AI Coding Agents

Universal provider proxy that lets you use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama) with OpenAI Codex CLI, Claude Code, and other AI coding agents through a single gateway.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
OpenCodex
直接安装命令
npx -y tokrepo@latest install 700c44f6-875c-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

OpenCodex is an open-source proxy server that bridges any LLM provider to AI coding agents like OpenAI Codex CLI and Claude Code. Instead of being locked into a single model vendor, OpenCodex translates API calls on the fly so you can use Claude, Gemini, Grok, DeepSeek, or locally hosted models through Ollama with any coding agent that speaks the OpenAI-compatible API format.

What OpenCodex Does

  • Proxies OpenAI-compatible API requests to 10+ LLM providers transparently
  • Enables using Claude, Gemini, DeepSeek, or Ollama models with Codex CLI
  • Translates tool-use and function-calling formats between provider APIs
  • Supports streaming responses for real-time coding agent feedback
  • Runs as a local proxy server with zero cloud dependency

Architecture Overview

OpenCodex runs a lightweight TypeScript-based HTTP proxy that intercepts OpenAI-formatted API requests and translates them to the target provider's native format. It handles authentication, request transformation, streaming response adaptation, and error normalization. The proxy supports hot-swapping between providers without restarting the coding agent, and includes a caching layer to reduce redundant API calls during iterative coding sessions.

Self-Hosting & Configuration

  • Install globally via npm or run with npx for quick sessions
  • Configure provider credentials via environment variables or config file
  • Start the proxy and point your coding agent's API base URL to localhost
  • Set up model aliases to map generic names to provider-specific identifiers
  • Enable request logging for debugging and cost tracking

Key Features

  • Supports Claude, Gemini, Grok, DeepSeek, Ollama, and OpenRouter providers
  • Tool-use format translation between OpenAI, Anthropic, and Google schemas
  • Request caching reduces token costs during iterative agent workflows
  • Provider failover automatically switches to backup providers on errors
  • Model aliasing lets agents reference models by simple names

Comparison with Similar Tools

  • LiteLLM — broader scope API gateway; OpenCodex is optimized for coding agents
  • OpenRouter — SaaS routing service; OpenCodex runs entirely locally
  • Portkey AI Gateway — enterprise-focused; OpenCodex is lightweight and self-hosted
  • Bifrost CLI — wraps Claude Code specifically; OpenCodex supports multiple agents
  • Ollama — local model runner; OpenCodex proxies to Ollama and many other providers

FAQ

Q: Does it work with Claude Code out of the box? A: Yes, set the API base URL environment variable to point at the proxy and Claude Code will use your chosen provider.

Q: Can I use local models through Ollama? A: Yes, configure Ollama as the provider and OpenCodex will proxy requests to your local Ollama instance.

Q: Does it support streaming? A: Yes, server-sent events are translated between provider formats for real-time output.

Q: Is there any performance overhead? A: Minimal. The proxy adds single-digit milliseconds of latency for request translation.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产