Skip to content

[WIP] Create workflow to bill Codex subscription instead of API key#16718

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/create-codex-subscription-workflow
Closed

[WIP] Create workflow to bill Codex subscription instead of API key#16718
Copilot wants to merge 1 commit intomainfrom
copilot/create-codex-subscription-workflow

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original prompt

This section details on the original issue you should resolve

<issue_title>Create a workflow that bills the Codex subscription instead of API key</issue_title>
<issue_description>How to create a workflow such that it bills against a Codex monthly subscription (e.g. chatgpt plus or pro) instead of a codex API key?</issue_description>

<agent_instructions> This mirrors how Claude already supports dual auth (ANTHROPIC_API_KEY + CLAUDE_CODE_OAUTH_TOKEN).

Approach

Add a new secret CODEX_CHATGPT_REFRESH_TOKEN. When provided, the workflow writes ~/.codex/auth.json with the ChatGPT auth mode and unsets the API key env vars so Codex uses subscription billing instead.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@pelikhan Please do a deep research on this topic including docs and integration guides. @Mossaka Let me take a look at this issue @Mossaka It looks like we need to support a new environment variable `CODEX_CHATGPT_REFRESH_TOKEN.` so Codex uses subscription billing instead

Custom agent used: developer.instructions
Developer Instructions for GitHub Agentic Workflows


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a workflow that bills the Codex subscription instead of API key

3 participants