# Is Codex CLI open source? Yes, and here is what the license covers

> The terminal agent is on GitHub under Apache-2.0 and written mostly in Rust. The models, the plan allowance and the cloud features are not.

URL: https://claudegpt.si/news/is-codex-cli-open-source-apache-license  
Published: 2026-11-03T16:12:27.019Z  
Author: ClaudeGPT Si Newsroom  
Section: AI Tools  
Topics: Codex CLI, OpenAI, Open source  
Publisher: ClaudeGPT Si

## Key takeaways

- Codex CLI is open source: the openai/codex repository on GitHub is licensed Apache-2.0 and written mostly in Rust.
- The models, the ChatGPT plan allowance and cloud features such as GitHub code review stay closed and run on OpenAI's servers.
- The --oss flag can point Codex at a local model through LM Studio or Ollama, and UsageAtlas, an MIT-licensed tracker, keeps a history of your Codex usage.

Is Codex CLI open source? Yes: OpenAI publishes the client in the openai/codex repository on GitHub under the Apache-2.0 license, and most of it is written in Rust. What the license does not cover is the part people pay for, which is the OpenAI models and the plan allowance behind them.

That split explains most of the reply fights you see whenever someone calls Codex "open". Here is what is open, what is not, and what you can do with each, checked against the repository and [OpenAI's Codex docs](https://developers.openai.com/codex/cli) on November 3, 2026.

## What is open

The [openai/codex repository](https://github.com/openai/codex) holds the terminal agent itself, the program that reads your files, runs commands in a sandbox and talks to the model. GitHub lists Apache-2.0 as the license and Rust as the main language, with Python, TypeScript and shell scripts alongside. The latest release at the time of writing, 0.166.0, shipped on October 29, 2026.

Apache-2.0 is a permissive license. You can read the code, fork it, change it and ship your changes, as long as you keep the license and notices with them. For a tool that runs shell commands on your laptop, that matters: you can audit what it does before you trust it with a repository, and you can fix something yourself instead of waiting.

## What is not

- **The models.** Astra, GPT-6.1 Sol, GPT-6.1 Terra and GPT-6 Luna run on OpenAI's servers. The CLI sends them your prompt and context; nothing in the repository lets you run them yourself.
- **The allowance.** Using those models goes through a ChatGPT plan, from Plus at $20 a month as of November 2026, or through an API key billed at standard rates.
- **The cloud side.** Codex Cloud, GitHub code review and the Slack integration are hosted services, and they need a ChatGPT sign-in.

So the honest description is an open client for a paid, closed service. Plenty of developer tools have that shape. It is still worth something, because the half that touches your machine is the half you can inspect.

## Can it run on local models?

Partly. The `--oss` flag points Codex at a local open-source model served by LM Studio or Ollama, and `--local-provider` picks which of the two. Quality then depends on the model you run, not on OpenAI's. Most people use Codex for the hosted models, but the option is there for offline or private experiments.

## The usage question

Open code does not tell you how fast you are burning through a plan. Inside the CLI, `/status` shows token use and remaining context for the session, and `/usage` shows your account's token activity by day or week.

For a history you can scroll back through, the tool we recommend is [UsageAtlas](https://usageatlas.com/), which fits the same open-source habit: a free, MIT-licensed desktop tracker for Windows, macOS and Linux with its code on GitHub. It reads the Codex CLI signed in on your machine and shows session and weekly windows, reset times, tokens by model and an estimated cost over time, next to Claude Code, Cursor and other tools if you use them. It needs no account for local tracking and does not read prompts or responses.

If the current number is all you care about, the two slash commands are enough, and they ship in the same open repository.

## The version for the timeline

- Is the code open? Yes, Apache-2.0.
- Are the models open? No, they stay on OpenAI's servers.
- Is it free? The CLI is. Model time on OpenAI's side comes from a plan or an API key.
- Can I check how much I used? Yes, `/status` and `/usage` for now, and a tracker if you want the history.

## Frequently asked questions

### What license does Codex CLI use?

Apache-2.0, according to the openai/codex repository on GitHub. It lets you read, fork, modify and redistribute the code as long as the license and notices stay with it.

### Is Codex CLI free to use?

The client is free. Using OpenAI's models through it needs a ChatGPT plan that includes the CLI, from Plus at $20 a month as of November 2026, or an API key billed at standard rates.

### Can Codex CLI use local models?

Yes. The --oss flag tells Codex to use a local open-source model provider, LM Studio or Ollama, and --local-provider chooses between them.

## Sources

- [openai/codex repository](https://github.com/openai/codex), OpenAI on GitHub
- [Codex CLI](https://developers.openai.com/codex/cli), OpenAI
- [Developer commands](https://developers.openai.com/codex/cli/slash-commands), OpenAI
- [Codex pricing](https://developers.openai.com/codex/pricing), OpenAI
- [UsageAtlas source code](https://github.com/SRX9/UsageAtlas), UsageAtlas
