# JetBrains IDEs

<Callout type="info" title="Note">
  AI Gateway is part of [AI Governance](/beta-docs/ai-coder/ai-governance/), which is
  included with a Premium license.
</Callout>

JetBrains IDE (IntelliJ IDEA, PyCharm, WebStorm, etc.) support AI Gateway via the [third-party model configuration](https://www.jetbrains.com/help/ai-assistant/use-custom-models.html#provide-your-own-api-key) feature.

## Prerequisites [#prerequisites]

* [**JetBrains AI Assistant**](https://www.jetbrains.com/help/ai-assistant/installation-guide-ai-assistant.html): Installed and enabled.
* **Authentication*&#x2A;: Your &#x2A;*[Coder API token](/beta-docs/admin/users/sessions-tokens/#generate-a-long-lived-api-token-on-behalf-of-yourself)**.

## Centralized API Key [#centralized-api-key]

1. **Open Settings**: Go to **Settings** > **Tools** > **AI Assistant** > **Models & API Keys**.
2. **Configure Provider**: Go to **Third-party AI providers**.
3. **Choose Provider**: Choose **OpenAI-compatible**.
4. **URL**: `https://coder.example.com/api/v2/ai-gateway/openai/v1`
5. **API Key*&#x2A;: Paste your &#x2A;*[Coder API token](/beta-docs/admin/users/sessions-tokens/#generate-a-long-lived-api-token-on-behalf-of-yourself)**.
6. **Apply**: Click **Apply** and **OK**.

![JetBrains AI Assistant Settings](/beta-docs/images/aibridge/clients/jetbrains-ai-settings.png)

## Using the AI Assistant [#using-the-ai-assistant]

1. Go back to **AI Chat** on theleft side bar and choose **Chat**.
2. In the Model dropdown, select the desired model (e.g., `gpt-5.2`).

![JetBrains AI Assistant Chat](/beta-docs/images/aibridge/clients/jetbrains-ai-chat.png)

You can now use the AI Assistant chat with the configured provider.

<Callout type="info" title="Note">
  * JetBrains AI Assistant currently only supports OpenAI-compatible endpoints. There is an open [issue](https://youtrack.jetbrains.com/issue/LLM-22740) tracking support for Anthropic.
  * JetBrains AI Assistant may not support all models that support OpenAI's `/chat/completions` endpoint in Chat mode.
  * JetBrains AI Assistant does not send an identifying user agent, so AI Gateway records these sessions with the client `Unknown`. Usage, tokens, and audit data are still captured.
</Callout>

## BYOK (Personal API Key) [#byok-personal-api-key]

<Callout type="info" title="Note">
  At the time of writing, JetBrains AI Assistant does not support sending custom headers, so BYOK mode is not available.
</Callout>

**References:** [Use custom models with JetBrains AI Assistant](https://www.jetbrains.com/help/ai-assistant/use-custom-models.html#provide-your-own-api-key)
