Access OpenAI models via a Codex subscription
Project description
llm-openai-codex
LLM plugin for accessing ChatGPT/Codex-backed OpenAI models through the Responses API.
Fork of Simon Willison's llm-openai-via-codex with a codex/ model prefix, plugin-owned auth, llm codex commands, verbosity, and OpenAI's server-side web_search tool.
Changes from the original plugin
- Package renamed to
llm-openai-codex. - Model prefix changed to
codex/. - Plugin-owned auth is stored in LLM's user config directory as
auth-codex.json, with borrowed fallback to${CODEX_HOME:-~/.codex}/auth.json. llm codexauth commands manage login, import, status, refresh, and logout.- Explicit
verbosityoption maps to Responses APItext.verbosity. - Extra Responses API options are forwarded when LLM accepts them.
- Missing
account_idvalues are derived from OAuth JWT claims when possible. - Added
llm codex usageshowing current Codex plan usage. - Registers known hidden/fallback Codex models such as
gpt-5.3-codex-spark. - Added OpenAI's server-side
web_searchtool via-o web_search 1.
Installation
Install this plugin in the same environment as LLM.
llm install llm-openai-codex
Usage
Authenticate the plugin:
llm codex login [--device-code]
If you already use Codex CLI, the plugin can fall back to ${CODEX_HOME:-~/.codex}/auth.json when auth-codex.json does not exist. You can also copy those tokens into plugin-owned auth with llm codex import.
List available Codex-backed models:
llm models -q codex
Models are discovered from the Codex API, plus known hidden/fallback slugs such as gpt-5.3-codex-spark. Some listed fallback models may still fail at request time if your plan lacks access.
Run a prompt:
llm -m codex/gpt-5.3-codex-spark "Hello"
Use Responses API verbosity:
llm -m codex/gpt-5.3-codex-spark -o verbosity low "Summarize this"
Web search
Enable OpenAI's server-side web_search tool (the search runs on OpenAI's servers, not locally):
llm -m codex/gpt-5.5 -o web_search 1 "What happened in AI news today?"
llm -m codex/gpt-5.5 -o web_search 1 -o web_search_live 1 "Latest stable Python release?"
llm -m codex/gpt-5.5 -o web_search 1 -o web_search_context_size high "Summarize recent LLM benchmarks"
web_search_live requests live internet access instead of the cached index; web_search_context_size is one of low, medium, high. Availability depends on your plan and model.
To enable web search by default for a given model, use LLM's per-model default options:
llm models options set codex/gpt-5.5 web_search 1
Auth commands
llm codex login
llm codex login --device-code
llm codex status
llm codex refresh
llm codex refresh --borrowed
llm codex usage
llm codex import
llm codex logout
Auth source order:
- Plugin-owned
auth-codex.json - Borrowed Codex CLI auth at
${CODEX_HOME:-~/.codex}/auth.json
llm codex import copies ChatGPT OAuth tokens from Codex CLI auth into plugin-owned auth-codex.json. It refuses to overwrite an existing auth-codex.json; run llm codex logout first if you want to replace plugin-owned auth.
Refresh behavior
- Plugin-owned auth refreshes lazily and on demand via
llm codex refresh. - Borrowed Codex CLI auth never refreshes automatically. When it expires, pick one:
llm codex refresh --borrowed— refresh the shared file in place. Rotates the sharedrefresh_token; restart any running Codex CLI session afterwards.- Run Codex CLI itself to refresh.
llm codex importto promote it to plugin-owned auth.
llm codex status shows which auth source is active.
When authentication is missing or expired, run llm codex login [--device-code] or llm codex import.
Development
uv run pytest
uv run llm plugins
uv run llm codex status
Releasing
- Bump
versioninpyproject.toml(PEP 440, novprefix, e.g.0.2.4). - Commit, then tag with a
vprefix and push:git tag v0.2.4 && git push origin v0.2.4
- Publish a GitHub Release for that tag (
gh release create v0.2.4 --generate-notes). This triggers.github/workflows/publish.ymlto test and publish to PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_openai_codex-0.3.0.tar.gz.
File metadata
- Download URL: llm_openai_codex-0.3.0.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7f08e38a4e91bb21e9ffa239344999231308cadfed62559dff38b6b38bbfd18
|
|
| MD5 |
1c543d7a22dffa037e7472ad5a8bb353
|
|
| BLAKE2b-256 |
848708694c7318876687bb1d1f030c2fa102de2b31a4286f2252efbb564b9d27
|
Provenance
The following attestation bundles were made for llm_openai_codex-0.3.0.tar.gz:
Publisher:
publish.yml on rdslw/llm-openai-codex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_openai_codex-0.3.0.tar.gz -
Subject digest:
c7f08e38a4e91bb21e9ffa239344999231308cadfed62559dff38b6b38bbfd18 - Sigstore transparency entry: 1725967747
- Sigstore integration time:
-
Permalink:
rdslw/llm-openai-codex@64051eb179b07cb14eee31a5b581578d166ac37b -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/rdslw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@64051eb179b07cb14eee31a5b581578d166ac37b -
Trigger Event:
release
-
Statement type:
File details
Details for the file llm_openai_codex-0.3.0-py3-none-any.whl.
File metadata
- Download URL: llm_openai_codex-0.3.0-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd27da04694225c4c70315f4f93d0f3fe97bc270a902be4811cd2ca93c4c5d1a
|
|
| MD5 |
ba3b78909d5f8feb699a230763a17ca9
|
|
| BLAKE2b-256 |
8b5d8937252bbee1e30f6c79ce19f21840bf8da69849647d8c6525b8ddcae70a
|
Provenance
The following attestation bundles were made for llm_openai_codex-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on rdslw/llm-openai-codex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_openai_codex-0.3.0-py3-none-any.whl -
Subject digest:
cd27da04694225c4c70315f4f93d0f3fe97bc270a902be4811cd2ca93c4c5d1a - Sigstore transparency entry: 1725970072
- Sigstore integration time:
-
Permalink:
rdslw/llm-openai-codex@64051eb179b07cb14eee31a5b581578d166ac37b -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/rdslw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@64051eb179b07cb14eee31a5b581578d166ac37b -
Trigger Event:
release
-
Statement type: