molroomolroo

Getting Started

Set up your first emotion-aware AI character in minutes.

Getting Started

Get up and running with molroo API in three steps.

Prerequisites

  • An API key (get one here)
  • Base URL: https://api.molroo.io/v1

The Fastest Path

// 1. Create a session with a preset
const { sessionId } = await fetch("https://api.molroo.io/v1/persona", {
  method: "POST",
  headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({ preset: "cheerful_companion" }),
}).then(r => r.json());
 
// 2. Send a message
const { prompt_data } = await fetch("https://api.molroo.io/v1/turn", {
  method: "POST",
  headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({ sessionId, message: "I had a terrible day" }),
}).then(r => r.json());
 
// 3. Use prompt_data in your LLM
const response = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [
    { role: "system", content: prompt_data.formatted.system_prompt },
    { role: "system", content: prompt_data.formatted.context_block },
    { role: "user", content: "I had a terrible day" },
  ],
});

That's it. See the Quick Start for the full walkthrough with curl, JavaScript, and Python examples.

What's Next

On this page