Connect Agent Tools

IntelliJ IDE

Connect JetBrains IDEs to AutoRouter via AI Assistant BYOK (Bring Your Own Key)

IntelliJ IDE

IntelliJ IDEA, PyCharm, WebStorm, and other JetBrains IDEs include the AI Assistant plugin, which supports BYOK (Bring Your Own Key) mode. Through the OpenAI-compatible provider, you can point your IDE at AutoRouter and use models distributed through your AutoRouter gateway without a JetBrains AI subscription.

This guide applies to all JetBrains IDEs that support AI Assistant (IntelliJ IDEA, PyCharm, WebStorm, GoLand, Rider, etc.). Custom endpoints currently support the OpenAI-compatible protocol only β€” the native Anthropic provider does not support a custom base URL.

πŸ“¦ Prerequisites

What you'll need

  • A JetBrains IDE installed (2026.1 or later recommended)
  • The AI Assistant plugin installed and enabled
  • An AutoRouter endpoint (must end with /v1)
  • An AutoRouter API key (generated in the console)
  • A model ID exactly matching one exposed by your AutoRouter console (e.g. claude-sonnet-4-6, gpt-5.4, deepseek-v4-pro)

πŸš€ Step 1: Configure the OpenAI-Compatible Provider

  1. Open the AI Chat tool window on the left sidebar.
  2. Click Bring your own API key.
  3. In Provider, select OpenAI-compatible.
  4. Fill in:
    • URL: https://autorouter.top/v1
    • API Key: your AutoRouter API key
  5. Click Continue.
  1. Open Settings / Preferences (Cmd+, / Ctrl+Alt+S).
  2. Navigate to Tools β†’ AI Assistant β†’ Providers & API keys.
  3. Under Third-party AI providers:
    • Provider: select OpenAI-compatible
    • URL: https://autorouter.top/v1
    • API Key: enter your AutoRouter API key
    • Tool calling: enable if your model supports Tool Calling (required for MCP and Agent features)
  4. Click Test Connection to verify the connection.
  5. Click Apply to save.

If JetBrains AI or another provider is already configured, log out of JetBrains AI on the same page or set Provider to None before setting up BYOK.

πŸ”§ Step 2: Assign Models

Models accessed through an OpenAI-compatible endpoint must be manually assigned to AI Assistant features. In the Model Assignment section on the same settings page:

SettingPurposeExample
Core featuresDefault chat model, code generation, commit messages, and other core featuresclaude-sonnet-4-6
Instant helpersLightweight tasks such as chat title generation and context collectiongpt-5.4 or same as Core
Completion modelInline code completion (requires FIM-capable models; optional)Leave empty or specify a completion model
Context windowModel context window size in tokensSet according to model capability, e.g. 128000

Key points

  • Model IDs must exactly match the names exposed in your AutoRouter console.
  • The base URL must end with /v1, e.g. https://autorouter.top/v1.
  • If your model supports tool calling, ensure Tool calling is enabled; otherwise Agent / MCP features may not work.

βœ… Step 3: Verify the Connection

  1. Open the AI Chat tool window and switch to Chat mode.
  2. Select your assigned AutoRouter model from the model dropdown.
  3. Send a test message, for example:
Write a Kotlin function that reads a JSON file

If the model responds normally, the connection is working. You can also click the JetBrains AI widget in the toolbar to confirm the active provider is OpenAI-compatible.

πŸ”„ Switching Models

  • In chat: select a different model from the AI Chat model dropdown.
  • Change defaults: update Core features and other fields under Settings β†’ Tools β†’ AI Assistant β†’ Providers & API keys β†’ Model Assignment.

❓ Common Issues

AI Assistant or BYOK option not visible

  • Confirm your IDE is version 2024.1 or later and the AI Assistant plugin is enabled under Settings β†’ Plugins.
  • If signed into JetBrains AI, log out before configuring BYOK.

Test Connection fails or returns 401 Unauthorized

  • Verify the API key is correct; regenerate it in the AutoRouter console if needed.
  • Confirm the URL ends with /v1, e.g. https://autorouter.top/v1.

Empty model list or chat errors

  • Confirm model IDs in Model Assignment match your AutoRouter console.
  • Some Claude models may behave differently under the OpenAI-compatible protocol than under Messages API; if you see 400 errors, try GPT or DeepSeek models instead.

Some AI Assistant features unavailable

In pure BYOK mode, features that rely on proprietary JetBrains models (such as certain smart refactorings) may be unavailable. To restore full functionality, you can activate a JetBrains AI subscription alongside your custom models.

Agent / MCP cannot call tools

Confirm Tool calling is enabled and the selected model supports Tool Calling in AutoRouter.

Connection failures on corporate networks / VPN

Configure proxy settings under Settings β†’ Appearance & Behavior β†’ System Settings β†’ HTTP Proxy, and add corporate root certificates under Tools β†’ Server Certificates if applicable.

On this page