> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mosaic.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Mosaic API Documentation

> API reference for Mosaic's video editing workflows

# Mosaic API

Mosaic provides a powerful API for automating professional-grade video editing with AI-powered agents. Upload videos, run pre-built workflows, and receive polished outputs programmatically.

## Base URL

```text theme={null}
https://api.mosaic.so
```

## Core Concepts

### Agent

A pre-built video editing workflow that can be executed via the API. Create and configure agents at [edit.mosaic.so](https://edit.mosaic.so).

### Agent Run

An execution instance of an agent that processes your videos. Track progress and retrieve outputs through the run ID.

### Avatar Profile

A reusable AI Avatar identity created from a one-person source video, or an image plus clean single-speaker voice reference from the same person. Use the returned avatar profile ID in AI Avatar nodes.

### Triggers

Automated agent execution based on external events (e.g., new YouTube videos).

## API Overview

<CardGroup cols={2}>
  <Card title="Agents" icon="robot" href="/api/agents/creating-agents">
    Create and inspect agent templates
  </Card>

  <Card title="Agent Runs" icon="play" href="/api/agent-runs/post-agent-run">
    Execute agents and monitor progress
  </Card>

  <Card title="Avatar Profiles" icon="user-robot" href="/api/avatar-profiles/create-avatar-profile">
    Create and list reusable AI Avatars
  </Card>

  <Card title="Node Types" icon="grid-2" href="/api/agent-nodes/get-agent-nodes">
    Discover available node type IDs
  </Card>

  <Card title="Triggers" icon="bolt" href="/api/triggers/get-agent-triggers">
    Automate agents with YouTube monitoring
  </Card>

  <Card title="Webhooks" icon="webhook" href="/api/webhooks/events">
    Receive real-time status updates
  </Card>

  <Card title="Asset Management" icon="cloud-arrow-up" href="/api/asset-management/upload-flow">
    Upload and fetch signed view URLs for media
  </Card>

  <Card title="Credits" icon="coins" href="/api/credits/get-credits">
    Check credit balances
  </Card>

  <Card title="Plan" icon="wallet" href="/api/plan/get-plan">
    Inspect plans, pricing tiers, and upgrades
  </Card>

  <Card title="Social" icon="share-2" href="/api/social/post-social-connections">
    Connect accounts, publish posts, and read analytics
  </Card>
</CardGroup>

## Authentication

All API requests require authentication using an API key prefixed with `mk_`.

```bash theme={null}
curl -H "Authorization: Bearer mk_your_api_key" \
     https://api.mosaic.so/agent/[agent_id]/run
```

Test your API key with the `/whoami` endpoint:

```bash theme={null}
curl -H "Authorization: Bearer mk_your_api_key" \
     https://api.mosaic.so/whoami
```

## Next Steps

Start with the [API Introduction](/api/introduction) for authentication details and conventions, then explore each endpoint category.
