Skip to content

ellmercodex

0.2.0Package record

'ChatGPT' Plan Provider for 'ellmer'

0packages depend
107downloads / year
40.2%test coverage
12/12flavors OK

Overview

About

Connects 'ellmer' chats to a 'ChatGPT' subscription through 'OpenAI''s documented "Sign in with ChatGPT" flow for open-source, locally hosted apps https://developers.openai.com/siwc/token-sharing-open-source. Provides a stable, explicitly bounded core of the public 'ellmer' (>= 0.5.0) Chat object, including browser sign-in with dynamic client registration, package-scoped credential storage, redacted diagnostics, multi-turn text, streaming, structured-output, function-tool, asynchronous, cancellation, cloning, metadata, multimodal chat, account-specific model discovery, and reasoning-effort selection through the public 'Responses' API. Parallel and batch helper functions are explicitly unsupported because 'ChatGPT' plan usage is stream-only. This independent third-party integration is not endorsed by 'OpenAI'.

Changes in 0.2.0

Breaking changes: documented "Sign in with ChatGPT" flow

  • Authentication now follows OpenAI's documented "Sign in with ChatGPT" flow for open-source, locally hosted apps (<https://developers.openai.com/siwc/token-sharing-open-source>). The package no longer reuses the Codex CLI OAuth client or calls the undocumented chatgpt.com/backend-api/codex endpoints. **Existing credentials cannot be migrated: run codex_login() again.**
  • codex_login() registers dynamically with client_id=dynamic_agent_client, stores the client ID that OpenAI issues for the chosen account and workspace, and reauthorizes that registration on later sign-ins. It sends a stable ext_agent_host_id, created once per host, and uses PKCE and a nonce. The ID token is verified against OpenAI's published keys, and sign-in fails with the new codex_plan_scope_error when ChatGPT plan usage (chatgpt.tokens.use.direct) is not granted. The package now imports jose for ID token verification.
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
  • The OAuth callback moved from http://localhost:1455/auth/callback to http://127.0.0.1:1455/callback, as the documentation requires. Set ELLMERCODEX_CALLBACK_PORT to use another port.
  • Credentials moved from httr2's OAuth cache to a package-owned credentials.json (mode 0600, atomic writes) in tools::R_user_dir("ellmercodex", "config"), or in the directory named by ELLMERCODEX_HOME. HTTR2_OAUTH_CACHE no longer applies. Refreshes are serialized across R processes because refresh tokens rotate.
  • codex_logout() gains revoke = TRUE and now revokes the refresh token with OpenAI before deleting the local credential. It also removes the old httr2 cache entry. To switch account or workspace, log out and sign in again.
  • Chats and codex_models() use the public https://api.openai.com/v1 Responses and Models endpoints with only the bearer token; the ChatGPT-Account-Id, OpenAI-Beta, and originator headers are gone. codex_models() keeps models with visibility: "list", and its client_version argument is deprecated and ignored (ELLMERCODEX_CLIENT_VERSION is no longer read).
  • Requests follow the ChatGPT plan usage preview limits: system prompts are sent as developer messages, function tools are grouped in an ellmer namespace, and temperature, top_p, max_tokens, metadata, previous_response_id, and the other excluded Responses arguments now fail with codex_chat_argument_error before a request is sent.
  • A response.incomplete event now fails a Chat turn with codex_incomplete_error instead of returning a truncated turn.
  • Documented plan error codes map to new subclasses that keep the existing parents: codex_usage_limit_error (a codex_rate_limit_error), codex_usage_unavailable_error (a codex_server_error), codex_plan_ineligible_error (a codex_authentication_error), and codex_unsupported_capability_error (a codex_malformed_request_error). Synchronous chats now raise these package conditions, rather than httr2 errors, for HTTP failures before the stream opens.

Other changes

  • Codex generation requests no longer inherit ellmer's automatic retries, as documented in the technical design: a retried request could duplicate a generation the service already accepted.
  • Codex requests and turn costs are now built without five unexported ellmer helpers, reducing the private ellmer surface ahead of a CRAN submission.
  • chat_codex() now accepts explicitly selected models omitted from the account catalog. The service validates those model IDs and reasoning efforts.

From NEWS.md in the release

Install

Health

CRAN checks
12OK
Slowest check: 2.3 min · r-release-macos-x86_64
Status changes
  • OK12 OKNow
  • OK7 OK2026-10-17
Advisories

none known

Documentation

In release 0.2.0
READMEYes · 1,581 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 0.2.0Citation fileNoWebsitenot declared in DESCRIPTION
Help pages
9 (1 internal)includes a package overview page
Examples that run
100%7 run in a plain check (5 of them under a condition)
Exported functions with examples
100%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
0%

Downloads

107
CRAN downloads in the past year
Rank #25,547 · ~0/day · ~9/mo
ellmercodex
Daily download trend is not available in this view yet.
10730 days
10790 days
1071 year
Compare downloads with other packages →

Repository

3Stars
0Forks
0Open issues
0Open PRs
12Releases
43Commits
1Commit identities
43 commits · Last activity 2026-10-18
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
2
Median days to close, 50 most recently updated closed PRs
0

Commits over time

2026-10-18 · 372026-10-20 · 43
PracticesBeta

5 development-tooling and community-health practices detected across 4 families in the upstream repository

Checks run against github.com/simxnherrera/ellmercodex on 2026-10-18.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

CRAN release process (1)
cran-comments.md
Lint, format, editor (1)
lintr
Git structural (1)
.gitattributes
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-10-06
    Pull request it wrote: opened by a project member
    Commits: at least 10 crediting it in the message
Models named in its commits
  • Claude Opus 5.510 commits · Oct 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
16 external dependencies (excludes base and recommended)

Installing ellmercodex adds 28 packages (17 with compiled code, 18 MB of source tarballs). Heaviest: promises 3.1 MB, ellmer 3.0 MB, Rcpp 1.8 MB.

Depends (1)
R >= 4.1.0
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (1)
Author, Maintainer since 0.2.0 (2026), Copyright holder
Releases (1)
  • 0.2.0Latest
    2026-10-16 · current release ·
    9 days in CRAN's queue
    Listed in CRAN's incoming queue from 2026-10-06 20:42 to 2026-10-16 07:45 UTC, in 44 readings.
  • R
    R 4.6.0 released · 2026-04-24
Across CRAN, the median accepted release of the past year spent 23 hours in the queue, 90% under 11 days.How queue time is measured

Package metadata

First published
2026-10-16
Total releases
1 / 1 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.1.0
Download size
446 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("ellmercodex")
Herrera, S. (2026). ellmercodex: 'ChatGPT' Plan Provider for 'ellmer' (Version 0.2.0) [Computer software]. https://doi.org/10.32614/CRAN.package.ellmercodex

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for ellmercodex version 0.2.0 [Data set]. HJJB, LLC. Data release v2026-10-21. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy