Home/Guides/OpenAI Codex explained

What OpenAI Codex is, and how to run a Codex agent 24/7

Codex is OpenAI's open-source command-line coding agent. In a terminal it works with you: it reads a repository, runs commands, and edits files while you watch. Its non-interactive mode, codex exec, takes one task, runs it to completion, and exits, and that is what turns it from a pair programmer into an agent that can work on a clock. This page covers what Codex is, what running it unattended takes, and where it can live.

Start free trialRead docs

By David SilvaPublished

Direct answer

What is OpenAI Codex, and can it run 24/7?

OpenAI Codex is OpenAI's open-source command-line coding agent. It reads files, runs commands, and edits a working tree, and codex exec runs a task without anyone at the keyboard. To run it 24/7 it needs a persistent machine with the repository, the tools it shells out to, and a model key or a ChatGPT sign-in, plus something to start each run: your own server with a scheduler, or managed hosting such as Qoren, which runs Codex alongside OpenClaw and Hermes.

Codex deployment options

OptionOperations burdenBest fit
Local machineYou keep the terminal open, the machine awake, and tools installed.Interactive coding sessions and quick experiments.
VPSYou own the OS, runtime, tools, scheduler, secrets, updates, and recovery.Developers who want full host control.
Managed hostingThe provider operates the environment; you set the agent and its rules.Always-on Codex agents without infrastructure work.

What OpenAI Codex is

Codex is a coding agent that runs in your terminal. Unlike a chat model, it acts on a real filesystem: it reads the code in front of it, runs the commands it needs, and writes changes to the working tree. That makes it a good fit for code-shaped jobs and a different hosting problem from a chat agent, because the machine it runs on has to hold the repository, the tools, and the credentials.

  • Open source, published by OpenAI on GitHub.
  • Works against a real working tree: read, run, edit.
  • Signs in with a ChatGPT plan or runs on a model API key.
  • Interactive in a terminal, or non-interactive through codex exec.

Sources: OpenAI Codex on GitHub

Interactive sessions vs unattended runs

Interactive Codex lives as long as your terminal does. Close the laptop and the session ends. codex exec is the unattended path: a scheduler, a webhook handler, or another program hands it a task, it works through the task in the repository, and it exits with a result. On a server, running it on a clock means pairing codex exec with something that starts it, such as cron or a webhook handler.

What running Codex 24/7 takes

A Codex agent that works while you are away needs more than a process and a key, because it executes commands and keeps state on disk.

  • A machine that never sleeps, with a persistent filesystem so work carries across runs.
  • The repository and the tools Codex shells out to, installed and kept current.
  • Credentials: a ChatGPT sign-in or a model key, plus scoped source access.
  • Something that starts each run: a cron job, a webhook, or a platform scheduler.
  • Isolation, so its commands never touch anything you did not scope, and a spend limit.

Three places a Codex agent can live

Like any agent runtime, Codex can run on your own machine, on a server you operate, or on a managed platform. The difference is who owns the upkeep.

  • Your laptop: best for interactive sessions and experiments; nothing runs once the lid closes.
  • Your own VPS: codex exec plus cron or a webhook handler keeps it working, and you own the OS, tools, secrets, updates, and recovery.
  • Managed hosting: the environment, isolation, and uptime are operated for you. The managed Codex hosting page covers what Qoren includes and what it costs.

What to decide before deploying a Codex agent

A Codex deployment goes smoothly when the operating contract is settled before the agent goes live, because this runtime can read, write, and run commands.

  • Model access: a managed key, your own key, or a ChatGPT sign-in.
  • Source access: which repositories or files the agent may read and change.
  • Tool and command permissions, scoped to least privilege.
  • Persistent workspace, spend limits, and where a human reviews the output.

When not to use Qoren for Codex

Qoren is not the right answer for every Codex user. If you want a free local experiment, offline use, or full control over every host-level setting, running the Codex CLI locally or on your own VPS may fit better. Qoren is for keeping a Codex agent online and operated for you.

Frequently asked questions

What is codex exec?

The non-interactive mode of the Codex CLI. It takes a task, runs it to completion against the working tree, and exits, so a scheduler, a webhook, or another program can start it without anyone at the keyboard. Qoren runs Codex agents through codex exec, one run per message or task.

Does Qoren replace the Codex CLI?

No. Qoren is a managed hosting and operations layer for running Codex agents online. The OpenAI Codex CLI remains the runtime you are deploying; Qoren gives it a durable place to run and keeps it online.

Do I need Docker or a VPS to run Codex on Qoren?

No. The point of Qoren is to run your Codex agent without you managing Docker, a VPS, or server updates. You configure the agent from the dashboard rather than over SSH.

Can I bring my own model key for Codex?

Yes. On Qoren you can use the managed model key, which draws on your plan's credits and stops at a hard cap, or bring your own OpenRouter key on any plan, which OpenRouter bills directly with no managed usage cap. A Codex agent can also sign in to your ChatGPT account and run on that plan.

What can a hosted Codex agent access?

Only what you scope: the source it may read or change, the tools it may run, and the secrets you provision. Access is yours to set, and least privilege is the recommended default for a runtime that executes commands.

Run OpenClaw, Hermes or Codex agents 24/7, without the homework.

Qoren runs the machine, the secrets, the updates and the logs, with a hard cap on credit spend. Start from a template and have an agent working today.