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

# Agent SDK

> @livepeer/agent: CLI, library, and MCP server for building creative AI applications on Livepeer. AgentRunner, provider abstraction, ToolRegistry, and 40+ inference capabilities.

export const StyledStep = ({title, icon, titleSize = 'h3', iconColor = null, titleColor = null, children, className = '', style = {}, ...rest}) => {
  const styledTitle = titleColor ? <span style={{
    color: titleColor
  }}>{title}</span> : title;
  return <Step title={styledTitle} icon={icon} iconColor={iconColor || undefined} titleSize={titleSize} className={className} style={style} {...rest}>
      {children}
    </Step>;
};

export const StyledSteps = ({children, iconColor, titleColor, lineColor, iconSize = '24px', className = '', style = {}, ...rest}) => {
  const resolvedIconColor = iconColor || 'var(--accent-dark, #18794E)';
  const resolvedTitleColor = titleColor || 'var(--lp-color-accent)';
  const resolvedLineColor = lineColor || 'var(--lp-color-accent)';
  return <div className={['docs-styled-steps', className].filter(Boolean).join(' ')} style={style} {...rest}>
      <style>{`
        .docs-styled-steps .steps > div > div.absolute > div {
          background-color: ${resolvedIconColor};
        }
        .docs-styled-steps .steps > div > div.w-full > p {
          color: ${resolvedTitleColor};
        }
        .docs-styled-steps .steps > div > div.absolute.w-px {
          background-color: ${resolvedLineColor};
        }
        .docs-styled-steps .steps > div:last-child > div.absolute.w-px::after {
          content: '';
          position: absolute;
          bottom: 0;
          left: 50%;
          transform: translateX(-50%);
          width: 6px;
          height: 6px;
          background-color: ${resolvedLineColor};
          transform: translateX(-50%) rotate(45deg);
        }
      `}</style>
      <div>
        <Steps>{children}</Steps>
      </div>
    </div>;
};

export const CustomDivider = ({color = "var(--lp-color-border-default)", middleText = "", spacing = "default", style = {}, className = "", ...rest}) => {
  const spacingPresets = {
    default: {
      margin: "24px 0"
    },
    overlap: {
      margin: "-1rem 0 -1rem 0"
    },
    tight: {
      margin: "0 0 -1rem 0"
    },
    section: {
      margin: "0 0 -2rem 0"
    },
    sectionOverlap: {
      margin: "-1rem 0 -2rem 0"
    },
    deepOverlap: {
      margin: "-1rem 0 -1.5rem 0"
    }
  };
  const spacingStyle = spacingPresets[spacing] || spacingPresets.default;
  return <div role="separator" aria-orientation="horizontal" className={className} style={{
    display: "flex",
    alignItems: "center",
    ...spacingStyle,
    fontSize: style?.fontSize || "16px",
    height: "fit-content",
    ...style
  }} {...rest}>
      <span style={{
    marginRight: "var(--lp-spacing-px-8)",
    opacity: 0.2
  }}>
        <Icon icon="/snippets/assets/logos/Livepeer-Logo-Symbol-Theme.svg" />
      </span>
      <div style={{
    flex: 1,
    height: "1px",
    background: "var(--lp-color-border-default)",
    opacity: 0.4
  }}></div>
      {middleText && <>
          <Icon icon="circle" size={2} />
          <span style={{
    margin: "0 8px",
    fontWeight: "bold",
    color: color,
    opacity: 0.7
  }}>
            {middleText}
          </span>
          <Icon icon="circle" size={2} />
        </>}
      <div style={{
    flex: 1,
    height: "1px",
    background: "var(--lp-color-border-default)",
    opacity: 0.4
  }}></div>
      <span style={{
    marginLeft: "var(--lp-spacing-px-8)",
    opacity: 0.2
  }}>
        <span style={{
    display: "inline-block",
    transform: "scaleX(-1)"
  }}>
          <Icon icon="/snippets/assets/logos/Livepeer-Logo-Symbol-Theme.svg" />
        </span>
      </span>
    </div>;
};

