SDKs
Official client libraries for 7 languages. All SDKs provide a consistent interface for authentication, streaming, pagination, and error handling.
Supported Languages
Python
PyPI ↗pip install ensoulTypeScript
npm ↗npm install @ensoul-ai/sdkKotlin
GitHub ↗ai.ensoul:ensoul-sdkSwift
GitHub ↗Swift Package ManagerUnity / C#
GitHub ↗Unity Package Manager (Git URL)C++
GitHub ↗CMake FetchContentGodot / GDScript
GitHub ↗Plugin (addons/ensoul/)Installation
pip install ensoulPython requires 3.11 or newer
pip install ensoul fails with no compatible version. Check your version with python --version and upgrade if needed.Quick Example
All SDKs follow the same pattern: create a client, call resources.
Health Check
from ensoul import Ensoul
client = Ensoul() # reads ENSOUL_API_KEY from env
health = client.health.check()
print(f"API status: {health}")Chat with a Persona
from ensoul import Ensoul
client = Ensoul()
response = client.chat.send(
persona_id="persona-uuid",
message="What do you think about remote work?"
)
print(response.response)Features
Auto-Pagination
Iterate through large result sets automatically. All list endpoints return paginated results that the SDK handles for you.
Streaming Support
Real-time streaming for chat, aggregate queries, and simulations via Server-Sent Events.
Automatic Retries
Transient failures are retried with exponential backoff and jitter. Rate-limit headers are respected automatically.
Dual Authentication
Authenticate with API keys for server-to-server use, or OAuth tokens for user-facing applications.
Environment Variables
All SDKs read these environment variables as defaults when no explicit value is passed to the client constructor.
| Variable | Purpose | Default |
|---|---|---|
ENSOUL_API_KEY | API key for authentication | (none) |
ENSOUL_BASE_URL | API base URL | https://api.ensoul-ai.com |