MCPcopy Create free account
hub / github.com/KellanM/OpenAI-Api-Unreal

github.com/KellanM/OpenAI-Api-Unreal @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
89 symbols 99 edges 21 files 6 documented · 7% updated 23mo ago★ 77023 open issues

Browse by type

Functions 59 Types & classes 30
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

OpenAI API Plugin

The OpenAIApi Plugin gives you access to the OpenAI API in Unreal Engine. It is compatible with 4.26, 4.27, 5.0, 5.1, 5.2, and 5.3

This is a community Plugin. No affiliation with OpenAI

Installation

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

Quick Start

See Video

NOTE: This tutorial is out of date. Updating it soon to show how you can use this plugin to:

Generate images at runtime using DALL·E 2.

Transcribe speech in any language using Whisper v2-large.

Use the chat endpoint to power an NPC with GPT-4 and GPT-3.5-Turbo.

Types of Authentication

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.

Blueprint Nodes

OpenAI Call Completions

  • This async node sends an HTTP request using your engine, prompt, and settings.

NOTE: Async nodes can only be called from a blueprint's Event Graph.

Make Completion Settings

  • This node allows you to set the Request body parameters.

NOTE: The extra parameter Start Sequence injects text at the beginning of your prompt.

stream will be supported soon

Break Completion

  • This node is used to access the values included in a completion or choice

Usage

This example shows OpenAI's OpenAI's completions endpoint in blueprints. (GPT-3)

This example show you how to use OpenAI's chat endpoint in blueprints. (GPT-4 / GPT-3.5-Turbo)

This example shows you how to generate a 1024x1024 image using DALL·E 2 in blueprints.

This example shows you how to record and transcribe speech using Whisper v2-Large in blueprints.

References

Supported Platforms

Windows, Mac, Android

Core symbols most depended-on inside this repo

Shape

Method 59
Class 23
Enum 7

Languages

C++98%
C#2%

Modules by API surface

Source/OpenAIAPI/Public/OpenAIDefinitions.h22 symbols
Source/OpenAIAPI/Private/OpenAIUtils.cpp11 symbols
Source/OpenAIAPI/Private/OpenAIEmbedding.cpp9 symbols
Source/OpenAIAPI/Private/OpenAIParser.cpp8 symbols
Source/OpenAIAPI/Private/OpenAICallTranscriptions.cpp5 symbols
Source/OpenAIAPI/Private/OpenAICallEmbedding.cpp5 symbols
Source/OpenAIAPI/Private/OpenAICallDALLE.cpp5 symbols
Source/OpenAIAPI/Private/OpenAICallCompletions.cpp5 symbols
Source/OpenAIAPI/Private/OpenAICallChat.cpp5 symbols
Source/OpenAIAPI/Private/OpenAIAPI.cpp2 symbols
Source/OpenAIAPI/OpenAIAPI.Build.cs2 symbols
Source/OpenAIAPI/Public/OpenAIUtils.h1 symbols

For agents

$ claude mcp add OpenAI-Api-Unreal \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page