Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/anil-matcha/open-generative-ai/llms.txt

Use this file to discover all available pages before exploring further.

Open Generative AI exposes three additional generation functions beyond image and video: generateAudio for AI audio synthesis, runClipping for automatic video highlight extraction, and runMotionGraphics for animated motion graphics. All three follow the standard submit-and-poll pattern and are accessible from the studio package’s muapi.js module.

generateAudio(apiKey, params)

Generates audio using an AI audio model. The function dynamically forwards all provided params to the model endpoint — the specific fields depend on the audio model selected.
apiKey
string
required
Your Muapi.ai API key.
params.model
string
required
Audio model ID. Use params._modelId or params.model to specify the model. The model ID maps to an endpoint in the audio model registry.
params.*
any
All additional params (except _modelId and onRequestId) are forwarded directly to the model endpoint. Refer to the specific model’s documentation on Muapi.ai for supported fields.
params.onRequestId
(requestId: string) => void
Optional callback invoked after submission with the request_id.
Returns: Promise<{ url: string, outputs: string[], status: string }>
import { generateAudio } from 'studio';

const result = await generateAudio('your-api-key', {
  model: 'audio-model-id',
  prompt: 'ambient forest sounds with birds chirping, peaceful',
  duration: 30,
  onRequestId: (id) => console.log('Audio request:', id)
});

console.log(result.url); // URL of the generated audio file

runClipping(apiKey, params)

Extracts AI-generated highlight clips from a long-form video. The model automatically identifies the most interesting segments and returns them as short clips — ideal for creating social media content from longer recordings.
apiKey
string
required
Your Muapi.ai API key.
params.video_url
string
required
URL of the source video to clip. Must be publicly accessible.
params.num_highlights
number
Number of highlight clips to extract. Defaults to 3.
params.aspect_ratio
string
Output aspect ratio for the clips. Defaults to 9:16 (vertical, suitable for Reels/TikTok/Shorts).
params.return_coordinates_only
boolean
When true, returns only the timestamp coordinates (start/end times) without rendering the output clips. Useful for preview or custom rendering workflows. Defaults to false.
params.onRequestId
(requestId: string) => void
Optional callback with the request_id after submission.
Returns: Promise<{ url: string, outputs: string[], status: string }> — the outputs contain URLs to the extracted highlight clips (or coordinate data if return_coordinates_only is true).
import { runClipping } from 'studio';

const result = await runClipping('your-api-key', {
  video_url: 'https://example.com/long-video.mp4',
  num_highlights: 3,
  aspect_ratio: '9:16',
  onRequestId: (id) => console.log('Clipping request:', id)
});

// result.outputs contains URLs to the highlight clips
console.log(result.outputs);
Timestamps-only mode:
const result = await runClipping('your-api-key', {
  video_url: 'https://example.com/webinar.mp4',
  num_highlights: 5,
  return_coordinates_only: true
});

// result contains timestamp coordinates, not rendered clips
console.log(result);

runMotionGraphics(apiKey, params)

Generates animated motion graphics from a text prompt. Produces looping or single-play animations suitable for backgrounds, overlays, and social media content.
apiKey
string
required
Your Muapi.ai API key.
params.prompt
string
required
Text prompt describing the motion graphics to generate.
params.aspect_ratio
string
Output aspect ratio. Defaults to 16:9.
params.duration_seconds
number
Duration of the animation in seconds. Defaults to 6.
params.onRequestId
(requestId: string) => void
Optional callback with the request_id.
Returns: Promise<{ url: string, outputs: string[], status: string }>
import { runMotionGraphics } from 'studio';

const result = await runMotionGraphics('your-api-key', {
  prompt: 'abstract flowing particles, deep blue and violet, cosmic atmosphere',
  aspect_ratio: '16:9',
  duration_seconds: 6
});

console.log(result.url);

runMotionGraphicsEdit(apiKey, params)

Edits an existing motion graphics result by request_id. Applies a new edit prompt while preserving the base animation.
apiKey
string
required
Your Muapi.ai API key.
params.request_id
string
required
The request_id of the original runMotionGraphics result to edit.
params.edit_prompt
string
required
Prompt describing the edits to apply to the existing animation.
params.aspect_ratio
string
Output aspect ratio. Defaults to 16:9.
params.duration_seconds
number
Duration in seconds. Defaults to 6.
params.onRequestId
(requestId: string) => void
Optional callback with the new request_id.
import { runMotionGraphics, runMotionGraphicsEdit } from 'studio';

// Step 1: generate base animation
const base = await runMotionGraphics('your-api-key', {
  prompt: 'swirling galaxy, deep space',
  duration_seconds: 6
});

// Step 2: edit it
const edited = await runMotionGraphicsEdit('your-api-key', {
  request_id: base.request_id,
  edit_prompt: 'add a bright supernova in the center',
  duration_seconds: 6
});

console.log(edited.url);

Build docs developers (and LLMs) love