OpenAI in Unity without the official SDK
A community-built UPM package that wraps OpenAI's REST API for Unity developers who need chat, DALL-E, realtime voice, and assistants in their games.

What it does
This is an unofficial C# client for OpenAI’s API, packaged specifically for Unity via OpenUPM. It covers the full surface area: chat completions with streaming and function calling, image generation and editing, audio transcription/translation/speech, embeddings, fine-tuning, the Assistants API with threads and vector stores, and even the newer realtime voice API. Authentication is flexible—constructor, ScriptableObject, config file, or environment variables—and it also supports Azure OpenAI deployments.
The interesting bit
The package is actually a thin Unity wrapper around the author’s standalone OpenAI-DotNet library, which means the heavy lifting stays framework-agnostic. The Unity-specific value is in the UPM packaging, ScriptableObject-based configuration, and the dependency chain of utility packages for async, websockets, REST, and audio encoding.
Key highlights
- Full API coverage including GPT-4o, DALL-E 3, realtime sessions, and Assistants with vector stores
- Streaming support for chat, assistants, and audio (text-to-speech)
- Four auth methods, including Unity ScriptableObjects and
.openaiconfig files - Azure OpenAI support with Active Directory authentication
- Distributed through OpenUPM; one-line install via
openupm add com.openai.unity
Caveats
- Git URL installation requires manually adding five separate utility dependencies; the README warns about this explicitly
- The ScriptableObject auth method carries a bolded warning about accidentally checking API keys into source control
- Requires Unity 2021.3 LTS or newer; no mention of older version support
Verdict
Unity developers who want OpenAI features without building their own HTTP client should grab this. If you’re not using Unity, use the underlying OpenAI-DotNet library directly instead—this package adds no value outside the editor.