Viewing docs for OpenAI v0.3.1
published on Monday, Nov 23, 2026 by Pulumi Labs
published on Monday, Nov 23, 2026 by Pulumi Labs
OpenAI
I want to use the Pulumi OpenAI package (openai) in my project.
## Provider details
- Package: openai
- Version: v0.3.1
- Publisher: Pulumi Labs
- Source: pulumi
- Repository: https://github.com/pulumi-labs/pulumi-openai
## Documentation
The Pulumi Cloud Registry API serves canonical, up-to-date docs for this package — including private packages and every published version. Send the "Accept: text/markdown" header for clean readable content, or "application/json" for structured data.
Start at the navigation tree, which cross-links to the readme, installation guide, and per-resource docs URL template:
- https://api.pulumi.com/api/registry/packages/pulumi/pulumi-labs/openai/versions/latest/nav
Returns a summary by default. The full tree can be hundreds of kB for large providers, so prefer targeted search: append "?q=<query>&depth=full" to filter by resource/function title or token (for example "?q=bucket&depth=full"). Only request the full nav without a query if you actually need to enumerate every resource.
Other endpoints:
- Overview and getting started: https://api.pulumi.com/api/registry/packages/pulumi/pulumi-labs/openai/versions/latest/readme
- Installation and configuration: https://api.pulumi.com/api/registry/packages/pulumi/pulumi-labs/openai/versions/latest/installation
- Per-resource/function docs: https://api.pulumi.com/api/registry/packages/pulumi/pulumi-labs/openai/versions/latest/docs/{token}?lang={lang}
Replace {token} with the percent-encoded token from the nav response (for example aws:s3/bucket:Bucket).
Replace {lang} with typescript, python, go, csharp, java, yaml, or hcl.
Fetch the installation endpoint above for the correct setup steps — install instructions vary between native providers, bridged Terraform providers, and component packages.
Help me get started using this provider. Show me a complete Pulumi program that provisions a common resource, including all necessary configuration and imports.
OpenAI
Viewing docs for OpenAI v0.3.1
published on Monday, Nov 23, 2026 by Pulumi Labs
published on Monday, Nov 23, 2026 by Pulumi Labs
The OpenAI provider for Pulumi lets you manage OpenAI resources as part of your Pulumi programs: agents, the automations that run them on a schedule, and the vaults that hold the credentials they use.
This provider is experimental. Its resources use OpenAI’s beta Agents API.
Installation
npm:
npm install @pulumi-labs/openai
Yarn:
yarn add @pulumi-labs/openai
pnpm:
pnpm add @pulumi-labs/openai
Bun:
bun add @pulumi-labs/openai
pip:
Add pulumi-labs-openai to requirements.txt, then run:
pip install -r requirements.txt
uv:
uv add pulumi-labs-openai
Poetry:
poetry add pulumi-labs-openai
go get github.com/pulumi-labs/pulumi-openai/sdk/go/pulumi-openai
dotnet add package Pulumi.Labs.Openai
Replace VERSION with the latest version on Maven Central.
Maven:
<dependency>
<groupId>com.pulumi.labs</groupId>
<artifactId>openai</artifactId>
<version>VERSION</version>
</dependency>
Gradle:
implementation 'com.pulumi.labs:openai:VERSION'
Install the latest provider plugin from its GitHub releases:
pulumi plugin install resource openai --server github://api.github.com/pulumi-labs/pulumi-openai
Example Usage
This program creates an agent that can search the web.
import * as openai from "@pulumi-labs/openai";
const supportAgent = new openai.Agent("supportAgent", {
model: "gpt-5.5",
name: "support-agent",
instructions: "You answer customer questions about orders.",
reasoning: { effort: openai.ReasoningEffort.Low },
tools: [{ type: openai.ToolType.WebSearch }],
});
export const agentId = supportAgent.id;
import pulumi
import pulumi_labs_openai as openai
support_agent = openai.Agent(
"supportAgent",
model="gpt-5.5",
name="support-agent",
instructions="You answer customer questions about orders.",
reasoning={"effort": openai.ReasoningEffort.LOW},
tools=[{"type": openai.ToolType.WEB_SEARCH}],
)
pulumi.export("agentId", support_agent.id)
package main
import (
openai "github.com/pulumi-labs/pulumi-openai/sdk/go/pulumi-openai"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
supportAgent, err := openai.NewAgent(ctx, "supportAgent", &openai.AgentArgs{
Model: pulumi.String("gpt-5.5"),
Name: pulumi.String("support-agent"),
Instructions: pulumi.String("You answer customer questions about orders."),
Reasoning: &openai.AgentReasoningArgs{
Effort: openai.ReasoningEffortLow,
},
Tools: openai.AgentToolArray{
&openai.AgentToolArgs{Type: openai.ToolTypeWebSearch},
},
})
if err != nil {
return err
}
ctx.Export("agentId", supportAgent.ID())
return nil
})
}
using System.Collections.Generic;
using Pulumi;
using OpenAI = Pulumi.Labs.Openai;
return await Deployment.RunAsync(() =>
{
var supportAgent = new OpenAI.Agent("supportAgent", new()
{
Model = "gpt-5.5",
Name = "support-agent",
Instructions = "You answer customer questions about orders.",
Reasoning = new OpenAI.Inputs.AgentReasoningArgs
{
Effort = OpenAI.ReasoningEffort.Low,
},
Tools =
{
new OpenAI.Inputs.AgentToolArgs { Type = OpenAI.ToolType.WebSearch },
},
});
return new Dictionary<string, object?>
{
["agentId"] = supportAgent.Id,
};
});
import com.pulumi.Pulumi;
import com.pulumi.labs.openai.Agent;
import com.pulumi.labs.openai.AgentArgs;
import com.pulumi.labs.openai.enums.ReasoningEffort;
import com.pulumi.labs.openai.enums.ToolType;
import com.pulumi.labs.openai.inputs.AgentReasoningArgs;
import com.pulumi.labs.openai.inputs.AgentToolArgs;
public class App {
public static void main(String[] args) {
Pulumi.run(ctx -> {
var supportAgent = new Agent("supportAgent", AgentArgs.builder()
.model("gpt-5.5")
.name("support-agent")
.instructions("You answer customer questions about orders.")
.reasoning(AgentReasoningArgs.builder()
.effort(ReasoningEffort.Low)
.build())
.tools(AgentToolArgs.builder()
.type(ToolType.WebSearch)
.build())
.build());
ctx.export("agentId", supportAgent.id());
});
}
}
name: openai-example
runtime: yaml
resources:
supportAgent:
type: openai:Agent
properties:
model: gpt-5.5
name: support-agent
instructions: You answer customer questions about orders.
reasoning:
effort: low
tools:
- type: web_search
outputs:
agentId: ${supportAgent.id}
Set your OpenAI API key before running pulumi up:
pulumi config set --secret openai:apiToken <your-api-key>
More programs, including an automation that runs the agent every weekday, are in the examples directory of the provider repository.
Configuration
apiToken(Required, Secret): The OpenAI API key. May also be set with theOPENAI_API_KEYenvironment variable.baseUrl(Optional): The base URL of the OpenAI API. Defaults tohttps://api.openai.com/v1. May also be set with theOPENAI_BASE_URLenvironment variable.
Resources
Agent: A reusable agent: a model with its instructions, tools and settings.PeriodicAutomation: Runs an agent repeatedly, on a cron expression.OneTimeAutomation: Runs an agent once, at a given time.Vault: A store of credentials that sessions use without the secrets appearing in an agent’s configuration.VaultCredential: A credential in a vault: a token for an MCP server, or a secret for OpenAI-hosted environments.
OpenAI
Viewing docs for OpenAI v0.3.1
published on Monday, Nov 23, 2026 by Pulumi Labs
published on Monday, Nov 23, 2026 by Pulumi Labs