Skip to main content
This guide gets you from zero to displaying licensed AI commentary in under 10 minutes.
Prerequisites: You need a Partner account with at least one licensed persona. Don’t have one? Contact sales.

Minute 1-2: Get Your API Key

1

Log into Partner Dashboard

Go to app.unleeshed.ai/partner and sign in.
2

Navigate to API Keys

Click DeveloperAPI Keys in the sidebar.
3

Create a New Key

Click Create API Key, name it “Quickstart Test”, and select these scopes:
  • personas:read
  • topics:submit
  • topics:read
4

Copy Your Key

Copy the key immediately — it’s only shown once!
pk_live_abc123...
Store your API key securely. Never expose it in client-side code.

Minute 3-4: Find Your Personas

Let’s see which personas you have access to.
curl -X GET "https://api.unleeshed.ai/partner/v1/personas" \
  -H "X-Api-Key: YOUR_API_KEY"
Response:
{
  "success": true,
  "data": [
    { "id": "pers_abc123", "name": "Coach Mike", "image_url": "https://..." },
    { "id": "pers_xyz789", "name": "Analytics Amy", "image_url": "https://..." }
  ]
}
Save those persona IDs — you’ll need them in the next step.

Minute 5-6: Create a Topic

Now let’s generate some commentary. Pick a hot sports topic and send it to your personas.
curl -X POST "https://api.unleeshed.ai/partner/v1/topics" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Should the Lakers trade Anthony Davis before the deadline?",
    "persona_ids": ["pers_abc123", "pers_xyz789"],
    "output_types": ["text"]
  }'
Response:
{
  "success": true,
  "data": {
    "topic_id": "top_98765",
    "personas_sent": 2,
    "status": "pending"
  }
}
Save the topic_id — you need it to fetch the commentaries.

Minute 7-8: Wait for Generation

Commentary generation takes 30-120 seconds. Let’s poll for completion.
# Poll every 15 seconds until status is "completed"
curl -X GET "https://api.unleeshed.ai/partner/v1/topics/top_98765" \
  -H "X-Api-Key: YOUR_API_KEY"
Output while waiting:
Status: in_progress (0/2 ready)
Status: in_progress (1/2 ready)
Status: completed (2/2 ready)

Minute 9-10: Display the Commentary

Now fetch and display the results!
curl -X GET "https://api.unleeshed.ai/partner/v1/topics/top_98765/commentaries" \
  -H "X-Api-Key: YOUR_API_KEY"
The Result:
Topic: Should the Lakers trade Anthony Davis before the deadline?

--- Coach Mike ---
Look, I've been in locker rooms for 30 years, and I can tell you — 
chemistry matters. AD is still one of the most talented big men in 
the game when he's healthy. But that's the thing, isn't it? "When 
he's healthy." You're talking about a franchise that's been to the 
Finals, won a championship with this core. But at some point, you 
gotta ask yourself: are we building around a player or building 
around a medical report?

--- Analytics Amy ---
Let's look at the numbers. Davis has played in just 56% of possible 
games over the past three seasons. However, when active, his impact 
metrics remain elite — top-5 in defensive win shares, +4.2 net rating. 
The question isn't whether AD is good, it's probability-weighted 
value. If you trade him, what's the expected return? Most models 
suggest the Lakers would be selling at a significant discount given 
his injury history and contract.

🎉 You Did It!

In 10 minutes, you’ve:
1

Created an API key

With the right scopes for commentary generation
2

Retrieved your licensed personas

So you know who can generate commentary
3

Submitted a topic

And selected which personas should respond
4

Fetched the results

Unique, high-fidelity commentary from each persona

What’s Next?


Complete Working Example

Here’s everything in one script:
const API_KEY = process.env.UNLEESHED_API_KEY;
const BASE_URL = 'https://api.unleeshed.ai/partner/v1';

async function generateCommentary(topic) {
  // 1. Get personas
  const personasRes = await fetch(`${BASE_URL}/personas`, {
    headers: { 'X-Api-Key': API_KEY }
  });
  const { data: personas } = await personasRes.json();
  
  console.log(`Found ${personas.length} licensed personas`);
  
  // 2. Create topic
  const topicRes = await fetch(`${BASE_URL}/topics`, {
    method: 'POST',
    headers: { 'X-Api-Key': API_KEY, 'Content-Type': 'application/json' },
    body: JSON.stringify({
      content: topic,
      persona_ids: personas.map(p => p.id),
      output_types: ['text']
    })
  });
  const { data: topicData } = await topicRes.json();
  
  console.log(`Topic created: ${topicData.topic_id}`);
  
  // 3. Wait for completion
  while (true) {
    const statusRes = await fetch(`${BASE_URL}/topics/${topicData.topic_id}`, {
      headers: { 'X-Api-Key': API_KEY }
    });
    const { data: status } = await statusRes.json();
    
    if (status.status === 'completed') break;
    console.log(`Waiting... (${status.summary.completed}/${status.summary.total_personas})`);
    await new Promise(r => setTimeout(r, 10000));
  }
  
  // 4. Get commentaries
  const commRes = await fetch(`${BASE_URL}/topics/${topicData.topic_id}/commentaries`, {
    headers: { 'X-Api-Key': API_KEY }
  });
  const { data: result } = await commRes.json();
  
  return result.commentaries;
}

// Run it!
const commentaries = await generateCommentary("Should the Lakers trade AD?");
commentaries.forEach(c => {
  console.log(`\n${c.persona.name}:\n${c.content}`);
});