# OpenAI

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com.cn/en-us/help/jetbrains-console/main/llms.txt).

Before configuring a connection to the OpenAI provider, set up your OpenAI account and get a valid API key for authentication. For more information, refer to the [OpenAI documentation](https://platform.openai.com/docs/overview).

Procedure: Add OpenAI provider

1. In the sidebar, under AI governance, select Providers.

If you don't see this page, or the controls on this page are inactive, your role doesn't have the necessary [permissions](roles.html#permissions).

2. Click Add provider and select OpenAI. The OpenAI provider card appears on the page.

3. In the Endpoint field, specify an endpoint URL for communicating with the OpenAI service. The default endpoint is `https://api.openai.com`. If your OpenAI project is configured for data residency, use the corresponding [regional endpoint](https://developers.openai.com/api/docs/guides/your-data#data-residency-controls) instead.

4. In the API key field, specify an API key to access the OpenAI API. For more information, refer to the [OpenAI documentation](https://platform.openai.com/docs/api-reference/authentication).

5. Click Connect.

JetBrains Central Console first saves the provider and then tests the connection to it.

If the test fails, the provider is still saved. The Error status appears next to the provider's name, and the provider card stays open for editing and displays an error message that you can expand to view the details. Correct the configuration and click Connect again to update the provider.

If the test passes, the configuration form is closed and a success message is displayed in the lower-right corner. The available models appear in the provider card.

> **Tip:**
> If the connection fails, ensure the configuration is correct, and your API key has not expired.

To add other models, click Add model in the Models table. For more information, refer to [Managing models](ai-providers-manage-models.html).

> **Tip:**
> To make Codex available to users and service accounts in AI tools such as [AI Assistant](https://www.jetbrains.com.cn/en-us/help/ai-assistant/codex-agent.html) and [JetBrains Air](https://www.jetbrains.com.cn/en-us/help/air/supported-agents.html#openai-codex), add at least one supported model here, then specify the OpenAI provider in an [AI policy](ai-policies-configure.html#provider).

To edit the provider configuration, click ![Ellipsis icon](images/union.svg) in the provider card, then select Edit credentials and update the necessary fields.

