OpenAI

AI API key

Generate text, images, embeddings and speech from any Windmill script, flow or app — and point Windmill AI at the same key so the code assistant and AI agent steps run on your own OpenAI account.

Set up in 3 steps

1

Create an API key

In the OpenAI platform, open API keys and create a secret key. Copy it straight away — the key starts with sk- and is shown only once.

2

Add the resource in Windmill

Open Resources, add a resource of type openai, and paste the key. Leave organization_id and base_url empty unless you bill a non-default organization or route through a compatible gateway.

3

Point Windmill AI at it, or fork a script

In AI settings, at workspace or instance level, pick OpenAI as the provider and select the resource — the code assistant, the AI chat and AI agent steps then run on your key. The same resource feeds every script listed below.

Scripts

Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.

Flows

Multi-step workflows that already wire OpenAI to something else.

All flows →

Resource type

openai — the shape of the credential every script on this page expects.

View raw schema →
FieldTypeRequiredWhat it is
api_keystringYes
organization_idstringNoOnly needs to be set for users who belong to multiple organizations and they want to use an organization other than the default one
base_urlstringNoOptional. Only needed to overwrite the default base URL.

Questions

Is my API key stored on the hub?

Never. It lives only in your own Windmill workspace, encrypted at rest.

Does this power Windmill's own AI features?

Yes. Select the resource in AI settings and the code assistant, AI chat and AI agent steps all run on your key and your choice of model.

When do I need to fill organization_id?

Only if your account belongs to several organizations and you want to bill one other than the default. Find it under Account settings, then Organizations.

Is this the same as Azure OpenAI?

Azure OpenAI has its own resource type and its own entry in AI settings. You can also keep this resource and point base_url at any OpenAI-compatible endpoint — Azure, a local model or a proxy.