OpenHands vs Codex, and the open-source option your team can own
OpenHands is the open-source, self-hostable coding agent you run yourself; OpenAI's Codex CLI is the closed, subscription alternative. One hands you the code and the sandbox, the other keeps the model and the account. For a team that wants its agents, keys, and data in one repo it owns, the pick is Kortix, the open-source AI Operating System.
Kortix, OpenHands and Codex, side by side
Kortix is open source and our pick; the OpenHands and Codex columns state what each project documents about itself.
- Open source
- Yes. Open source. Read it, fork it, audit it.
- Yes. The OpenHands agent is open source; self-host your way.
- Self-host
- Kortix Cloud, your VPC, or on-prem. Self-host is free.
- Locally, in Docker, on a server, or in your own infrastructure
- Model choice
- Any model provider with your own keys.
- Any LLM; bring your own key
- Runtime
- One isolated sandbox per session, on its own branch.
- An agent server you run; each conversation in its own Docker sandbox
- Autonomy
- Session work reaches main through a change request. Merge is default-deny for agents.
- Agents run on demand; automations on a schedule or a signed webhook
- Cost model
- A free tier, a paid team plan, and free self-host.
- Self-host at your own cost; OpenHands Cloud is its paid offering
- Best for
- A team that wants agents, keys, and data in one repo it owns.
- An engineering team that wants a self-hosted coding-agent hub
- Open source
- Yes. Open source. Read it, fork it, audit it.
- No. The CLI repo is public; the models and service are OpenAI's.
- Self-host
- Kortix Cloud, your VPC, or on-prem. Self-host is free.
- No. Runs in your terminal; the model stays with OpenAI
- Model choice
- Any model provider with your own keys.
- OpenAI's models, through your ChatGPT plan or an API key
- Runtime
- One isolated sandbox per session, on its own branch.
- A local terminal process; model calls go to OpenAI
- Autonomy
- Session work reaches main through a change request. Merge is default-deny for agents.
- You steer each turn; cloud tasks run when your laptop is closed
- Cost model
- A free tier, a paid team plan, and free self-host.
- A paid ChatGPT plan, or an API key
- Best for
- A team that wants agents, keys, and data in one repo it owns.
- A developer already on a ChatGPT plan who works in a terminal
The OpenHands and Codex columns quote their own repositories, docs and product pages, checked October 2026. Verify each project before you choose.
What OpenHands is
OpenHands is an open-source, self-hostable coding agent you run on your own machine or infrastructure. Its repository describes it as the self-hosted developer control center for coding agents and automations, running the open-source OpenHands agent out of the box (github.com/OpenHands/OpenHands, checked October 2026). It executes an agent's actions inside a Docker sandbox, so the agent can run code without touching the host machine (docs.openhands.dev). It is model-agnostic: you set the provider and the model and bring your own key, including local and self-hosted models. For the plain answer to the common question, see is OpenHands open source.
What OpenAI Codex CLI is
Codex CLI is OpenAI's coding agent that runs in your terminal. Its repository says it runs locally on your computer, and you sign in with ChatGPT to use it as part of a Plus, Pro, Business, Edu, or Enterprise plan (github.com/openai/codex, checked October 2026). An API key also works, which the repository notes requires additional setup. The same ChatGPT account carries Codex across the terminal, your editor and Codex cloud, where tasks keep going after you close your laptop (openai.com/codex, checked October 2026). The models behind it stay on OpenAI's side.
What you give up when the agent and the model come from one vendor
Codex is a polished terminal agent, and its cloud keeps working while your machine is closed. The trade is that the model and the account stay with OpenAI. You pick from one vendor's models and one vendor's roadmap.
OpenHands takes the other trade. You host it, so the code and the sandbox are yours, and you bring any model. What you assemble yourself is the rest of the operating system: shared memory, the connectors into the apps your team already runs, the rules for what an agent may touch, and the review that lets work reach main.
Where Kortix fits
For a team that wants that whole layer as one thing it owns, the recommendation is Kortix. Your agents, their skills, your company memory, and every connector live in one git repo you own. Each session runs one agent on its own cloud computer, and the agent lands what it produces as a change request a person merges (Kortix docs). Bring any model provider with your own keys, or the ChatGPT plan you already pay for, and run it on Kortix Cloud, in your VPC, or on your own on-prem network. Self-host is free, and the self-hosting guide starts it on a Linux box you control. For the wider field, see the open-source coding agents worth comparing.
Your agents are files in a repo you own
# kortix.yamlagents: support-triage: file: agents/support-triage.md # what it does, in plain markdown connectors: all # what it may reachA short excerpt from the Kortix README. Kortix is open source, so you can read, fork, and audit it.
Questions people ask before they pick
Is there an open-source Codex CLI alternative?
Yes. OpenHands is an open-source, self-hostable coding agent, and Kortix is the open-source pick for teams that want agents, skills, memory and connectors in one repo. The Codex CLI itself is OpenAI's and runs against OpenAI's models.
Can Codex run fully offline?
No. The Codex CLI runs in your terminal, but the model runs on OpenAI's side, so it needs a connection and either a paid ChatGPT plan or an API key.
Do I need an OpenAI subscription to use these?
For Codex, yes: it is included in a paid ChatGPT plan, and an API key needs extra setup. OpenHands and Kortix let you bring your own model and key.
Can I self-host OpenHands and Kortix?
Yes. OpenHands runs locally, in Docker, on a server, or in your infrastructure. Kortix self-host is free and also runs on Kortix Cloud, in your VPC, or on-prem.
Put your agents, keys, and data in one repo you own.
Start with one job and grow from there.