export const LinkArrow = ({href, label, description, newline = true, borderColor, className = '', style = {}, ...rest}) => {
  const linkArrowStyle = {
    display: 'inline-flex',
    alignItems: 'center',
    justifyContent: 'center',
    gap: "var(--lp-spacing-1)",
    width: 'fit-content',
    ...borderColor && ({
      borderColor
    })
  };
  return <span className={className} style={style} {...rest}>
      {newline && <br />}
      <span style={linkArrowStyle}>
        <a href={href} target="_blank" rel="noopener noreferrer">
          {label}
        </a>
        <Icon icon="arrow-up-right" size={14} color="var(--lp-color-accent)" />
      </span>
      {description && description}
      {description && <div style={{
    height: "var(--lp-spacing-3)"
  }} />}
    </span>;
};

<CenteredContainer preset="readable90">
  <Tip>@livepeer/agent installs as a CLI, imports as a library, and runs as an MCP server. All three modes share the same underlying AgentRunner and ToolRegistry.</Tip>
</CenteredContainer>

***

`@livepeer/agent` is the agent runtime package from the Storyboard project (`livepeer/storyboard`). It provides a provider-agnostic agent loop, 40+ Livepeer inference capabilities as callable tools, working and session memory, and an MCP server mode for integration with Claude Code, Cursor, and other MCP-compatible tools.

API key from `daydream.live`.

<CustomDivider />

## Installation

**One-line installer (CLI on PATH + MCP auto-config):**

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
curl -fsSL https://storyboard.daydream.monster/install.sh | bash
livepeer setup --non-interactive --api-key sk_live_xxx
```

The installer drops `livepeer` on your PATH and configures Claude Code / Cursor MCP entries automatically.

**npm (once 1.0.0 is published):**

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
npm install -g @livepeer/agent
```

**Homebrew (macOS):**

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
brew install livepeer/tap/livepeer-agent
```

<CustomDivider />

## CLI Verbs

The CLI exposes verbs for inference, file handling, finishing, and memory:

**Inference:**

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
# Single model call
livepeer run flux-schnell --prompt "a cat astronaut on Mars"
# → https://v3b.fal.media/files/.../image.jpg

# Animate a still image
livepeer cinemagraph ./portrait.jpg --motion "leaves drifting"

# JSON output (for scripts)
livepeer run flux-schnell --prompt "..." | jq '.url'
```

**Finishing (FFmpeg-backed):**

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
livepeer concat clip1.mp4 clip2.mp4 --transition crossfade-300
livepeer mux video.mp4 audio.mp3 --mode replace
livepeer caption video.mp4 --text "Hello" --start 0 --end 3
livepeer export video.mp4 --preset tiktok-portrait
```

**Discovery:**

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
livepeer models              # list all 40+ capabilities
livepeer models flux         # inspect a specific model
livepeer pricing flux-schnell
livepeer schema seedance-i2v
```

**Memory:**

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
livepeer memory pin "always use seedance-i2v-fast for animations"
livepeer memory recall "animation"
livepeer memory show
```

All verbs emit JSON when stdout is piped. Use `--json` to force JSON on a TTY or `--no-json` to force human output when piped.

<CustomDivider />

## Library API

```typescript theme={"theme":{"light":"github-light","dark":"dark-plus"}}
import {
  AgentRunner,
  ToolRegistry,
  WorkingMemoryStore,
  SessionMemoryStore,
} from '@livepeer/agent';
import { GeminiProvider } from '@livepeer/agent/providers/gemini';

const provider = new GeminiProvider({ apiKey: process.env.GEMINI_API_KEY! });
const tools = new ToolRegistry();
const runner = new AgentRunner(
  provider,
  tools,
  new WorkingMemoryStore(),    // 800-token budget per turn
  new SessionMemoryStore(),    // queryable log across turns
);

