Skip to main content

llm-chatgpt-plan

llm-chatgpt-plan: an LLM plugin that uses your ChatGPT plan through Sign in with ChatGPT OAuth.

No OpenAI API key is needed. The plugin signs in with your ChatGPT account, stores the OAuth credentials locally, and calls the Responses API within your plan's usage allowance.

Supported platforms: macOS and Linux (the credential lock uses fcntl).

Installation

Install this plugin into the same environment as llm:

llm install llm-chatgpt-plan

Or from a checkout of this repository:

llm install -e /path/to/sign-in-with-chatgpt-py/llm-chatgpt-plan

Usage

Sign in once. A browser opens for ChatGPT sign-in and plan approval:

llm chatgpt-plan login

This fetches your account's model list and saves it. List the saved models (any model llm sees is also registered as chatgpt-plan/<slug>):

llm chatgpt-plan models
llm models

Fetch the model list again (also refreshes the access token if needed):

llm chatgpt-plan models --refresh

Send a prompt — answers stream to stdout:

llm -m chatgpt-plan/gpt-5.6-luna 'Say hello'

A system prompt (-s) is sent to the Responses API as instructions:

llm -m chatgpt-plan/gpt-5.6-luna -s 'Answer concisely in Japanese' 'What is OAuth?'

Request a reasoning effort with -o reasoning_effort (for example none, minimal, low, medium, high, xhigh, max). Which values a model accepts depends on the model; unsupported values return the API's error. When omitted, no reasoning field is sent and the model's default applies:

llm -m chatgpt-plan/gpt-5.6-luna -o reasoning_effort low 'What is OAuth?'

What is stored

State lives in a chatgpt-plan directory inside the LLM user directory — the directory that contains the logs.db shown by llm logs path:

  • credentials.json — issued client ID, verified subject/issuer, access and refresh tokens, granted scopes, expiry (mode 0600)
  • host.json — a persistent host ID sent during dynamic client registration
  • models.json — the cached model list, tied to the connection's client ID and subject
  • runtime.lock — serializes updates between processes

One connection is active at a time. To switch to a different account or workspace, run llm chatgpt-plan login --replace, which only replaces the saved connection after the new sign-in verifies.

Access tokens are refreshed automatically when they are about to expire, and the rotated credentials are saved atomically. If the refresh token has expired or was revoked, sign in again with llm chatgpt-plan login. For temporary network, rate-limit, or server errors, retry later; the saved connection is kept.

Limitations of this first version

These are rejected with a clear error instead of being silently ignored:

  • Non-streaming requests (--no-stream): this route requires streaming
  • Conversation history: single prompts only — llm chat works only for the first message of a conversation; -c/--cid continuation is not supported
  • Attachments, tools, tool results, and structured output (--schema)
  • Multiple saved accounts and logout

llm still records prompts and responses in its local log database as usual. That local logging is separate from the store=False flag sent to the API, which asks OpenAI not to store the request server-side.

Usage allowance errors (subscription_sharing_usage_limit_exceeded / subscription_sharing_usage_unavailable) point to your ChatGPT usage settings: https://chatgpt.com/settings/usage

Disconnecting

There is no logout command. To revoke this plugin's access, use ChatGPT → Settings → Security and login → Sign in with ChatGPT, then delete the chatgpt-plan directory inside the LLM user directory.

Reference scripts

../scripts/auth.py and ../scripts/ask.py are the original standalone reference implementation (PEP 723 scripts, run with uv run). They keep their own credential storage under scripts/.chatgpt-script and are not shared with the plugin.

Development

cd llm-chatgpt-plan  # from the repository root
uv run pytest    # mock-HTTP tests, no real credentials needed
uv run ruff check .

Tests use httpx.MockTransport, a test RSA key for JWKS/JWT verification, the Click test runner, and an isolated LLM_USER_PATH. They never touch real credentials.

Verified with llm 0.36, openai 3.21, httpx 0.28, PyJWT 2.15 on Python 3.14.

Releases

This package is released independently using tags named llm-chatgpt-plan-<version>. The version must match project.version in pyproject.toml; the first release tag is llm-chatgpt-plan-0.1.0.

Publishing a GitHub Release for a matching tag runs the tests, verifies the tag against the package version, builds this directory, and publishes its distributions to PyPI using the repository's release environment and Trusted Publishing. Releases for other packages are skipped. The PyPI Trusted Publisher must be configured for this repository, publish.yml, and the release environment before publishing.

Metadata

Release files for llm-chatgpt-plan 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-chatgpt-plan 0.1.0
File Size Uploaded Provenance Actions
llm_chatgpt_plan-0.1.0.tar.gz 32.7 kB With provenance Details for llm_chatgpt_plan-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llm-chatgpt-plan 0.1.0
File Interpreter ABI Platform Actions
llm_chatgpt_plan-0.1.0-py3-none-any.whl Python 3 none any Details for llm_chatgpt_plan-0.1.0-py3-none-any.whl

Total release size: 55.9 kB

Release files / llm_chatgpt_plan-0.1.0.tar.gz

Download URL llm_chatgpt_plan-0.1.0.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b45be035f557209e34ac1208990a21364eac69a59dec1d686f2d05ce4f6fb718
BLAKE2b-256 checksum
How to use checksums
93286897f7a3ca40bd2d9e0b29e37961e5b3f174b23ee3055792225b8d0ef018
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release files / llm_chatgpt_plan-0.1.0-py3-none-any.whl

Download URL llm_chatgpt_plan-0.1.0-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e3a91e94bb1d585e20a489d811cd9518e8697cffbed332bd781a06492f31fd9
BLAKE2b-256 checksum
How to use checksums
3cb4164afb3db659be71970c76eddbdf528503fce33b39407faa321c22f313c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Security for llm-chatgpt-plan 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for llm_chatgpt_plan-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page