How to make AI NPCs that talk in your game
Short answer: to try a talking NPC today for free, use Convai's plugin in Unity or Unreal, or build a small DIY version: send the player's line to a language model, then read the reply out loud with text to speech. Prototyping is free. Shipping to real players almost always costs money, because every conversation is a paid API call. Every plan limit and license below comes from each company's own site, checked Oct 23, 2026. We only cover free plans, plus the first paid step where it matters.
The 30 second version
- Fastest in Unity or Unreal: Convai. Free plan, 100 interactions a month, but only 1 monthly active end user, so it is for testing.
- Most free voice minutes with a commercial license: Inworld's On-Demand plan, up to 70 minutes of TTS included. You write the NPC logic yourself.
- Story first, writer led: Charisma.ai. No free plan listed, pay as you go.
- Using Godot: go DIY. No NPC platform we checked has an official Godot plugin.
- Never ship an API key in the game. Put it on a small server you control.
- Selling on Steam? Disclose Live-Generated AI and describe your guardrails.
Talking NPC tools compared
Free plans first, from each tool's official pricing page or docs, checked Oct 23, 2026.
| Tool | Free plan | Engines (official) | Ship a game with it free? |
|---|---|---|---|
| Convai | 100 interactions a month (50 with flagship LLMs), 1 concurrent session, 1 monthly active end user, no ElevenLabs voices, no long term memory. | Unity SDK, Unreal Engine 5 plugin, Web SDK | No, 1 monthly active end user. Indie Dev is $29/mo for 3,000 interactions and 75 users. |
| Inworld AI (On-Demand) | $0 to start, pay as you go. Up to 70 minutes of TTS or 400 minutes of speech to text free, 5 concurrent requests, voice cloning and design, access to 100+ LLMs. | APIs (Realtime over WebSocket or WebRTC), TTS SDKs for Node.js and Python. Engine SDKs unverified, see below. | Commercial license is included on On-Demand. Usage after the free allowance is paid. |
| Charisma.ai (Pro) | No free plan listed. Pay as you go at $5 per 50,000 credits, about 200 experience minutes per Charisma. | Unity and Unreal Plug 'n' Play SDKs, JavaScript and Python SDKs | No free tier to ship on |
| ElevenLabs (voice only) | 10,000 credits a month. Text to speech uses about 1 credit per character. | API, works with any engine through your server | No, the commercial license starts on Starter at $6/mo |
| Ollama + Piper (local) | Free and open source, runs on your own computer. | Any engine that can make HTTP requests | Free, but each model and voice has its own license, and players would need to run it too |
| Godot built-in TTS | Free, uses the player's system voices. | Godot | Yes, it is part of the engine. Voice quality depends on the player's computer. |
Step 1: design the NPC before you pick a tool
A talking NPC is three parts in a loop: something to hear the player (typed text or speech to text), a language model that writes the reply in character, and text to speech that says it. Before you touch any tool, write a short character sheet:
- Who they are: name, job, personality, how they speak.
- What they know: the town, the quest, the prices in the shop.
- What they must never do: break character, talk about the real world, give spoilers, say anything you would not put in your game's rating.
- What the game needs from them: for example, give the key only after the player asks about the missing dog.
Start with one NPC with one job. A shopkeeper who can chat but always ends with your scripted sell menu is a great first project.
Option A: Convai (fastest in Unity and Unreal)
Convai's pricing page (checked Oct 23, 2026) lists a Free plan "to test out the platform": 100 interactions a month, 60 minutes of cloud rendered Avatar Studio and Convai Sim, 1 character session at a time and 1 monthly active end user. Only 50 of those interactions can use its flagship LLMs, and high quality third party voices such as ElevenLabs are not included. Convai counts one interaction every time a player sends input and the character responds, and unused interactions do not roll over. The free plan still includes Convai's character creation tools and its server based character animation.
The catch for shipping: 1 monthly active end user means only you. Indie Dev is $29/mo ($22/mo billed yearly) with 3,000 interactions and 75 monthly active end users, and adds long term memory. Professional is $99/mo with 10,000 interactions and 250 users.
Engine setup
- Unity: the Convai Unity SDK installs through the Package Manager or Asset Store, and its docs walk you through adding a chat UI and lip sync. Its platform matrix covers Windows, macOS, Android, iOS, Meta Quest and WebGL.
- Unreal: the Convai Unreal Engine plugin is for Unreal Engine 5, Blueprint first, with build targets Win64 or Android.
- Web: the Convai Web SDK connects web apps to Convai characters by voice and text, with React and PlayCanvas guides.
- Godot: no official plugin in Convai's docs.
Before you build a player version, read Convai's Ship a secure build page. It explains Auth Token mode, which keeps your account API key out of the build. In API Key mode the key is included in the build as usual, and Convai itself warns that any key shipped inside a client build is ultimately extractable.
Option B: Inworld AI (voice APIs with a commercial free tier)
Inworld changed a lot. Its Character Studio deprecation page (checked Oct 23, 2026) says the legacy Character Studio has been retired, and that you now build characters with its Agent Runtime and character templates for Unity, Unreal and Node.js. When we checked, the Unity and Unreal Runtime doc pages it links to redirected to the Inworld Portal instead of loading, and Inworld's Node.js Runtime template repos on GitHub are archived. So we treat Inworld's engine SDKs as unverified today. What is clearly live is its API platform: text to speech, speech to text, a Realtime voice API over WebSocket or WebRTC, and LLM access through one API.
Inworld's pricing page (checked Oct 23, 2026) lists On-Demand at $0, pay as you go, "for evaluation and prototyping", with up to 70 minutes of TTS included (its FAQ says up to 70 minutes of TTS or 400 minutes of speech to text for free), 100 custom voices, voice cloning and design, 100+ LLM models and a commercial license. On-Demand allows 5 concurrent requests. After the free allowance, TTS-2 is $25 per million characters and TTS-2 Flash is $15 per million on On-Demand. Creator is $25/mo with $25 in credits a month. Inworld's voice is also on StarterLoot as Inworld TTS.
Inworld's docs are a good fit for the DIY approach below. Its security best practices show two safe patterns: proxy every call through your own backend, or have your backend mint short lived one-time tokens so the client can stream directly.
Option C: Charisma.ai (story first)
Charisma is built around writing. You lay out the story beats in its editor and use generative AI dialogue inside them. Charisma's pricing page (checked Oct 23, 2026) shows no free plan. Pro is pay as you go at $5 per 50,000 credits, which Charisma says is about 200 experience minutes, and includes speech to text, an AI voice library, custom AI voices and generative AI dialogue. Charisma's docs say new accounts start by getting in touch, and that its Plug 'n' Play SDKs for Unity and Unreal get a project running in engine. Charisma's GitHub also has SDKs for JavaScript and Python. We found no Godot SDK.
Option D: DIY, a language model plus text to speech
This is the most flexible path and the only one that works the same in every engine, including Godot. The loop is simple:
- The player types a line, or speaks and you turn it into text.
- Your game sends the line, plus the character sheet and the last few messages, to your own small server.
- Your server calls a language model and gets a short reply in character.
- Your server (or the game) turns the reply into audio with text to speech, and the NPC says it.
Free ways to get the language model
- Ollama on your own computer. Ollama is free and open source under the MIT license (checked Oct 23, 2026) and runs open models locally. Its REST API listens on
http://localhost:11434/api/chat, so your game can send it a normal HTTP request. Great for prototyping with no API bill. Each model you download has its own license, so check it before you ship anything, and remember players would need to install and run it too. - A free cloud tier. Google's Gemini API pricing page (checked Oct 23, 2026) lists a Free tier with free input and output tokens on some models and limited access to others. Google also says Free tier content is used to improve its products, while paid tier content is not. Fine for testing, but do not send players' private data through it.
Free ways to get the voice
- Godot's built-in text to speech. Godot's docs (4.7, checked Oct 23, 2026) show
DisplayServer.tts_speak()using the voices already on the player's system. Turn it on in Project Settings, Audio, General, Text to Speech. It works out of the box on Windows, macOS, Web, Android and iOS, but some Linux players need extra system libraries, and Godot warns to expect delays, especially on Android and Web. It sounds robotic next to AI voices, but it is free for every player. - Piper (local, open source). Piper is a fast local neural text to speech engine. Its original MIT licensed repo is archived and development moved to OHF-Voice/piper1-gpl, which is GPL-3.0 (checked Oct 23, 2026). Install with
pip install piper-tts, and it has a web server mode. Each voice is trained on a different dataset with its own license, listed in the voice's model card. For example, the dataset behind the popular en_US lessac voice comes with a research licence agreement. Check the voice license, and the GPL terms if you bundle Piper with your game. - Other free open voices: Chatterbox (MIT) and Kokoro (Apache). See Best free AI tools for game voice acting.
- Cloud voices: ElevenLabs (affiliate link, see our disclosure) has a Free plan with 10,000 credits a month, but its pricing page (checked Oct 23, 2026) lists the Commercial License starting on Starter at $6/mo. Inworld's On-Demand plan includes a commercial license.
Making the call from your engine
- Godot: the HTTPRequest node is, in Godot's words, the easiest way to make HTTP requests in Godot. Add it as a child node, call
request()and connectrequest_completed. - Unity: UnityWebRequest handles HTTP communication with web servers.
- Unreal: the simplest beginner route is the Convai plugin above. A DIY HTTP setup in Unreal is beyond this guide.
A tiny Godot example that asks a local Ollama for a reply while you prototype (the model name is whatever you pulled with Ollama):
# Child node: HTTPRequest
func _ready() -> void:
$HTTPRequest.request_completed.connect(_on_request_completed)
func ask_npc(player_line: String) -> void:
var body = JSON.stringify({
"model": "your-model",
"stream": false,
"messages": [
{"role": "system", "content": "You are Mira, a grumpy blacksmith in Oakvale. Reply in one or two short sentences. Never mention the real world."},
{"role": "user", "content": player_line}
]
})
$HTTPRequest.request("http://localhost:11434/api/chat", ["Content-Type: application/json"], HTTPClient.METHOD_POST, body)
func _on_request_completed(result, code, headers, body):
var reply = JSON.parse_string(body.get_string_from_utf8())["message"]["content"]
$Label.text = reply
var voices = DisplayServer.tts_get_voices_for_language("en")
if voices.size() > 0:
DisplayServer.tts_speak(reply, voices[0]) This is a local prototype only. For a game other people play, point the request at your own server, not at a paid API with a key inside the game.
Costs and API keys: the two ways beginners get burned
- Never put an API key in the game. Inworld's security docs say anything you ship to users can be inspected, including game builds, and that anyone with your key can make requests billed to your account. Treat any key that has ever been in a build as compromised and replace it. Use a small server of your own that holds the key, checks who is asking, and limits how often each player can talk.
- Every line costs money once you leave the free tier. Free allowances are small: 100 interactions a month on Convai Free, 10,000 credits on ElevenLabs Free, up to 70 minutes of TTS on Inworld On-Demand. Set a hard spending limit or a daily cap per player on your server.
- Plan how players pay for it. Steam's Content Survey FAQ (checked Oct 23, 2026) says that if your game connects to a Live-Generated AI service with ongoing costs, you manage access for players and collect any payment through a Steam-supported method. Valve's examples: build the cost into the game price, sell interactions as microtransactions, offer a subscription, or sell a DLC that unlocks unlimited interactions.
Latency: hiding the wait
Speech to text, the language model and text to speech each add waiting time, and the player feels all of it. What helps:
- Ask for one or two short sentences per reply. Shorter text is faster to generate and faster to speak.
- Stream the text into the dialogue box as it arrives instead of waiting for the full reply.
- Play a filler line or a thinking animation right away. Inworld's docs on responsiveness recommend short fillers like "let me think" while the main model warms up.
- Pre-record the lines every player hears (greetings, quest hand-ins) and only generate the open chat.
Guardrails and moderation
Players will try to make your NPC say awful things. Plan for it:
- A strict system prompt: who the NPC is, what it knows, what topics it must refuse, and a reply length limit.
- A moderation check: run the player's line and the NPC's reply through a filter before showing it. OpenAI's moderation docs (checked Oct 23, 2026) say its moderation endpoint is free to use and classifies text for categories like harassment, hate, self-harm, sexual content and violence. It needs an OpenAI API key, so call it from your server.
- A scripted fallback: if anything is flagged, the NPC says a safe in-character line, such as "I would rather not talk about that, traveler."
- Logs: keep a log of flagged conversations so you can tighten the prompt.
On Steam this is required, not optional. Steam's Content Survey says Live-Generated AI content must follow the same rules as everything else, and you must tell Valve what guardrails you use to ensure it is not generating illegal content. Valve also says it will not ship Live-Generated AI Adult Only Sexual Content at this time.
Before you ship: commercial use checklist
- Convai Free: 1 monthly active end user, so move to a paid plan before real players arrive.
- Inworld On-Demand: commercial license included, usage after the free allowance is billed.
- Charisma.ai: pay as you go, no free plan listed.
- ElevenLabs Free: no commercial license. Starter ($6/mo) or higher to sell your game.
- Ollama models and Piper voices: the software is free, but each model and voice has its own license. Check every one.
- Gemini API Free tier: Google says free tier content is used to improve its products.
- Steam: disclose Live-Generated AI in the Content Survey and describe your guardrails. More in Can I sell a game made with AI art?
Not legal advice. Plans and terms change often, so re-check each official page before you pay or ship.
Sources, checked Oct 23, 2026: Convai pricing, Convai Unity SDK docs, Convai Unreal plugin docs, Inworld pricing, Inworld Character Studio deprecation, Inworld security best practices, Charisma.ai pricing, Charisma docs, ElevenLabs pricing, Ollama on GitHub, Piper on GitHub, Gemini API pricing, OpenAI moderation guide, Godot text to speech, Steam Content Survey.
Related
Need voices for scripted lines? Read Best free AI tools for game voice acting. Building in Godot? See Build a Godot game with AI coding agents. New to all of this? Start with Make your first game with free AI tools. Browse every voice and dialogue tool and game design and writing tool on StarterLoot.
FAQ
Are AI NPCs free?
You can build and test them for free, but shipping them to real players usually costs money. Convai's Free plan (checked Oct 23, 2026) gives 100 interactions a month and only 1 monthly active end user. Inworld's On-Demand plan is $0 to start with up to 70 minutes of TTS included, then pay as you go. Running a model on your own computer with Ollama is free, but your players would need to run it too. The only truly free option for every player is pre-written dialogue voiced ahead of time, or Godot's built-in text to speech using the player's own system voices.
Can I use AI NPCs in a Steam game?
Yes, but you must disclose it. Steam's Content Survey (checked Oct 23, 2026) has a Generative AI section. Content made by AI while the game runs counts as Live-Generated, and Valve says you need to tell them what guardrails you use to make sure it is not generating illegal content. Valve also says that if your game connects to an AI service with ongoing costs, you must handle access for players and collect any payment with a Steam-supported method, for example by building the cost into the game price, microtransactions, a subscription or a DLC.
Which AI NPC tool works with Godot?
None of the three NPC platforms we checked list an official Godot plugin. Convai's docs cover Unity, Unreal Engine and web SDKs, Inworld's character templates were for Unity, Unreal and Node.js, and Charisma's SDKs cover Unity, Unreal, JavaScript and Python. In Godot, use the DIY approach: an HTTPRequest node that calls your own server (or a local Ollama for testing), plus Godot's built-in text to speech or pre-made voice files.
Can I put my API key in the game build?
No. Inworld's security docs say anything you ship to users can be inspected, including game builds, and that any credential that has ever been in a client build should be treated as compromised. Convai's Unity docs say any key shipped inside a client build is ultimately extractable. Keep keys on a small server you control, and have the game talk to that server.
Can I sell a game that uses ElevenLabs free plan voices?
No. ElevenLabs' pricing page (checked Oct 23, 2026) lists the Commercial License starting on the Starter plan at $6 a month. The Free plan gives 10,000 credits a month for testing. Inworld's free On-Demand plan does include a commercial license.
Why is my AI NPC so slow to answer?
Every step adds waiting time: turning the player's speech into text, waiting for the language model, then turning the reply into audio. Keep replies short, stream text as it arrives, and play a short filler line or a thinking animation while the model works. Inworld's docs suggest speaking short fillers like "let me think" while the main model warms up.
