开源AI工作流 是 AI Skill Hub 本期精选Agent工作流之一。综合评分 7.5 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。
开源AI工作流 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
开源AI工作流 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:cargo install(推荐) cargo install agentgate-ai # 方式二:从源码编译 git clone https://github.com/dengmengmian/agentgate-ai cd agentgate-ai cargo build --release # 二进制在 ./target/release/agentgate-ai
# 查看帮助 agentgate-ai --help # 基本运行 agentgate-ai [options] <input> # 详细使用说明请查阅文档 # https://github.com/dengmengmian/agentgate-ai
# agentgate-ai 配置说明 # 查看配置选项 agentgate-ai --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export AGENTGATE_AI_CONFIG="/path/to/config.yml"
<p align="center"> <img src="docs/logo.svg" width="128" height="128" alt="AgentGate Logo"> </p>
<p align="center"> <b>Run Codex, Claude Code & Gemini CLI on cheaper models — without breaking them.</b><br> Automatic failover · cost tracking · one-click setup. One local gateway, 26 providers. </p>
<p align="center"> <a href="https://github.com/dengmengmian/agentgate-ai/releases"><img src="https://img.shields.io/github/v/release/dengmengmian/agentgate-ai?style=flat-square&color=blue" alt="Release"></a> <a href="https://github.com/dengmengmian/agentgate-ai/stargazers"><img src="https://img.shields.io/github/stars/dengmengmian/agentgate-ai?style=flat-square" alt="Stars"></a> <a href="https://github.com/dengmengmian/agentgate-ai/releases"><img src="https://img.shields.io/github/downloads/dengmengmian/agentgate-ai/total?style=flat-square&color=green" alt="Downloads"></a> <a href="./LICENSE"><img src="https://img.shields.io/github/license/dengmengmian/agentgate-ai?style=flat-square" alt="License"></a> </p>
<p align="center"> <a href="./README_ZH.md">中文</a> · <a href="https://github.com/dengmengmian/agentgate-ai/releases">Download</a> · <a href="#5-minute-quick-start">5-Minute Quick Start</a> · <a href="./docs/use-codex-with-deepseek.md">Codex + DeepSeek</a> · <a href="./docs/use-claude-code-with-deepseek.md">Claude Code + DeepSeek</a> · <a href="./docs/use-gemini-cli-with-agentgate.md">Gemini CLI</a> </p>
Protocol Conversion — 4 formats, bidirectional - OpenAI Responses API (/v1/responses) → Chat Completions / Claude Messages / Gemini API, for Codex - Anthropic Messages API (/v1/messages) → Chat Completions conversion / Anthropic pass-through, for Claude Code - Google Gemini API (/v1beta/models/:model:generateContent) → Chat Completions conversion, for Gemini CLI - Chat Completions (/v1/chat/completions) pass-through forwarding - Native Anthropic Claude API: tool_use/tool_result, input_schema, thinking.budget_tokens - Native Gemini API: contents/functionCall/functionResponse, generationConfig - Full DeepSeek reasoning_content (thinking mode) support without degradation - Automatic request retry (429/5xx, exponential backoff, Retry-After) - Auto-compaction for long histories: when history exceeds the model's context window (adaptive threshold at 85% of the cataloged window, per-model overridable), the gateway summarizes the middle of the conversation while keeping system and recent turns verbatim — small-window models survive very long sessions instead of hitting 400 - Quality-first thinking: conversions targeting Claude models enable thinking whenever the model supports it (adaptive for newer models, budget for older ones) while guarding the Anthropic constraints (budget bounds, sampling params, forced tool choice) that would otherwise 400 - Automatic prompt-cache injection: Anthropic-bound requests (both conversion and pass-through) get cache_control breakpoints at tools / system / history — budget-aware, never exceeding the 4-breakpoint limit; cache savings show up directly in the cost dashboard
Cost Tracking & Multi-Key Pooling - 22+ built-in model prices, auto-calculate cost per request - Dashboard: total/today/average cost cards, plus cost breakdown by model, by client, and by route, scoped to a time range (7/30 days) - Settings: inline price editing, custom price overrides - Multi-API-key per provider: round-robin rotation, auto-switch on 429
Smart Routing - Task-level routing conditions: route by input size, images, tools, system keywords - Failover selection strategy per route: priority (default) / cheapest (by model unit price) / fastest (by recent gateway latency) - Preset scenes: Image Requests / Reasoning / Background / Long Text / Tool-Heavy - Prompt cache injection for Anthropic (auto cache_control, ~90% input cost savings) - Cache support auto-detection on provider test
Gateway Refiner Layer (opt-in, off by default) - By default the gateway forwards requests/responses byte-for-byte; nothing is rewritten until you opt in - Three independent refiners, each behind a global master switch in Settings, with a per-provider override that can force-off (never force-on): - Request field filter — strips request fields a provider rejects, based on its quirks, to avoid 400s - Reasoning param correction — normalizes thinking.budget_tokens / reasoning.effort to the provider's accepted shape and range - Error response normalization — rewrites upstream error bodies into the shape the client (Codex / Claude Code / Gemini CLI) expects - Provider quirks come from built-in defaults, overridable per provider; every refiner action is recorded in the request log's trace_json
Multimodal Support & Per-Model Capability Matrix - Image content is fully preserved during protocol conversion (input_image/image_url → Chat Completions image_url, Anthropic image source format) - Per-model capability matrix tracks 8 dimensions per model: text / vision / audio_in / tts / video_in / reasoning / tools / web_search - Capability-aware promotion: when a request includes images, the gateway auto-swaps to a sibling model that supports vision (e.g. routes image requests to mimo-v2.5 instead of mimo-v2.5-pro on the same provider) - Promotion ranking prefers the substitute that preserves the most of the original model's other capabilities, with supported_models order as tiebreak - The capability matrix also drives tool emission: unchecking web_search for a model stops the gateway from sending the builtin to that model - Matrix auto-seeded from model-name patterns: built-in rules for MiMo / DeepSeek / Kimi / Moonshot, with a generic fallback for others - Provider test button now combines connectivity check + non-destructive matrix autofill (preserves manual edits) - In failover mode, requests with images skip providers whose matrix declares no vision-capable model - Providers that don't support images at the chosen model strip the image content at the provider-specific layer, avoiding upstream 400/404
Multi-Provider Management - 26 built-in presets (auto-fill base URL / protocols / Anthropic endpoint / default model): - Domestic: Xiaomi MiMo, DeepSeek, Kimi/Moonshot, MiniMax, GLM (Zhipu BigModel), DashScope (Aliyun Qwen), SiliconFlow, Volcengine (Doubao), Baichuan, StepFun, SenseNova, ModelScope, Yi (01.AI) - International: OpenAI, Anthropic (Claude), GitHub Copilot, Google Gemini, xAI (Grok), Mistral, Groq, Together, Fireworks, Cerebras, Perplexity, Cohere - Aggregator: OpenRouter - Custom: any OpenAI-compatible endpoint (vLLM / Ollama / LiteLLM / local proxies) - MiMo first-class support: 5 chat models (mimo-v2.5-pro / mimo-v2-pro / mimo-v2.5 / mimo-v2-omni / mimo-v2-flash), multi-turn reasoning_content round-trip, sk-* / tp-* keys auto-route to the correct Open API or Token Plan host, region-aware Token Plan URLs (cn / sgp / ams), and automatic web_search degradation when the paid plugin is unavailable - Claude Code passthrough for MiMo / DeepSeek uses ordinary provider model IDs by default; AgentGate no longer auto-configures [1m] suffixed models. - Route Profiles with multi-provider priority chains, auto-matched by protocol - Manual switching or automatic failover - Provider cooldown and runtime status tracking - Per-request failover: Provider A fails → automatically tries Provider B - Capability-aware routing: requests with images / audio / etc. auto-route to capable models within a provider, fall back to capable providers across the chain - New providers are automatically added to all route chains - Automatic model list fetching from providers - Connection stability: HTTP client tuned with pool_idle_timeout and tcp_keepalive, plus app-layer retry on transient connect/timeout errors (avoids stale keep-alive failures after a pause)
Client Configuration - Codex: one-click config + toggle between official and AgentGate (preserves conversations) - Codex Desktop compatibility: routes model requests to third-party APIs while preserving the official OpenAI provider path, signed-in account state, and plugin/account feature compatibility - Claude Code: one-click config + toggle between official and AgentGate - OpenCode: one-click config - Claude Desktop (macOS / Windows): point its third-party inference gateway at AgentGate; one-click apply with history rollback - Global instruction files: edit ~/.claude/CLAUDE.md / ~/.codex/AGENTS.md from inside AgentGate with 6 built-in templates grouped by purpose (general / coding / review / debug / security / docs); overwrite or append, with auto-snapshot, one-click rollback, and JSON backup/restore - MCP servers: read, add, edit, delete, and sync MCP server configs across Codex and Claude Code from one panel; env values are never shown in the list; JSON import/export with keys excluded by default - Local skills: list, enable/disable, and delete skills under ~/.claude/skills and ~/.codex/skills; install from a local .zip (zip-slip guarded, no network download) and JSON backup/restore - Local gateway access token (ag_local_*) authentication
Desktop Experience - System tray background operation when the window is closed - Auto-start on system boot, in-app updates, bilingual UI, 8 built-in themes - Optional desktop pet for gateway status, request stats, and error bubbles; it can be disabled in Settings
Quick Setup & Diagnostics - First-run onboarding: paste API key → auto-detect provider → select tools → one-click setup - Quick-add provider: paste an API key; known prefixes are detected automatically, ambiguous prefixes can be selected manually - Connection test: 3-step status bar (Config → Gateway → Provider) on the Clients page - Quick Setup page in sidebar (auto-hidden after providers configured, re-enable in Settings)
Diagnostics & Observability - Request logs, token stats, cost estimates, and provider runtime status - Provider failure state visible on cards: cooldown / consecutive failures / quota exhausted, with one-click reset - Active health probing (optional, off by default since probes consume a few tokens): periodic minimal probe per provider, shown on the card; when enabled it also seeds cold-start latency for the "fastest" routing strategy (providers with no recent traffic no longer sort blindly last) - Self-check and redacted diagnostic bundle export - Capability degradation events: image stripping, web_search downgrade, MCP advisory, and omitted tool-output images
Prerequisites
Install Dependencies
pnpm install
Development Mode
pnpm tauri dev
Build
pnpm tauri build
Guides: Codex Desktop plugins · Codex + DeepSeek · Codex + Xiaomi MiMo · Claude Code + DeepSeek · Claude Code + GitHub Copilot · Gemini CLI · OpenCode
| Goal | What AgentGate does |
|---|---|
| Use Codex with DeepSeek | Converts Codex's OpenAI Responses API requests to DeepSeek-compatible Chat Completions or Anthropic-compatible endpoints. |
| Use Codex with Xiaomi MiMo | Routes Codex through a local gateway to MiMo models with model mapping, reasoning support, and capability checks. |
| Run Claude Code on a GitHub Copilot subscription | Exchanges your GitHub token for Copilot credentials automatically and tags tool continuations / compaction as agent traffic so they don't consume premium requests. See [the dedicated section](#run-claude-code--codex-on-your-github-copilot-subscription). |
| Long sessions on small-context models | When history exceeds the model's context window, the gateway auto-summarizes the middle of the conversation (keeping system + recent turns verbatim) — a 128K-window model survives 300K+ token sessions. |
| Use Codex Desktop plugins with third-party APIs | Keeps Codex Desktop on its official OpenAI-authenticated provider path so plugin and account features can keep working while model requests route through AgentGate. |
| Use Claude Code with DeepSeek / MiMo | Uses Anthropic-compatible pass-through plus model mapping for DeepSeek and MiMo endpoints. |
| Switch Codex between providers | One local endpoint lets Codex switch between DeepSeek, MiMo, OpenAI, Kimi, GLM, DashScope, and more without hand-editing config files. |
127.0.0.1:9090. Note: 1420 is the development UI port, not the client API gateway.Most users only need these steps. Model mapping, protocol endpoints, and capability matrices can be left alone at first; AgentGate fills the common defaults for you.
<a id="run-claude-code--codex-on-your-github-copilot-subscription"></a>
Most users only need the 5-Minute Quick Start above. Expand for the full reference.
<details> <summary><b>Full usage guide — providers, clients, API calls, failover, capability routing, diagnostics</b></summary>
Codex with images (protocol conversion + vision-aware routing):
Codex sends input_image
→ /v1/responses (Responses API)
→ ① Auth passes
→ ② Matches Codex Default Route Profile
→ ③ Protocol conversion: input_image → image_url (image preserved)
→ ④ Vision routing: image detected → skip DeepSeek (No Vision) → select KimiCoding (Vision)
→ ⑤ KimiCoding transform: no image stripping, send directly
→ ⑥ KimiCoding returns success → mark healthy
→ ⑦ Log request
→ ⑧ Reverse-convert to Responses API format → return to Codex
Claude Code → DeepSeek (native passthrough + model mapping):
Claude Code sends Messages API request
→ /v1/messages
→ ① Auth passes
→ ② Matches Claude Code Default Route Profile
→ ③ DeepSeek has anthropic_base_url → native passthrough
→ Model Mapping: claude-sonnet-4-6 → deepseek-v4-pro
→ Replace URL with api.deepseek.com/anthropic + inject API key
→ Request body proxied as-is → SSE response stream proxied as-is
→ ④ Log request
OpenCode / curl / New API (native passthrough):
Client sends Chat Completions request
→ /v1/chat/completions
→ ① Auth passes
→ ② Matches Route Profile
→ ③ Native passthrough: replace URL + API key; model unchanged unless mapping matches
→ Request body forwarded as-is → SSE response stream proxied as-is
→ ④ Log request
| Overview | Providers |
|---|---|
|  |  |
| Routes | Gateway |
|---|---|
|  |  |
| Clients | Logs |
|---|---|
|  |  |
| Diagnostics | Settings |
|---|---|
|  |  |
| Global Instructions | MCP Servers |
|---|---|
|  |  |
| Skills | Quick Setup |
|---|---|
|  |  |
| Pet Settings | Desktop Pet |
|---|---|
|  |  |
If you have a Copilot subscription (Pro / Business), Claude Code can run on the Claude models it includes — no separate Anthropic API billing. AgentGate handles three things:
gho_...); the gateway exchanges and renews the Copilot API credential automatically (cached by hash, never stored in plaintext).x-initiator: agent, so only the messages you actually send consume premium requests. One instruction with 10 tool round-trips counts as 1.claude-sonnet-4-6 from Claude Code becomes the claude-sonnet-4.6 form the Copilot endpoint expects — no mapping needed.Steps:
oauth_token from ~/.config/github-copilot/apps.json.gho_ token as the API key (base URL and models auto-fill).x-initiator classification per request.⚠️ Risk disclosure: using a Copilot subscription outside official clients is a gray area under GitHub's Terms of Service. Similar community tools have existed for a long time without mass enforcement, but account risk cannot be ruled out — evaluate it yourself, and avoid important corporate accounts. This feature is entirely opt-in; if you never add a copilot-type provider, none of this applies.
Clients → Codex → Apply Config
AgentGate will automatically:
~/.codex/config.toml and auth.jsonClick Switch to Official to restore the original config at any time — conversations are preserved.
Clients → Claude Code → Apply Config
AgentGate writes to ~/.claude/settings.json, setting ANTHROPIC_BASE_URL to the local gateway and ANTHROPIC_API_KEY to the AgentGate local token.
Click Switch to Official to restore the original settings.json.
Clients → OpenCode → Apply Config
AgentGate writes to ~/.config/opencode/opencode.json, configuring an OpenAI-compatible provider pointing to the local gateway. It uses openai/agentgate as a virtual model so switching providers in AgentGate does not require editing OpenCode again.
Clients → Gemini CLI → Apply Config
AgentGate writes Gemini CLI's config to point at the local gateway's /v1beta/... route (Gemini-compatible). One-click toggle back to official.
Clients → AtomCode → Apply Config
AtomCode integration writes its config to use AgentGate as the upstream — same toggle pattern as the others. It uses agentgate as a virtual model so the gateway can resolve DeepSeek / MiMo / other provider model names at request time.
All endpoints (except /health) require a local access token.
Getting the token:
- Copy from UI: AgentGate → Settings → Gateway Auth → click the copy button next to the token - Read from terminal:
TOKEN=$(cat ~/.agentgate/token)
- Regenerate: Settings → Regenerate Token (old token is immediately invalidated)
The token format is ag_local_*. It is only used for local gateway auth and is never forwarded to upstream providers.
Chat Completions (Pass-through)
curl -X POST http://127.0.0.1:9090/v1/chat/completions \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"Hello"}]}'
Responses API (Codex Protocol)
curl -X POST http://127.0.0.1:9090/v1/responses \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.5","input":"Hello","stream":true}'
Messages API (Claude Code Protocol)
curl -X POST http://127.0.0.1:9090/v1/messages \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"model":"claude-sonnet-4-6","max_tokens":1024,"messages":[{"role":"user","content":"Hello"}]}'
Model List
curl http://127.0.0.1:9090/v1/models -H "Authorization: Bearer $TOKEN"
Health Check (No Auth Required)
curl http://127.0.0.1:9090/health
Client says “network connection failed”?
First check whether the gateway port is actually running:
curl http://127.0.0.1:9090/health
http://localhost:1420 is only the development UI; Codex / Claude Code / OpenCode / Gemini CLI / AtomCode call http://127.0.0.1:9090../scripts/test-responses-stream.sh
There are great LLM proxies out there. AgentGate's niche is coding agents on the desktop — it's the only one focused on keeping Codex / Claude Code / Gemini CLI happy with a GUI, not a server you operate.
| Tool | What it's best at | How AgentGate differs |
|---|---|---|
| **Plain proxy** | Swapping a base URL | Keeps Codex / ChatGPT login + plugins working, converts protocols, and routes by capability |
| **claude-code-router** | Routing Claude Code (CLI) to other models | Also covers Codex Responses API, Gemini CLI, OpenCode — plus a GUI and cost dashboard |
| **one-api / new-api** | Multi-user API reselling & billing on a server | Local-first, single-user, no account system; one-click client config built in |
| **LiteLLM** | A Python SDK / proxy for 100+ LLMs in your own app | A desktop gateway for coding agents, not a library — zero code, GUI-driven |
Positioning is approximate and these tools evolve fast — pick what fits your workflow. If you operate a shared API server, one-api / LiteLLM may suit you better; if you live in Codex / Claude Code, this is built for you.
Are my API keys safe? Does AgentGate phone home? Keys live only in a local SQLite file on your machine and are never sent to clients or to any AgentGate server — there is no AgentGate backend. Your keys go only to the upstream provider you configured. The desktop app binds to 127.0.0.1; only headless mode with an explicit --host 0.0.0.0 exposes it, with built-in Host / Origin validation.
Can running Claude Code on a Copilot subscription get my account banned? It's a gray area under GitHub's Terms of Service: similar community tools have existed for a long time without mass enforcement, but the risk can't be ruled out — see the risk disclosure. If you never add a copilot-type provider, none of this applies.
Will it break my Codex / ChatGPT login or Codex Desktop plugins? No. AgentGate keeps Codex on the official OpenAI-authenticated provider path, so your signed-in account, plugins, Browser / Computer-Use / Mobile and quota lookup keep working while chat requests route to third-party models. Switch to Official restores the original config at any time — conversations are preserved.
Can I run it offline / on a server without the GUI? Yes. Headless mode (agentgate-serve) and Docker run without a window — see Headless / Server Mode.
Do I have to edit config.toml / settings.json by hand? No. One-click Apply Config writes them for you and backs up the originals; Switch to Official rolls back.
A client says "network connection failed" — what now? First check the gateway is up: curl http://127.0.0.1:9090/health. If it fails, start the gateway from the app. Note localhost:1420 is only the dev UI — clients call 127.0.0.1:9090.
Which model does a request actually hit? Open Logs — every request shows the client, route, resolved provider, model, status, and cost.
该项目提供了一个开源的AI工作流,支持本地AI网关和编码代理,使用Rust语言开发,值得关注。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,开源AI工作流 在Agent工作流赛道中表现稳健,质量良好。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | agentgate-ai |
| Topics | workflowagentgateai-coding-agentai-gatewayanthropic-apiatomcoderust |
| GitHub | https://github.com/dengmengmian/agentgate-ai |
| License | MIT |
| 语言 | Rust |
收录时间:2026-06-12 · 更新时间:2026-06-12 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端