Skip to content

How to Set Up OpenAI Codex in JetBrains IDE: Complete Installation Guide

I wanted to use OpenAI Codex directly in my JetBrains IDE for code generation and intelligent suggestions. But when I first tried to set it up, I kept searching in the wrong places - trying to find a standalone “OpenAI Codex plugin” instead of using the official JetBrains AI Assistant.

Here’s what I learned through trial and error.

The Problem: External AI Tools Break My Flow

I was tired of switching between my IDE and ChatGPT in a browser window. Every time I needed code suggestions or explanations, I had to:

  1. Copy code from the IDE
  2. Paste it into ChatGPT
  3. Read the response
  4. Copy the result back
  5. Paste it into my IDE

This back-and-forth was killing my productivity. I wanted AI-powered code assistance directly inside my JetBrains IDE.

The Solution: JetBrains AI Assistant Plugin

JetBrains officially integrated OpenAI’s Codex model into their IDEs through the AI Assistant plugin. This provides:

  • Code generation and auto-completion
  • Intelligent suggestions based on your codebase
  • Chat interface right in the IDE
  • Context-aware responses

Here’s exactly how I set it up.

Step 1: Install the AI Assistant Plugin

First, open your JetBrains IDE (IntelliJ IDEA, PyCharm, WebStorm, etc.) and navigate to the plugin marketplace:

Plugin Installation Path
Settings/Preferences (Ctrl+Alt+S / Cmd+,)
→ Plugins
→ Marketplace
→ Search: "JetBrains AI Assistant"

Click the Install button and restart your IDE when prompted.

I initially made the mistake of searching for “OpenAI Codex” or “ChatGPT” - those are third-party plugins and not the official integration. The official one is called “AI Assistant” by JetBrains.

Step 2: Sign In with OpenAI Account

After restarting, you’ll see a new AI Assistant icon in the top-right corner of your IDE window.

Click it and select “Sign in Codex with ChatGPT”:

Sign-in Steps
1. Click AI Assistant icon (top-right corner)
2. Select "Sign in Codex with ChatGPT"
3. Browser opens for OpenAI authentication
4. Enter your OpenAI credentials
5. Authorize JetBrains AI Assistant
6. Return to IDE - you're now connected!

If you don’t have an OpenAI account yet, you can create one during this process.

Step 3: Using Codex Features

Once connected, you can access Codex features in several ways:

Chat with AI

Press Alt+Enter (Windows/Linux) or Opt+Enter (macOS) on any code to ask questions:

Example: Asking Codex about code
// Select code and press Alt+Enter
public List<Document> processFiles(String path) {
// Ask: "Explain what this method does"
// Ask: "Add error handling"
// Ask: "Optimize this method"
}

Code Generation

Use the AI Assistant tool window (View → Tool Windows → AI Assistant) to generate code:

Code Generation Prompt
Generate a REST controller for a Spring Boot application
that handles CRUD operations for a User entity with:
- username (String)
- email (String)
- createdAt (LocalDateTime)

Inline Completion

As you type, AI Assistant will suggest completions based on Codex’s understanding of your codebase context. Press Tab to accept suggestions.

Free vs Paid Tiers

Here’s what I discovered about the pricing:

FeatureFree TierPaid Plan
Model AccessLimited modelsFull model access
Monthly QueriesLimited quotaHigher quota
Code CompletionBasic suggestionsAdvanced context-aware
Chat HistorySession onlyPersistent

Free users can access basic Codex features with limited models and a monthly query quota. For heavy daily use, the paid plan unlocks full capabilities.

Common Mistakes I Made

Mistake 1: Wrong Plugin

I initially installed a third-party “ChatGPT for JetBrains” plugin instead of the official AI Assistant. These unofficial plugins often:

  • Have compatibility issues
  • Don’t integrate with IDE context properly
  • May have security concerns with your API keys

Solution: Only use the official “AI Assistant” plugin by JetBrains.

Mistake 2: Using Wrong Credentials

I tried logging in with my JetBrains account instead of my OpenAI account.

The AI Assistant requires an OpenAI account for Codex access, not your JetBrains license account.

Mistake 3: Expecting Full Features on Free Tier

I was frustrated when some features were grayed out until I realized the free tier has limitations.

Solution: Check your usage in the AI Assistant settings and consider upgrading if you hit limits frequently.

Troubleshooting Installation Issues

Plugin Not Found in Marketplace

If you can’t find the AI Assistant plugin:

Troubleshooting Steps
1. Check IDE version: Requires 2023.2 or later
2. Update your IDE: Help → Check for Updates
3. Refresh plugin repository: Settings → Plugins → ⚙️ → Refresh

Authentication Fails

If OpenAI authentication doesn’t complete:

Authentication Fixes
1. Check firewall/proxy settings
2. Clear IDE caches: File → Invalidate Caches
3. Try signing out and back in
4. Verify OpenAI account is active at platform.openai.com

No AI Icon Visible

If the AI Assistant icon doesn’t appear:

Enable AI Assistant
View → Tool Windows → AI Assistant
OR
Settings → Tools → AI Assistant → Enable

Why This Matters for Developers

Native IDE integration provides significant advantages over external AI tools:

  1. Context Awareness: The AI understands your entire project structure, not just snippets you paste
  2. Workflow Integration: No context switching between browser and IDE
  3. Code Quality: Suggestions match your project’s coding style and patterns
  4. Time Savings: Seconds saved per interaction add up to hours weekly

For example, when I ask Codex to “add logging to this method,” it knows my project uses SLF4J and follows my logging conventions - something external ChatGPT couldn’t do.

  • Context Window: AI Assistant sends relevant code context (open files, recently viewed code) to Codex for better suggestions
  • Privacy: Code snippets are sent to OpenAI servers for processing; check your organization’s policies for sensitive codebases
  • Alternative: GitHub Copilot also integrates with JetBrains IDEs if you prefer that platform

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Setting up OpenAI Codex in JetBrains IDE takes just a few minutes with the official AI Assistant plugin. The key is using the correct plugin name and authenticating with your OpenAI account. Free users get access to basic features, while paid plans unlock the full potential of AI-powered code assistance directly in your development environment.

Comments