const result = await runner.run({ user: 'generate an image of a mountain' });
console.log(result.finalText);
```

**Importing individual verbs** (without the full agent loop):

```typescript theme={"theme":{"light":"github-light","dark":"dark-plus"}}
import { runRun } from '@livepeer/agent/cli/verbs/run';
import { runConcat } from '@livepeer/agent/cli/verbs/finishing';

const result = await runRun({
  name: 'flux-schnell',
  prompt: 'a mountain at dawn',
  apiKey: process.env.DAYDREAM_API_KEY,
});
```

**Provider swap:** change the LLM backend without changing application code:

```typescript theme={"theme":{"light":"github-light","dark":"dark-plus"}}
import { ClaudeProvider } from '@livepeer/agent/providers/claude';
import { LivepeerProvider } from '@livepeer/agent/providers/livepeer';

// Claude directly
const provider = new ClaudeProvider({ apiKey: process.env.ANTHROPIC_API_KEY! });

// All LLM calls through Livepeer infrastructure (one API key)
const provider = new LivepeerProvider({ apiKey: process.env.DAYDREAM_API_KEY! });
```

<CustomDivider />

## MCP Server Mode

`@livepeer/agent` runs as an MCP server over stdio, exposing all 40+ inference capabilities as MCP tools to Claude Code, Cursor, and any other MCP host:

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
livepeer mcp
```

Add to Claude Code (`~/.claude/claude_desktop_config.json`):

```json theme={"theme":{"light":"github-light","dark":"dark-plus"}}
{
  "mcpServers": {
    "livepeer": { "command": "livepeer", "args": ["mcp"] }
  }
}
```

The one-line installer configures this automatically. Once connected, Claude Code can call `livepeer` tools directly: `run flux-schnell`, `cinemagraph`, `concat`, `detect`, and all other CLI verbs are available as MCP tool calls.

<CustomDivider />

## Configuration

Credentials live in `~/.livepeer/credentials`:

```
DAYDREAM_API_KEY=sk_live_xxx
LIVEPEER_SDK_URL=https://sdk.daydream.monster
```

Environment variable overrides take highest precedence: `LIVEPEER_API_KEY` or `DAYDREAM_API_KEY`, and `LIVEPEER_SDK_URL`.

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
livepeer setup show    # print current config (key redacted)
livepeer version
livepeer update
```

<CustomDivider />

## Skills

Skills are markdown system prompt files that shape agent behaviour for specific tasks. The public registry is browsable and installable from the CLI:

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
livepeer skills list
livepeer skills install cinemagraph
livepeer skills install --all
livepeer docs "animate portrait"    # search registry by keyword
```

Installed skills live in `~/.livepeer/skills/*.md` and are loaded automatically by the agent runner when relevant.

<Note>
  `@livepeer/agent` is under active development through multiple phases (C8 is the current stable milestone). The CLI verb argument shapes and output shapes are frozen at C8; later phases (D–L) add new verbs without breaking existing ones.
</Note>

<CustomDivider />

## Related Pages

<CardGroup cols={2}>
  <Card title="Storyboard" icon="palette" href="/v2/developers/build/ai-and-agents/agents/storyboard" arrow horizontal>
    The reference application built on @livepeer/agent and @livepeer/creative-kit.
  </Card>

  <Card title="MCP and Livepeer" icon="plug" href="/v2/developers/build/ai-and-agents/ecosystem-mcp/overview" arrow horizontal>
    Connecting Claude Code, Cursor, and other MCP tools to Livepeer.
  </Card>

  <Card title="Agents Overview" icon="robot" href="/v2/developers/build/ai-and-agents/agents/overview" arrow horizontal>
    Eliza integration and BYOC agent patterns.
  </Card>

  <Card title="AI Pipelines" icon="cpu" href="/v2/developers/build/ai-and-agents/ai-pipelines" arrow horizontal>
    The underlying inference endpoints the agent SDK routes through.
  </Card>
</CardGroup>
