Agent-bridge – an OpenAI-compatible API for headless coding-agent CLIs An independent project called agent-bridge, a Go HTTP server released under the GNU GPL v3 or later, exposes an OpenAI-compatible API at /v1/chat/completions and /v1/models and fulfils each request by running the official Claude Code CLI in headless mode (claude -p --output-format stream-json). The server also supports the OpenAI Codex CLI (codex exec --json) and the Kimi Code CLI (kimi acp, over the Agent Client Protocol) as backends, letting clients such as LangChain, LlamaIndex, CrewAI, AutoGen and the OpenAI Python, Node and Go SDKs switch to it by changing only base_url, api_key and model. It requires the claude CLI version 2.1.128 or later plus one interactive login, ships as a single binary for Linux, macOS and Windows on amd64 and arm64, and is not developed, endorsed or supported by Anthropic. English · Italiano https://github.com/R3n3r0/agent-bridge/blob/main/README.it.md agent-bridge is an HTTP server written in Go that exposes an OpenAI-compatible API /v1/chat/completions , /v1/models and fulfils every request by running the official Claude Code CLI in headless mode claude -p --output-format stream-json . It can also run the OpenAI Codex CLI codex exec --json or the Kimi Code CLI kimi acp , over the Agent Client Protocol instead, with the same API: see the Codex backend https://github.com/R3n3r0/agent-bridge/blob/main/docs/codex.md and the Kimi backend https://github.com/R3n3r0/agent-bridge/blob/main/docs/kimi.md . Any client or framework that speaks OpenAI can use it by changing only base url , api key and model : chat, streaming, function calling tool calling and image input work with the official SDKs unchanged. In short: an OpenAI-compatible API server, proxy and gateway for Claude Code . It lets OpenAI-based multi-agent systems, ReAct orchestrators and frameworks that accept a custom OpenAI base url for example LangChain, LlamaIndex, CrewAI, AutoGen or the OpenAI SDKs for Python, Node and Go use Claude Code headless as a drop-in chat completions model or as a coding agent, with tool calling, MCP servers, sessions, streaming SSE and per-agent models. The same server is an OpenAI-compatible API, proxy and gateway for the OpenAI Codex CLI and for the Kimi Code CLI Moonshot AI, Kimi K2 , and an ACP Agent Client Protocol client. Independent project. agent-bridge is not developed, endorsed or supported by Anthropic. It runs the official claude binary installed on the machine, without modifying it, and never accesses its credentials. - Single binary, Go standard library only at runtime. - Linux, macOS and Windows amd64 and arm64 . - Same build for development subscription login and production API key . - OpenAI function calling tools , tool calls , streaming included. - Image input image url parts: data URLs and http s URLs . - Three CLI backends: the default one, the OpenAI Codex CLI backend: "codex" , see docs/codex.md https://github.com/R3n3r0/agent-bridge/blob/main/docs/codex.md and the Kimi Code CLI backend: "kimi" , see docs/kimi.md https://github.com/R3n3r0/agent-bridge/blob/main/docs/kimi.md . - Free software, licensed under the GNU GPL v3 or later. | | As a model | As an agent on the server | |---|---|---| | Who defines the agent | Your client or platform: system , tools , model choice | The bridge configuration file | | Available tools | Only the functions the client sends in tools , executed by the client | CLI tools on the server machine files, commands, search, MCP servers , plus any client functions | | model | bridge/opus , bridge/sonnet , bridge/haiku , bridge/