Not much more to say... :)
ctools_include('context');
$panel_mini = panels_mini_load('my_minipanel_machinename');
// In this example the mini panel has two contexts: A displayed user argument (required) and the current logged in user.
$displayed_user_context = ctools_context_create('entity:user', $displayed_user);
$user_context = ctools_context_create('entity:user', $user);
$contexts = array($displayed_user_context, $user_context);
$context = ctools_context_match_required_contexts($panel_mini->requiredcontexts, $contexts);
drupal_alter('panels_mini_block_contexts', $context, $panel_mini);
$panel_mini->context = $panel_mini->display->context = ctools_context_load_contexts($panel_mini, FALSE, $context);
$panel_mini->display->css_id = panels_mini_get_id($panel_mini->name);
$content = panels_render_display($panel_mini->display);
?>