Experimental Codex subscription support
ChemGraph can experimentally use the official Codex Python SDK with the
ChatGPT-backed login already used by Codex CLI or the Codex IDE extension. This
path does not use the OpenAI Platform API or OPENAI_API_KEY.
Install and authenticate
1. Install the Codex CLI
The openai-codex Python package provides the SDK and its internal runtime,
but it does not install a codex command on your shell PATH. Follow the
official Codex CLI installation guide,
then verify that the command is available:
2. Install the ChemGraph Codex extra
For a package installation:
For an editable source checkout, install the extra into the active environment:
3. Authenticate with ChatGPT
Use the separately installed CLI to authenticate Codex with ChatGPT:
The active login must be a ChatGPT login. ChemGraph deliberately rejects a Codex session authenticated with an API key instead of silently falling back to usage-based OpenAI Platform billing.
Run ChemGraph
Prefix a model available to your Codex account with codex::
chemgraph \
--model "codex:<codex-model-id>" \
--workflow single_agent \
--query "What is the SMILES string for aspirin?"
The same model syntax works through the Python API:
from chemgraph import ChemGraph
agent = ChemGraph(
model_name="codex:<codex-model-id>",
workflow_type="single_agent",
)
Current limitations
- Only the
single_agentworkflow is supported. - The integration is experimental and pins
openai-codex==0.144.4together with that SDK's bundled Codex runtime. - ChemGraph starts ephemeral, read-only Codex threads. ChemGraph's LangGraph workflow executes chemistry tools; Codex is used only for model decisions.
- ChemGraph does not start a login flow. Run
codex loginbefore initializing acodex:model.
See the official Codex SDK documentation, Codex CLI installation guide, and authentication guide for supported installation and account behavior.