一键导入
opencodex-gateway
Local gateway for Codex Desktop with custom API support, web dashboard, Computer Use engine, and Vision Bridge for text-only models
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Local gateway for Codex Desktop with custom API support, web dashboard, Computer Use engine, and Vision Bridge for text-only models
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | opencodex-gateway |
| description | Local gateway for Codex Desktop with custom API support, web dashboard, Computer Use engine, and Vision Bridge for text-only models |
| triggers | ["set up OpenCodex gateway for Codex Desktop","configure custom API models in OpenCodex","add a third-party model to Codex Desktop","enable Vision Bridge for text-only models","configure Computer Use with OpenCodex","manage OpenCodex dashboard settings","troubleshoot OpenCodex API integration","reset Codex to native configuration"] |
Skill by ara.so — Codex Skills collection.
OpenCodex is a zero-config local gateway that enables Codex Desktop to use third-party APIs (OpenAI-compatible endpoints). It features a bilingual web dashboard for model management, a custom Computer Use engine with native macOS control, and Vision Bridge that lets text-only models handle visual tasks by automatically describing screenshots.
git clone https://github.com/AITabby/opencodex.git
cd opencodex
npm install
npm start
The server starts on http://localhost:8765 and automatically:
~/.codex/config.toml (creates backup)OpenCodex sits between Codex Desktop and third-party APIs:
Codex Desktop → OpenCodex Gateway (localhost:8765) → Third-party API
↓
Vision Bridge (optional)
Computer Use Engine
Access at http://localhost:8765/dashboard
https://api.openai.com/v1 or https://api.deepseek.com)~/.codex/config.toml)gpt-4, deepseek-chat)OpenCodex modifies ~/.codex/config.toml:
[api]
base_url = "http://localhost:8765/v1"
api_key = "your-actual-api-key"
[[models]]
name = "gpt-4"
enabled = true
[[models]]
name = "deepseek-chat"
enabled = true
Original config backed up to ~/.codex/config.toml.backup
For development or custom deployments:
export OPENCODEX_PORT=8765
export OPENCODEX_API_KEY=sk-your-key-here
export OPENCODEX_BASE_URL=https://api.openai.com/v1
Vision Bridge enables text-only models to handle Computer Use tasks by converting screenshots to text descriptions.
sipsIn the dashboard, configure Vision Bridge settings:
{
"vision_bridge": {
"enabled": true,
"endpoint": "https://api.openai.com/v1",
"model": "gpt-4-vision-preview",
"api_key": "process.env.VISION_API_KEY",
"max_dimension": 1200
}
}
If extending OpenCodex, here's how Vision Bridge is invoked:
import { VisionBridge } from './vision-bridge';
const bridge = new VisionBridge({
endpoint: process.env.VISION_ENDPOINT,
model: 'gpt-4-vision-preview',
apiKey: process.env.VISION_API_KEY
});
// Automatically converts screenshot to description
const description = await bridge.describeImage(screenshotBase64);
// Injects into prompt for text-only model
const modifiedPrompt = bridge.injectDescription(originalPrompt, description);
OpenCodex implements custom Computer Use actions for macOS using native CGEvent APIs.
Codex sends tool calls in this format:
{
"type": "computer_use",
"action": "mouse_click",
"params": {
"x": 500,
"y": 300,
"button": "left"
}
}
{
"action": "mouse_click",
"params": { "x": 500, "y": 300, "button": "left" }
}
{
"action": "type_text",
"params": { "text": "Hello, world!" }
}
{
"action": "screenshot",
"params": { "max_dimension": 1200 }
}
Response includes base64 image:
{
"success": true,
"image": "iVBORw0KGgoAAAANS..."
}
All OpenAI-compatible requests go through:
POST http://localhost:8765/v1/chat/completions
Headers:
Authorization: Bearer <your-api-key>
Content-Type: application/json
curl http://localhost:8765/api/config
curl -X POST http://localhost:8765/api/config \
-H "Content-Type: application/json" \
-d '{
"base_url": "https://api.deepseek.com",
"api_key": "sk-...",
"models": [
{"name": "deepseek-chat", "enabled": true}
]
}'
curl -X POST http://localhost:8765/api/restart-codex
curl -X POST http://localhost:8765/api/reset-native
curl -N http://localhost:8765/api/logs
Stream format:
data: {"timestamp": "2026-06-04T10:30:00Z", "level": "info", "message": "Request to gpt-4"}
data: {"timestamp": "2026-06-04T10:30:01Z", "level": "info", "message": "Response 200"}
const models = [
{ name: 'gpt-4-turbo', enabled: true },
{ name: 'gpt-4', enabled: true },
{ name: 'claude-3-opus', enabled: false }
];
await fetch('http://localhost:8765/api/config', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ models })
});
To switch from OpenAI to DeepSeek:
https://api.deepseek.comdeepseek-chatUse a different vision model for Vision Bridge:
{
"vision_bridge": {
"enabled": true,
"endpoint": "https://api.anthropic.com/v1",
"model": "claude-3-opus-20240229",
"api_key": "process.env.ANTHROPIC_API_KEY"
}
}
Symptom: Codex shows "API Error" or "Connection Failed"
Solution:
curl http://localhost:8765/health~/.codex/config.toml has base_url = "http://localhost:8765/v1"http://localhost:8765/dashboard → scroll to logsSymptom: Added models don't show in Codex
Solution:
~/.codex/config.toml includes the model with enabled = trueSymptom: Text-only model fails on Computer Use tasks
Solution:
curl -X POST <vision_endpoint>/chat/completionssips is available (which sips)Symptom: 429 errors in logs
Solution:
Symptom: Error: listen EADDRINUSE: address already in use :::8765
Solution:
# Find process on port 8765
lsof -i :8765
# Kill it
kill -9 <PID>
# Or change port
export OPENCODEX_PORT=8766
npm start
Symptom: Codex behaves unexpectedly after config changes
Solution:
~/.codex/config.toml.backupSymptom: Vision API rejects screenshots
Solution:
{ "max_dimension": 800 }
sips outputopencodex/
├── src/
│ ├── server.ts # Main Express server
│ ├── vision-bridge.ts # Vision Bridge logic
│ ├── computer-use.ts # macOS automation
│ └── config.ts # Config patching
├── public/
│ └── dashboard.html # Web UI
└── package.json
npm run dev # Enables hot-reload
Extend Computer Use engine:
// src/computer-use.ts
export async function customAction(params: any) {
// Use node-mac-automation or applescript
const result = execSync(`osascript -e 'tell application "Finder" to ...'`);
return { success: true, result: result.toString() };
}
Register in action handler:
case 'custom_action':
return await customAction(params);
Add custom logs visible in dashboard:
import { logger } from './logger';
logger.info('Custom event', { data: someData });
logger.error('Something failed', { error });
For the ultimate experience, pair with OpenCodexBar:
npm startOption + Space for system-wide voice activationBoth projects work independently but are designed to complement each other.
Convert attached object images into code-only, animation-ready procedural Three.js models through guided sculpting workflow
Create and manage AI video storyboard projects with automated asset generation through Codex Storyboard workspace
Continue-thinking middleware that detects and handles reasoning truncation in Codex/OpenAI Responses-compatible APIs
Desktop manager for OpenAI Codex CLI with prompt injection, provider switching, and TOML/Auth visualization
Inject unrestricted developer mode instructions into Codex CLI (GPT-5.5) to bypass content filters
Install and use TradingCodex to build Codex-native investment research workflows with fixed-role agents, order approval gates, and local Django service plane