chatgpt-codex-onboarding
Connect a ChatGPT or Codex subscription via OAuth device-code login. Use when the user wants to sign in with their ChatGPT Plus, Pro, or Team account (e.g. "use my Codex subscription", "log in with ChatGPT").
What this skill does
# ๐ ChatGPT / Codex OAuth Onboarding
Use the user's existing **ChatGPT or Codex subscription** for `gpt-5-codex`, `gpt-5`, `gpt-5-mini` access โ without an API key.
This is a **script-mode skill** โ no tools registered. Read this file, then call the exports from a `bash` block.
## See also
- `byok-custom-model` skill โ for vendor-key BYOK setup (DIFFERENT mechanism, NOT OAuth)
- `config/context/references/model-onboarding.md` โ overall model-selection landscape
---
## When to use this skill
โ
**Use** when the user EXPLICITLY says one of:
- "Sign in with my ChatGPT account"
- "Use my Codex subscription"
- "Connect my ChatGPT Plus / Pro / Team / Enterprise"
- "Login with OpenAI / ChatGPT"
โ **Do NOT use** for:
- BYOK / API-key-based setup ("Add OpenAI API key", "I have an OpenAI key")
- Other vendors that sound similar (Anthropic, Gemini, Qwen, etc.) โ use `byok-custom-model`
- "Add the OpenAI model" without subscription context โ ASK first whether they want OAuth (subscription) or BYOK (API key)
โ ๏ธ Vendor names that sound similar (Codex, OpenAI, GPT) are **NOT a signal** to start OAuth on their own. Only an explicit user mention of "subscription / sign in / login with ChatGPT" qualifies.
---
## Onboarding flow
1. **status** โ check if a credential already exists (resume vs fresh).
2. **start** โ get a verification URL + user code from OpenAI; persisted to disk.
3. Tell the user: open the URL in a browser, log in to their ChatGPT / Codex account, and enter the code. Do NOT auto-poll.
4. Wait for the user to confirm they approved the device.
5. **poll** โ finalize the OAuth handshake; on success, the new model becomes available.
If poll returns `status='pending'`, the user hasn't finished yet โ wait for them, then poll again. Don't loop poll automatically.
---
## Script usage
```bash
python3 - <<'EOF'
import sys, json
sys.path.insert(0, "/data/workspace/skills/chatgpt-codex-onboarding")
from exports import status, start, poll, logout, refresh, models, usage
# Check current state
print(json.dumps(status(), indent=2))
# Start a flow
result = start()
print(f"Open: {result['verification_url']}\nCode: {result['user_code']}")
EOF
```
After the user approves:
```bash
python3 - <<'EOF'
import sys, json
sys.path.insert(0, "/data/workspace/skills/chatgpt-codex-onboarding")
from exports import poll
print(json.dumps(poll(), indent=2))
EOF
```
---
## Functions
| Function | Required args | Purpose |
|---|---|---|
| `status()` | โ | Inspect current OAuth state, expiry, model list |
| `start()` | โ | Begin device-code flow โ verification_url + user_code |
| `poll(pending_id=None)` | โ | Check authorization (call after user confirms approval) |
| `logout()` | โ | Disconnect + remove credentials |
| `refresh()` | โ | Force-refresh access token (debug; normally automatic) |
| `models(force=False)` | โ | List available models from the OAuth endpoint |
| `usage(force=False)` | โ | Subscription usage stats |
`force=True` on `models` / `usage` bypasses the cache TTL.
All functions return a dict with `ok: True` on success or `ok: False, error: "..."` on failure.
---
## After connecting
When `poll()` returns `status='connected'`, the **first thing you must do** is tell the user:
> "Connection successful. Please refresh your browser page โ once it reloads, the new `openai-codex/*` models will appear in the model picker."
The web frontend caches the model list client-side and does not auto-refresh after an OAuth connect completes. Without a manual page refresh the user will not see their newly available models and will think the connection failed. Always include this instruction in your reply โ do not assume the picker updates on its own.
Models appear with the `openai-codex/` prefix:
- `openai-codex/gpt-5-codex` โ primary
- `openai-codex/gpt-5` โ full GPT-5
- `openai-codex/gpt-5-mini` โ smaller / faster
After refresh, the user switches via `/model openai-codex/gpt-5-codex` or the model picker UI.
Subsequent calls hit OpenAI directly using the OAuth token โ bypasses the platform proxy. Subscription usage limits apply (not the platform's credit balance).
---
## Reauth
Tokens auto-refresh via `refresh_token`. If a 401 surfaces:
1. `refresh()` โ try the manual refresh path.
2. If still failing, `logout()` + restart from `start()`.
---
## Critical rules
- **Never paste user_code in the verification_url.** They're separate โ user must enter the code manually after opening the URL.
- **Never start the flow without explicit user request.** "I want to use ChatGPT" is enough; "I have an OpenAI key" is NOT (that's BYOK).
- **Wait for user confirmation between `start` and `poll`.** Auto-polling wastes API calls and gives stale "pending" responses.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.