The OpenAIApi Plugin gives you access to the OpenAI API in Unreal Engine. It is compatible with 4.26, 4.27, 5.0, and 5.1
This is a community Plugin. No affiliation with OpenAI
The recommended way to install the plugin is to use pre-built binaries.
- Download the Plugin here
- Create a
Plugins
folder under your project folder - Copy the plugin to it, so you have
YourProject/Plugins/OpenAIAPI
See Video
NOTE: This video will soon be updated to show you how to generate images in
Unreal Engine
withDALL·E 2
.
There are two ways to set the Api Key
-
Assign the Api key directly in blueprints.
-
Set the Api Key as an environment variable
ADVICE: Pay attention to security and encrypt your assets before packaging.
ADVICE: Create the environment variable
OPENAI_API_KEY
and use your Api key as the value.
- This async node sends an HTTP request using your
engine
,prompt
, andsettings
.
NOTE: This node can only be called from a blueprint's
Event Graph
.
- This node allows you to set the
Request body
parameters.
NOTE: The extra parameter
Start Sequence
injects text at the beginning of your prompt.
log_probs
andstream
will be supported soon
- This node is used to access the values included in a
completion
orchoice
NOTE:
log_probs
is currently unsupported.
This example shows OpenAI's chat example implemented in blueprints.
This example show you how to use OpenAI's chat endpoint in blueprints.
This example shows how you can generate a 1024x1024 image using DALL·E 2 in blueprints.
Windows, Mac, Android