Game SDK
Integrate Foil Engine NPC conversations into your game using API keys.
The Game SDK provides REST API endpoints for game developers to add NPC chat to their games. Authenticate with an API key instead of JWT tokens — no browser login required.
How it works
- Create an API key from the API Keys dashboard
- Pass the key in the
X-API-Keyheader on every request - Initialize a chat session, send messages, and receive NPC responses
API keys can only access your own published personas. Draft or unpublished personas are not available via the SDK.
Getting Started
Create an API key and make your first request.
Chat Endpoints
Initialize sessions, send messages, get history, and reset.
Client SDKs
Install a native SDK to skip the raw HTTP calls: