---
title: Use OpenAI with Pulumi Agents
url: /docs/ai/agents/model-providers/openai/
---
> This [Pulumi Cloud](/docs/iac/concepts/pulumi-cloud/) feature is available in the [Enterprise edition](/pricing/#neo-byok).



Use an API key from your OpenAI account to run Pulumi Agents on the models you select. OpenAI bills your account for the requests. If your models are deployed in Azure, follow the [Azure Foundry guide](/docs/ai/agents/model-providers/azure-foundry/).

## Connect OpenAI

Organizations on the legacy Business Critical edition also have access to this feature. To connect the provider, you need permission to manage your organization's integrations, such as the Admin role.

1. In Pulumi Cloud, open your organization's **Agent Settings**.
1. Select **Model provider**, then **Add model provider**.
1. Enter a unique **Name** using lowercase letters, numbers, and hyphens. Choose a name you can recognize when configuring an agent. The name is permanent, and Pulumi reserves `pulumi`.
1. Under **Provider**, select **OpenAI**.

1. Enter your OpenAI **API key**.
1. Choose a **Thinking** level. **Off** uses Chat Completions. **Low**, **Medium**, and **High** use the Responses API. If your model requires reasoning to call tools, choose one of those three levels.
1. For **Default model**, choose a suggested model or enter a model ID your account can use.
1. Optionally, set **Fast model** to a smaller model for short calls such as naming a task. If you leave it blank, Pulumi uses the default model for those calls.

## Test and use the provider

Select **Save**. Pulumi sends a test request to each configured model and shows any errors. If a request fails, correct the settings and save again.

To use the connection for one agent, [open the agent's configuration](/docs/ai/agents/configure/#choose-a-model), select the provider by name under **Model**, and save the agent. Start a new task to use that selection.

To use the connection for new tasks that follow the organization default, check whether it is already the default. If needed, select **Set as default** in **Agent Settings**. See [how Pulumi chooses the default provider](/docs/ai/agents/model-providers/#the-default-provider).


