OpenAI
AI API keyGenerate 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
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.
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.
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.
Generate Image
Create completion
Create embedding
Create translation
Create moderation
Get thread
List runs
Retrieve fine tuning job
Create transcription
Create image edit
List fine tunes
Download file
Create image variation
Create image
List message files
Cancel fine tune
Create message
Get run
List fine tuning events
List models
Delete thread
Modify thread
Create thread
Create file
Delete assistant file
Get run step
Retrieve fine tune
Delete assistant
Retrieve model
Modify run
Flows
Multi-step workflows that already wire OpenAI to something else.
Resource type
openai — the shape of the credential every script on this page expects.
| Field | Type | Required | What it is |
|---|---|---|---|
| api_key | string | Yes | |
| organization_id | string | No | Only needs to be set for users who belong to multiple organizations and they want to use an organization other than the default one |
| base_url | string | No | Optional. 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.