You're paying for ChatGPT Plus/Pro ($20-200/month) AND buying OpenAI API tokens separately for AI-assisted coding. That's double-dipping.
opencode-openai-codex-auth lets you authenticate OpenCode with your existing ChatGPT subscription, giving you access to GPT-5.x models for coding tasks without purchasing additional API credits.
# Install the auth plugin
npx -y opencode-openai-codex-auth@latest
# Authenticate with your ChatGPT account
opencode auth login
# Start using GPT-5.2 for coding tasks
opencode run "refactor this function for readability" --model=openai/gpt-5.2| Model | Variants | Best For |
|---|---|---|
| gpt-5.2 | low/medium/high/xhigh | General coding |
| gpt-5.2-codex | low/medium/high/xhigh | Code-optimized tasks |
| gpt-5.1-codex-max | low/medium/high/xhigh | Complex refactoring |
| gpt-5.1-codex | low/medium/high | Everyday coding |
| gpt-5.1-codex-mini | medium/high | Quick tasks |
You can combine this with OpenCode's custom tools for powerful workflows:
# Create a custom tool
mkdir -p .opencode/tool// .opencode/tool/analyzeCode.ts
import { tool } from "@opencode-ai/plugin"
export default tool({
description: "Analyze code for security vulnerabilities",
args: {
filepath: tool.schema.string().describe("Path to file to analyze"),
},
async execute(args) {
const file = await Bun.file(args.filepath).text()
return `Analyzing: ${args.filepath}\n\nCode:\n${file}`
},
})# Run with your subscription
opencode run "analyze src/auth.ts for security issues" --model=openai/gpt-5.2-codex --variant=high| Approach | Monthly Cost | Notes |
|---|---|---|
| ChatGPT Pro + API tokens | $200 + $50-500 | Paying twice |
| ChatGPT Pro + this plugin | $200 | Single subscription |
| API tokens only | $50-500+ | No chat interface |
- Intended for personal development use with individual subscriptions
- Production/multi-user apps should use OpenAI's Platform API
- Subject to ChatGPT's usage policies and rate limits