Generate images with OpenAI and upload them to UploadThing directly from n8n.
This community node adds a single node: OpenAI → UploadThing, which:
- Generates an image using OpenAI’s Images API (
gpt-image-1) - Uploads the resulting image to UploadThing using
UTApi
References:
- UploadThing server API (UTApi, UTFile): https://docs.uploadthing.com/api-reference/server
- OpenAI JavaScript SDK: https://www.npmjs.com/package/openai
- Node.js ≥ 20
- n8n installed and running
- OpenAI API key
- UploadThing token
Install as a community node in n8n or via npm in your n8n extensions setup:
npm install n8n-nodes-gpt-image-uploadthing
Restart n8n so it loads the package.
Create two credentials in n8n:
- OpenAI API
- API Key: your OpenAI key
- UploadThing API
- Token: your UploadThing token
These correspond to the credential types exported by the package: OpenAiApi and UploadThingApi.
Add the node “OpenAI → UploadThing” to your workflow and configure:
- Prompt: Text prompt to generate the image.
- Size: One of
1024×1024,1536×1024,1024×1536. - File Name: Output file name (e.g.
generated.png). - ACL:
public-readorprivate. - Content Disposition:
inlineorattachment.
Outputs (json):
- fileKey: UploadThing file key
- url: Public URL (respecting ACL)
- name: Stored file name
- sizeBytes: File size in bytes
- plus the input fields for reference
npm i
npm run build
Link or install the built dist into your n8n environment. Lint and format:
npm run lint
npm run format
- Keep your OpenAI API key and UploadThing token secret in n8n credentials.
- If you set ACL to
private, use signed URLs to access files as needed via UploadThing APIs.
MIT
