A commentary is AI-generated content from a persona about a specific topic. Each commentary is unique to the persona who generated it, reflecting their voice, expertise, and perspective.
Commentaries can be generated in multiple formats:
Format Description Use Case textWritten commentary Articles, social posts, embeds audioVoice-generated audio file Podcasts, audio players videoAvatar video with audio Video embeds, social media
Specify desired formats when creating a topic:
{
"content" : "Should the Lakers trade AD?" ,
"persona_ids" : [ "..." ],
"output_types" : [ "text" , "audio" ]
}
{
"commentary_id" : "comm-abc123-..." ,
"persona" : {
"id" : "persona-xyz-..." ,
"name" : "Coach Mike" ,
"image_url" : "https://..."
},
"content" : "Look, AD is still one of the best two-way players in the league..." ,
"audio_url" : "https://storage.unleeshed.ai/audio/comm-abc123.mp3" ,
"video_url" : null
}
Field Type Description commentary_idstring Unique identifier personaobject Persona who generated this contentstring Text content (always present) audio_urlstring | null URL to audio file (if requested) video_urlstring | null URL to video file (if requested)
Generation Time
Commentary generation is asynchronous. Typical times:
Output Type Generation Time Text only 30-60 seconds Text + Audio 60-90 seconds Text + Audio + Video 90-180 seconds
Start with text output for the fastest results, then add audio/video as needed.
Quality & Uniqueness
Each commentary is:
Unique - Generated fresh for each request (not cached)
Persona-authentic - Reflects the persona’s voice and style
Topic-relevant - Directly addresses the topic content
Safe - Filtered for inappropriate content
Fetch by Topic
The most common pattern - get all commentaries for a topic:
const response = await fetch (
`https://prod.api.unleeshed.ai/partner/v1/topics/ ${ topicId } /commentaries` ,
{ headers: { 'X-Api-Key' : apiKey } }
);
const { data } = await response . json ();
// data.commentaries = array of all completed commentaries
Display Multiple Perspectives
Show commentary from multiple personas on the same topic:
function TopicCommentaries ({ commentaries }) {
return (
< div className = "commentaries" >
{ commentaries . map ( c => (
< article key = { c . commentary_id } >
< header >
< img src = { c . persona . image_url } alt = { c . persona . name } />
< h3 > { c . persona . name } </ h3 >
</ header >
< p > { c . content } </ p >
{ c . audio_url && < AudioPlayer src = { c . audio_url } /> }
</ article >
)) }
< footer > Powered by Unleeshed </ footer >
</ div >
);
}
Generate Commentary Step-by-step guide to generating commentary.
Display Guide Best practices for displaying commentaries.