# Media Workflow Templates

> Browse the public FlyMy.AI media template catalog behind flymy.ai/media: fetch templates via one no-auth endpoint, open each as a live agent, clone it, and freeze your own endpoint.

The gallery at [flymy.ai/media](https://flymy.ai/media) is not a static showcase - every card is a **live agent** you can open, run, and clone. The catalog behind it is a public API: one unauthenticated GET returns every template, and each template's `chat_url` drops you into a working chat at `app.flymy.ai/agents/chat/{id}`.

The intended flow: pick a template, try it as-is, clone it to your account, adapt the prompt or model, then freeze it into your own deterministic endpoint.

## Browse the catalog

`GET https://backend.flymy.ai/api/v1/agents/media-workflow-templates/` - no auth required, CORS-open, so you can call it from a script or straight from a browser page.

**curl**

```bash
curl https://backend.flymy.ai/api/v1/agents/media-workflow-templates/
```

**JavaScript**

```javascript
const templates = await fetch(
  "https://backend.flymy.ai/api/v1/agents/media-workflow-templates/"
).then((r) => r.json());

for (const t of templates) {
  console.log(t.title, "->", t.chat_url);
}
```

The response is a JSON array of templates. Excerpt (trimmed to the fields you will actually use):

```json
[
  {
    "id": "headphones-vibe-ad",
    "slug": "headphones-vibe-ad",
    "title": "Headphones Vibe Ad",
    "tagline": "Upload a photo of any headphones and get a high-energy music-video style ad with a stylish presenter vibing to the beat.",
    "pipeline": ["Seedance 2.0"],
    "chat_url": "https://app.flymy.ai/agents/chat/mjn-rgwr-hzw",
    "preview_image": "",
    "preview_video": "https://storage.googleapis.com/..."
  }
]
```

| Field | Description |
|-------|-------------|
| `id` / `slug` | Stable template identifier |
| `title`, `tagline` | Card copy shown on [flymy.ai/media](https://flymy.ai/media) |
| `pipeline` | The models the template runs (e.g. `"Seedance 2.0"`) |
| `chat_url` | The live agent - `app.flymy.ai/agents/chat/{id}` |
| `preview_image`, `preview_video` | Preview media for the card |

> **Note: Build your own gallery**
>
> Because the endpoint is public and CORS-open, you can render this catalog inside your own product - fetch the list, show `preview_video`, link each card to its `chat_url`.

## Try a template

Open any `chat_url`. It is a real agent chat, not a demo recording: upload your product photo, send a message, and the template's pipeline runs against your input. As a reference point from real bills, a short video clip lands roughly at **$0.20-0.50** per run depending on the model.

## Clone, adapt, freeze

A template becomes yours in three steps:

1. **Clone** - from the template's chat page, clone the agent into your account. You now own an editable copy.
2. **Adapt** - change the prompt, swap the model in the pipeline, add your brand constraints. Run it until one run produces exactly what you want.
3. **Freeze** - freeze that run into a compilation. The frozen instruction replays a fixed plan: deterministic output, lower cost, lower latency, and re-runnable with fresh variables - your own media endpoint.

```python
from flymyai import AgentClient

client = AgentClient(api_key="fly-***")

# Freeze the run you are happy with
compilation = client.agents.compile_from_run(run.id, timeout=120)

# Re-run the frozen pipeline with a new input
result = client.compilations.run_instruction_and_wait(
    compilation.id,
    variables={"product_photo_url": "https://example.com/my-headphones.jpg"},
)
print(result.output)
```

See [Freeze & Re-run](https://docs.flymy.ai/agents/concepts/runs.md#freeze--re-run) for the full mechanics, including the plain REST equivalents (`POST /api/v1/agents/compilations/freeze-instruction/{execution_id}/` to freeze, `POST /api/v1/agents/compilations/{compilation_id}/run-instruction/` to run).

> **Tip: Templates are a head start, not a ceiling**
>
> The template's pipeline is just an agent configuration. After cloning you can attach different tools, chain extra steps (upscale, background removal, a second edit pass), or schedule the frozen compilation with cron - everything a hand-built agent can do.

## Drive it from your own client

Connected to the FlyMyAI Agents MCP gateway? The same lifecycle is available as tools - `copy_agent`, `run_agent`, `freeze_agent`, `run_frozen` - so Claude or any MCP client can clone and productionize a template for you. See [Connect Your Agent](https://docs.flymy.ai/agents/guides/connect-your-agent.md) to set that up, and [Generate Images & Video from Claude](https://docs.flymy.ai/agents/guides/generate-media-from-claude.md) for the media cookbook.
