Open app
Moonborn — Developers

Quickstart

Generate your first persona in five minutes.

1. Get an API key

Sign up at moonborn.co and navigate to Settings → API keys → New key. Two prefixes exist:

  • sk_test_* — bound to a test workspace; isolated from production data.
  • sk_live_* — production. Treat it like a database password.

Store the key in an environment variable:

export MOONBORN_API_KEY=sk_live_...

2. Create a persona

3. Start a chat session

const session = await client.chat.sessions.create({
 personaId: persona.id,
});
 
const message = await client.chat.messages.create({
 sessionId: session.id,
 content: 'What drives you?',
});
 
console.log(message.content); // Persona responds in its own voice

4. Monitor voice drift

Each chat response includes a driftScore — how far the persona has drifted from its voice fingerprint. A score above the workspace threshold (default 0.30) triggers an alert.

{
 "driftScore": 0.12,
 "driftThreshold": 0.30,
 "driftAlert": false
}

Tip — set engine.pipeline.drift_detection.threshold in your workspace config to tune the alert threshold per use case. Use 0.20 for brand-safe support, 0.45 for creative play.

Next steps

  • API reference — full REST API documentation for personas, chat, and webhooks.
  • TypeScript SDK — type-safe SDK for Node.js and browsers.
  • Python SDK — SDK for Python applications.
  • Webhooks — HMAC-signed delivery with five retries and a dead-letter queue.