AgentAPI + cliproxyapi++ integration research (2026-02-22)
Executive summary
agentapiandcliproxyapi++are complementary rather than redundant.agentapiis strong at agent session lifecycle (message, status, events, host attachment) with terminal-backed adapters.cliproxyapi++is strong at model/protocol transport (OpenAI-style APIs, provider matrix, OAuth/session refresh, routing/failover).- A practical tandem pattern is:
- use
agentapifor agent orchestration control, - use
cliproxyapi++as the model transport or fallback provider layer, - connect both through a thin orchestration service with clear authz/routing boundaries.
- use
What agentapi is good at (as of 2026-02-22)
From the upstream repo:
- Provides HTTP control for coding agents such as Claude Code, Goose, Aider, Gemini, Codex, Cursor CLI, etc.
- Documents 4 conversation endpoints:
POST /messageto send user input,GET /messagesfor history,GET /statusfor running/stable state,GET /eventsSSE for event streaming.
- Includes a documented OpenAPI schema and
/docsUI. - Explicitly positions itself as a backend in MCP server compositions (one agent controlling another).
- Roadmap notes MCP + Agent2Agent support as pending features.
Why cliproxyapi++ in tandem
cliproxyapi++ is tuned for provider transport and protocol normalization (OpenAI-compatible paths and OAuth/session-heavy provider support). That gives you:
- Stable upstream-facing model surface for clients expecting OpenAI/chat-style APIs.
- Centralized provider switching, credential/session handling, and health/error routing.
- A predictable contract for scaling many consumer apps without binding each one to specific CLI quirks.
This does not solve all agentapi lifecycle semantics by itself; agentapi has terminal-streaming/session parsing behaviors that are still value-add for coding CLI automation.
Recommended tandem architecture (for your stack)
Gateway plane
- Keep
cliproxyapi++as the provider/generative API layer. - Expose it internally as
/v1/*and route non-agent consumers there.
- Keep
Agent-control plane
- Run
agentapiper workflow (or shared multi-tenant host with strict isolation). - Use
/message,/messages,/status, and/eventsfor orchestration state and long-running control loops.
- Run
Orchestrator service
- Introduce a small orchestrator that translates high-level tasks into:
- model calls (via
cliproxyapi++) for deterministic text generation/translation, - session actions (via
agentapi) when terminal-backed agent execution is needed.
- model calls (via
- Introduce a small orchestrator that translates high-level tasks into:
Policy plane
- Add policy on top of both layers:
- secret management and allow-lists,
- host/origin/CORS constraints,
- request logging + tracing correlation IDs across both control and model calls.
Converge on protocol interoperability
- Track
agentapiMCP/A2A roadmap and add compatibility tests once MCP is GA or when A2A adapters are available.
Alternative/adjacent options to evaluate
Multi-agent orchestration frameworks
- AutoGen
- Good for message-passing and multi-agent collaboration patterns.
- Useful when you want explicit conversation routing and extensible layers for tools/runtime.
- LangGraph
- Strong for graph-based stateful workflows, durable execution, human-in-the-loop, and long-running behavior.
- CrewAI
- Role-based crew/fleet model with clear delegation, crews/flights-style orchestration, and tool integration.
- OpenAI Agents SDK
- Useful when you are already on OpenAI APIs and need handoffs + built-in tracing/context patterns.
Protocol direction (standardization-first)
- MCP (Model Context Protocol)
- Open standard focused on model ↔ data/tool/workflow interoperability, intended as a universal interface.
- Particularly relevant for reducing N×M integration work across clients/tools.
- A2A (Agent2Agent)
- Open protocol for inter-agent communication, task-centric workflows, and long-running collaboration.
- Designed for cross-framework compatibility and secure interop.
Transport alternatives
- Keep OpenAI-compatible proxying if your clients are already chat/completion API-native.
- If you do not need provider-heavy session orchestration, direct provider SDK routing (without cliproxy) is a simpler but less normalized path.
Suggested phased pilot
Phase 1: Proof of contract (1 week)
- Spin up
agentapi+cliproxyapi++together locally. - Validate:
/messagelifecycle and SSE updates,/v1/modelsand/v1/metricsfrom cliproxy,- shared tracing correlation between both services.
Phase 2: Hardened routing (2 weeks)
- Add orchestrator that routes:
- deterministic API-style requests to
cliproxyapi++, - session-heavy coding tasks to
agentapi, - shared audit trail plus policy checks.
- deterministic API-style requests to
- Add negative tests around
agentapicommand-typing and cliproxy failovers.
Phase 3: Standards alignment (parallel)
- Track A2A/MCP progress and gate integration behind a feature flag.
- Build adapter layer so either transport (
agentapinative endpoints or MCP/A2A clients) can be swapped with minimal orchestration changes.
Research links
- AgentAPI repository: https://github.com/coder/agentapi
- AgentAPI OpenAPI/roadmap details: https://github.com/coder/agentapi
- MCP home: https://modelcontextprotocol.io
- A2A protocol: https://a2a.cx/
- OpenAI Agents SDK docs: https://platform.openai.com/docs/guides/agents-sdk/ and https://openai.github.io/openai-agents-python/
- AutoGen: https://github.com/microsoft/autogen
- LangGraph: https://github.com/langchain-ai/langgraph and https://docs.langchain.com/oss/python/langgraph/overview
- CrewAI: https://docs.crewai.com/concepts/agents
Research appendix (decision-focused)
agentapigives direct control-plane strengths for long-lived terminal sessions:/message,/messages,/status,/events- MCP and Agent2Agent are on roadmap, so native protocol parity is not yet guaranteed.
cliproxyapi++gives production proxy strengths for model-plane demands:- OpenAI-compatible
/v1surface expected by most clients - provider fallback/routing logic under one auth and config envelope
- OAuth/session-heavy providers with refresh workflows (Copilot, Kiro, etc.)
- OpenAI-compatible
- For projects that mix command-line agents with OpenAI-style tooling,
agentapi+cliproxyapi++is the least disruptive tandem:- keep one stable model ingress (
/v1/*) for downstream clients - route agent orchestration through
/messageand/events - centralize auth/rate-limit policy in the proxy side, and process-level isolation on control-plane side.
- keep one stable model ingress (
Alternatives evaluated
Go with
agentapionly- Pros: fewer moving parts.
- Cons: you inherit provider-specific auth/session complexity that
cliproxyapi++already hardened.
Go with
cliproxyapi++only- Pros: strong provider abstraction and OpenAI compatibility.
- Cons: missing built-in terminal session lifecycle orchestration of
/message//events.
Replace with LangGraph or OpenAI Agents SDK
- Pros: strong graph/stateful workflows and OpenAI-native ergonomics.
- Cons: meaningful migration for existing CLI-first workflows and provider idiosyncrasies.
Replace with CrewAI or AutoGen
- Pros: flexible multi-agent frameworks and role/task orchestration.
- Cons: additional abstraction layer to preserve existing CLIs and local session behavior.
Protocol-first rewrite (MCP/A2A-first)
- Pros: long-run interoperability.
- Cons: both
agentapiprotocol coverage and our local integrations are still evolutionary, so this is best as a v2 flag.
Recommended near-term stance
- Keep the tandem architecture and make it explicit via:
- an orchestrator service,
- policy-shared auth and observability,
- adapter contracts for
message-style control and/v1model calls, - one shared correlation-id across both services for auditability.
- Use phase-gate adoption:
- Phase 1: local smoke on
/message+/v1/models - Phase 2: chaos/perf test with provider failover + session resume
- Phase 3: optional MCP/A2A compatibility layer behind flags.
- Phase 1: local smoke on
Full research inventory (2026-02-22)
I pulled all https://github.com/orgs/coder/repositories payload and measured the full coder-org working set directly:
- Total repos: 203
- Archived repos: 19
- Active repos: 184
updated_atwithin ~365 days: 163- Language distribution top: Go (76), TypeScript (25), Shell (16), HCL (11), Python (5), Rust (4)
- Dominant topics: ai, ide, coder, go, vscode, golang
Raw inventories (generated artifacts)
/tmp/coder_org_repos_203.json: full payload with index, full_name, language, stars, forks, archived, updated_at, topics, description/tmp/coder_org_203.md: rendered table view of all 203 repos/tmp/relative_top60.md: top 60 adjacent/relative repos by recency/star signal from GitHub search
Local generation command used:
python - <<'PY'
import json, requests
rows = []
for page in range(1, 6):
data = requests.get(
"https://api.github.com/orgs/coder/repos",
params={"per_page": 100, "page": page, "type": "all"},
headers={"User-Agent": "codex-research"},
).json()
if not data:
break
rows.extend(data)
payload = [
{
"idx": i + 1,
"full_name": r["full_name"],
"html_url": r["html_url"],
"language": r["language"],
"stars": r["stargazers_count"],
"forks": r["forks_count"],
"archived": r["archived"],
"updated_at": r["updated_at"],
"topics": ",".join(r.get("topics") or []),
"description": r["description"],
}
for i, r in enumerate(rows)
]
open("coder_org_repos_203.json", "w", encoding="utf-8").write(json.dumps(payload, indent=2))
PY
PYTop 20 coder repos by stars (for your stack triage)
coder/code-server(76,331 stars, TypeScript)coder/coder(12,286 stars, Go)coder/sshcode(5,715 stars, Go)coder/websocket(4,975 stars, Go)coder/claudecode.nvim(2,075 stars, Lua)coder/ghostty-web(1,852 stars, TypeScript)coder/wush(1,413 stars, Go)coder/agentapi(1,215 stars, Go)coder/mux(1,200 stars, TypeScript)coder/deploy-code-server(980 stars, Shell)
Top 60 additional relative repos (external, adjacent relevance)
langgenius/difyx1xhlol/system-prompts-and-models-of-ai-toolsinfiniflow/ragflowlobehub/lobehubdair-ai/Prompt-Engineering-GuideOpenHands/OpenHandshiyouga/LlamaFactoryFoundationAgents/MetaGPTunslothai/unslothhuginn/huginnmicrosoft/monaco-editorjeecgboot/JeecgBoot2noise/ChatTTSalibaba/arthasreworkd/AgentGPT1Panel-dev/1Panelalibaba/nacoskhoj-ai/khojcontinuedev/continueTauricResearch/TradingAgentsVSCodium/vscodiumfeder-cr/Jobs_Applier_AI_Agent_AIHawkCopilotKit/CopilotKitviatsko/awesome-vscodevoideditor/voidbytedance/UI-TARS-desktopNvChad/NvChadlabring/FastGPTdatawhalechina/happy-llme2b-dev/awesome-ai-agentsassafelovic/gpt-researcherdeepset-ai/haystackzai-org/Open-AutoGLMconwnet/github1svanna-ai/vannaBloopAI/vibe-kanbandatawhalechina/hello-agentsoraios/serenaqax-os/excelize1Panel-dev/MaxKBbytedance/deer-flowcoze-dev/coze-studioLunarVim/LunarVimcamel-ai/owlSWE-agent/SWE-agentdzhng/deep-researchAlibaba-NLP/DeepResearchgoogle/adk-pythonelizaOS/elizaNirDiamant/agents-towards-productionshareAI-lab/learn-claude-codeAstrBotDevs/AstrBotAccumulateMore/CVfoambubble/foamgraphql/graphiqlagentscope-ai/agentscopecamel-ai/camelVectifyAI/PageIndexKilo-Org/kilocodelangbot-app/LangBot