Complete reference for all PlayKit Unreal SDK classes and Blueprint nodes.
All client classes (UPlayKitChatClient, UPlayKitImageClient, etc.) are ActorComponents — add them to an Actor in the editor or via AddComponent. They are not created through factory functions. Results are delivered via Blueprint-assignable events , not callbacks.
Static utility functions accessible from any Blueprint or C++.
Function Returns Description IsReady()boolCheck if SDK is configured and ready GetVersion()FStringGet current SDK version IsAuthenticated()boolCheck if a valid auth token is present GetAuthToken()FStringGet the current auth token GetGameId()FStringGet the configured Game ID GetBaseUrl()FStringGet the API base URL
Function Description SetupNPC(NPCClient, ModelName)Initialize a UPlayKitNPCClient component with the given model
UActorComponent for text generation. Stateless — it does not manage conversation history. Add to an Actor; bind events before calling methods.
Event Payload Description OnChatResponseFPlayKitChatResponseFired when a non-streaming response is complete OnStreamChunkFString ChunkFired for each streaming text chunk OnReasoningChunkFString ChunkFired for reasoning/thinking chunks OnStreamCompleteFString FullTextFired when streaming finishes OnErrorFString ErrorMessageFired on failure OnStructuredResponseFString JsonStringFired when structured generation completes
Method Description GenerateText(Prompt)Generate a response for a single prompt (uses SystemPrompt property) GenerateTextAdvanced(Config: FPlayKitChatConfig)Generate with full message history and settings GenerateTextStream(Prompt)Stream a response (fires OnStreamChunk + OnStreamComplete) GenerateTextStreamAdvanced(Config)Stream with full config GenerateStructured(Prompt, SchemaJson)Generate structured JSON output (fires OnStructuredResponse) CancelRequest()Cancel the in-flight request IsProcessing()Returns bool — whether a request is in flight
Property Type Default Description ModelNameFString"default-chat"Model to use Temperaturefloat0.7Response randomness (0.0–2.0) MaxTokensint320Max tokens (0 = model default) SystemPromptFString— System instruction for GenerateText shortcuts
// In Actor header:
UPROPERTY (VisibleAnywhere)
UPlayKitChatClient * ChatClient;
// In BeginPlay:
ChatClient->OnChatResponse. AddDynamic ( this , & AMyActor ::HandleResponse);
ChatClient-> GenerateText ( TEXT ( "Hello, who are you?" ));
void AMyActor :: HandleResponse ( const FPlayKitChatResponse & Response )
{
if (Response.bSuccess)
UE_LOG (LogTemp, Log, TEXT ( "AI: %s " ), * Response.Content);
else
UE_LOG (LogTemp, Error, TEXT ( "Error: %s " ), * Response.ErrorMessage);
}
UActorComponent for AI image generation. Results are delivered as FPlayKitGeneratedImage (Base64 PNG). Use Base64ToTexture2D to convert for engine use.
Event Payload Description OnImageGeneratedFPlayKitGeneratedImageFired when a single image is ready OnImagesGeneratedTArray<FPlayKitGeneratedImage>Fired when a batch is ready OnErrorFString ErrorMessageFired on failure
Method Description GenerateImage(Prompt)Generate one image GenerateImageWithSeed(Prompt, Seed)Generate with a fixed seed for reproducibility GenerateImagesAdvanced(Prompt, Options: FPlayKitImageOptions)Generate with full options (count, size, seed, transparency) CancelRequest()Cancel the in-flight request IsProcessing()Returns bool static Base64ToTexture2D(Base64Data)Convert Base64 string to UTexture2D*
Property Type Default Description ModelNameFString"default-image"Model to use ImageSizeFString"1024x1024"Default size string QualityFString"standard""standard" or "hd"ImageCountint321Default batch count (1–10) Seedint32-1-1 = random
"256x256", "512x512", "1024x1024", "1792x1024", "1024x1792"
ImageClient->OnImageGenerated. AddDynamic ( this , & AMyActor ::HandleImage);
ImageClient-> GenerateImage ( TEXT ( "A dragon flying over mountains" ));
void AMyActor :: HandleImage ( const FPlayKitGeneratedImage & Image )
{
if (Image.bSuccess)
{
UTexture2D * Texture = UPlayKitImageClient :: Base64ToTexture2D (Image.ImageBase64);
MyMesh-> GetMaterial ( 0 )-> SetTextureParameterValue ( TEXT ( "Base" ), Texture);
}
}
UActorComponent for transcribing audio files or raw audio data. For real-time microphone recording, use UPlayKitSTTComponent.
Event Payload Description OnTranscriptionCompleteFPlayKitTranscriptionResultFired when transcription succeeds OnErrorFString ErrorMessageFired on failure
Method Description TranscribeFile(FilePath)Transcribe a local audio file TranscribeFileWithLanguage(FilePath, Language)Transcribe with explicit language hint TranscribeAudioData(AudioData, FileName)Transcribe raw PCM bytes SetModelName(ModelName)Change the transcription model SetLanguage(Language)Set default language code (e.g. "en", "zh") CancelRequest()Cancel in-flight request IsProcessing()Returns bool
UActorComponent for real-time microphone recording and transcription. Pairs StartRecording/StopRecording with automatic transcription dispatch.
Event Payload Description OnPlayKitTranscriptionRespondedFPlayKitTranscriptionResultFired when transcription is ready OnPlayKitTranscriptionErrorFString ErrorMessageFired on failure
Method Description StartRecording()Begin microphone capture StopRecording()Stop capture (transcription starts automatically) StartTranscription(Request: FPlayKitTranscriptionRequest)Transcribe with explicit options StartTranscriptionSimple()Transcribe the last recording with default settings GetLastSavedFilePath()Returns the path of the last saved recording
Property Type Description ModelNameFStringTranscription model to use
UActorComponent for text-to-3D generation. Generation is asynchronous; the SDK polls the task until completion.
Event Payload Description OnCompletedFPlayKit3DTaskFired when the 3D model is ready OnProgressint32 PercentFired during generation with progress (0–100) OnStatusChangedEPlayKit3DTaskStatusFired when task status changes OnErrorFString ErrorMessageFired on failure
Method Description Generate3D(Prompt)Generate a 3D model from a text prompt Generate3DWithNegative(Prompt, NegativePrompt)Generate with negative guidance Generate3DAdvanced(Config: FPlayKit3DConfig)Full configuration CancelTask()Cancel the current task QueryTaskStatus(TaskId)Poll a task by ID IsProcessing()Returns bool GetCurrentTaskId()Returns FString GetCurrentStatus()Returns EPlayKit3DTaskStatus GetCurrentProgress()Returns int32 (0–100)
Property Type Default Description ModelNameFString"default-3d-model"Model to use ModelVersionFString"v2.5-20250123"Version string DefaultTextureQualityEPlayKit3DQualityStandardStandard or DetailedDefaultGeometryQualityEPlayKit3DQualityStandard— bDefaultPBRbooltrueGenerate PBR materials DefaultFaceLimitint3250000Max polygon count (0–200000)
UActorComponent for NPC conversations. Automatically manages conversation history, memory, and reply predictions. Initialize via UPlayKitBlueprintLibrary::SetupNPC.
Event Payload Description OnResponseFString TextFired when NPC reply is ready OnStreamChunkFString ChunkFired for each streaming chunk OnStreamCompleteFString FullTextFired when streaming finishes OnActionTriggeredFNPCActionCallArgsFired when NPC triggers a registered action OnReplyPredictionsGeneratedTArray<FString>Fired with suggested player responses OnErrorFString ErrorMessageFired on failure
Method Description Talk(Message)Send a message; fires OnResponse TalkStream(Message)Send with streaming; fires OnStreamChunk + OnStreamComplete IsTalking()Returns bool — whether a request is in flight
Method Description SetCharacterDesign(Design)Set the NPC's personality system prompt GetCharacterDesign()Returns current character design SetMemory(Name, Content)Set a named memory entry GetMemory(Name)Get a named memory entry GetMemoryNames()Returns TArray<FString> of all memory names ClearMemories()Remove all memories
Method Returns Description GetHistory()TArray<FNPCMessage>Get full conversation history GetHistoryLength()int32Number of messages ClearHistory()— Reset the conversation RevertHistory()boolUndo the last exchange RevertChatMessages(Count)int32Undo the last N messages AppendChatMessage(Role, Content)— Manually append to history SaveHistory()FStringSerialize history to JSON LoadHistory(SaveData)boolLoad from JSON
Method Description GenerateReplyPredictions(Count)Generate suggested player responses (fires OnReplyPredictionsGenerated)
Method Description ReportActionResult(CallId, Result)Report the result of a single action ReportActionResults(Results)Report results of multiple actions (TMap<FString, FString>)
Property Type Default Description Temperaturefloat0.7Response randomness (0.0–2.0) bAutoGenerateReplyPredictionsboolfalseAuto-generate predictions after each reply PredictionCountint323Number of predictions to generate (2–6)
UGameInstanceSubsystem for player info and credits. Access via UPlayKitPlayerClient::Get(WorldContextObject) or UPlayKitBlueprintLibrary::GetPlayerClient(WorldContextObject).
Event Payload Description OnPlayerInfoUpdatedFPlayKitPlayerInfoFired when player info is refreshed OnPlayerTokenReceivedFString TokenFired when a new player token arrives OnDailyCreditsRefreshedFPlayKitDailyCreditsResultFired when daily credits are added OnErrorFString ErrorMessageFired on failure
Method Returns Description static Get(WorldContextObject)UPlayKitPlayerClient*Get the subsystem instance HasValidToken()boolCheck if a player token is present GetCachedPlayerInfo()FPlayKitPlayerInfoGet last-fetched player info GetCredits()floatShorthand for cached credits GetNickname()FStringShorthand for cached nickname GetPlayerInfo()— Async fetch; fires OnPlayerInfoUpdated SetNickname(Nickname)— Update the player's display name RefreshDailyCredits()— Trigger a daily credit refresh ExchangeJWT(JWT)— Exchange a backend JWT for a player token SetPlayerToken(Token)— Set a token directly ClearPlayerToken()— Remove the current token
UObject for the player device authentication flow. Create via CreateDeviceAuthFlow(WorldContextObject).
Event Payload Description OnAuthUrlReadyFString URLFired when the auth URL is ready to display OnStatusChangedEDeviceAuthStatusFired on status transitions OnAuthSuccessFDeviceAuthResultFired when authentication succeeds OnAuthErrorFString ErrorMessageFired on failure
Method Description static CreateDeviceAuthFlow(WorldContextObject)Create a new flow object StartAuthFlow(GameId, Scope)Begin the flow (Scope defaults to "player:play") CancelAuthFlow()Cancel GetStatus()Returns EDeviceAuthStatus GetAuthUrl()Returns FString — the URL to show the player GetUserCode()Returns FString — the user code (if applicable) IsActive()Returns bool
Idle, Pending, Polling, Success, Expired, Cancelled, Error
UActorComponent that registers actions an NPC can trigger during conversation. Add alongside UPlayKitNPCClient on the same Actor.
Method Description RegisterAction(Action, Handler)Register an action by FNPCAction + FOnActionExecute delegate RegisterActionBinding(Binding)Register via FNPCActionBinding (useful for Blueprint) UnregisterAction(ActionName)Remove an action GetEnabledActions()Returns TArray<FNPCAction> HasEnabledActions()Returns bool ExecuteAction(Args)Manually execute an action GetActionsAsJsonSchema()Returns actions as JSON schema string
Function Description GetActionString(Args, ParamName)Extract a string parameter from action call args GetActionNumber(Args, ParamName)Extract a float parameter GetActionInt(Args, ParamName)Extract an int32 parameter GetActionBool(Args, ParamName)Extract a bool parameter ActionHasParam(Args, ParamName)Check if parameter exists CreateAction(Name, Description)Build a FNPCAction AddStringParameter(Action, Name, Desc, bRequired)Add a string parameter to an action AddNumberParameter(Action, Name, Desc, bRequired)Add a number parameter AddBoolParameter(Action, Name, Desc, bRequired)Add a bool parameter AddEnumParameter(Action, Name, Desc, Options, bRequired)Add an enum parameter
UGameInstanceSubsystem that tracks global player context and manages NPC conversation compaction. Access via UPlayKitAIContextManager::Get(WorldContextObject).
Method Description SetPlayerDescription(Description)Set a global player context string injected into all NPC prompts GetPlayerDescription()Returns FString ClearPlayerDescription()Remove the player description
Method Description RegisterNPC(NPC)Track an NPC for auto-compaction UnregisterNPC(NPC)Stop tracking RecordConversation(NPC)Mark that a conversation occurred (resets idle timer) EnableAutoCompact(TimeoutSeconds, MinMessages)Enable automatic history summarization DisableAutoCompact()Disable IsEligibleForCompaction(NPC)Returns bool CompactConversation(NPC)Manually compact one NPC's history CompactAllEligible()Compact all eligible NPCs; returns int32 count
USTRUCT (BlueprintType)
struct FPlayKitChatConfig
{
TArray < FPlayKitChatMessage > Messages;
float Temperature; // 0.0–2.0
int32 MaxTokens; // 0 = model default
bool bEnableThinking;
EPlayKitThinkingEffort ThinkingEffort; // Minimal, Low, Medium, High, Max
};
USTRUCT (BlueprintType)
struct FPlayKitChatResponse
{
bool bSuccess;
FString Content;
FString FinishReason;
TArray < FPlayKitToolCall > ToolCalls;
FString ErrorMessage;
int32 PromptTokens;
int32 CompletionTokens;
int32 TotalTokens;
FString Reasoning; // Populated when thinking is enabled
};
USTRUCT (BlueprintType)
struct FPlayKitGeneratedImage
{
bool bSuccess;
FString ImageBase64; // Base64-encoded PNG — convert with Base64ToTexture2D
FString OriginalPrompt;
FString RevisedPrompt;
FDateTime GeneratedAt;
FString ErrorMessage;
};
USTRUCT (BlueprintType)
struct FPlayKitImageOptions
{
FString Size; // e.g. "1024x1024"
int32 Count; // 1–10
int32 Seed; // -1 = random
bool bTransparent;
};
USTRUCT (BlueprintType)
struct FPlayKitTranscriptionResult
{
bool bSuccess;
FString Text;
FString Language;
float DurationSeconds;
TArray < FPlayKitTranscriptionSegment > Segments;
FString ErrorMessage;
};
USTRUCT (BlueprintType)
struct FPlayKitPlayerInfo
{
FString UserId;
float Credits;
FString Nickname;
};
USTRUCT (BlueprintType)
struct FNPCMessage
{
FString Role; // "system", "user", "assistant"
FString Content;
};
Project settings at Edit > Project Settings > Plugins > PlayKit SDK .
Setting Type Description GameIdFStringApplication ID from the dashboard DefaultChatModelFStringDefault model for UPlayKitChatClient DefaultImageModelFStringDefault model for UPlayKitImageClient DefaultTranscriptionModelFStringDefault model for STT Default3DModelFStringDefault model for UPlayKit3DClient FastModelFStringFast model used for context compaction bEnableAutoCompactboolEnable auto-compaction globally AutoCompactTimeoutSecondsfloatIdle time before compaction eligibility AutoCompactMinMessagesint32Minimum messages required for compaction bEnableDebugLoggingboolEnable SDK debug output