---
title: "Make a finished ad from Claude Code"
description: "Connect Claude Code to the roasOS MCP server, import a product from its link, and let the roasOS agent write, storyboard and render one finished ad."
url: https://docs.roasos.com/workflows/claude-code-finished-ad
---

# Make a finished ad from Claude Code

This recipe starts in Claude Code and ends with one finished video ad: the clips joined, a music bed under the speech, and captions. You give one instruction. The roasOS agent writes the script, draws the storyboard, picks the models and renders the ad under the caps that you set.

You need a roasOS plan with credits and an API key. Make the key in your [workspace settings](https://www.roasos.com/settings/workspace).

## 1. Connect

```bash
claude mcp add --transport http roasos https://mcp.roasos.com/mcp \
  --header "Authorization: Bearer $ROASOS_API_KEY"
```

Type `/mcp` in Claude Code. The roasOS server shows, with tools that start with `roasos_`. Refer to [Connect an AI agent (MCP)](/mcp) for the other clients.

## 2. Check the spend policy

Ask Claude to call `roasos_get_limits`. Read `auto_approve_up_to_credits`.

* When the value is 0, the key cannot start an agent run. `roasos_agent_ask` answers `402 approval_required`, and nothing runs or charges. Raise the value in the spend policy of your key first.
* When the value is higher, a run approves a paid step itself if its price fits inside this value and inside the run's `generation_spend_cap_credits`. The caps of one run must also fit inside this value.
* A paid step that does not fit waits for a person. The person approves it in the roasOS app, on the card in the run's thread.

Nothing spends without one of these approvals. A connected model can decline an approval. It can never approve one. Refer to [Money](/mcp#money).

## 3. Add the product from its link

Ask Claude to call `roasos_create_product` with `import_from_url` set to the product page (for example a Shopify product link). roasOS reads the page, imports up to ten photos, and fills the name, the description and the brand. The facts and the product reference sheet then build in the background. The call is free.

Keep the `id` from the answer.

## 4. Give the agent one instruction

Ask Claude to call `roasos_agent_ask`. Put everything that you want in `text`: the product, the format, the length, the person and the tone.

```json
{
  "text": "Make a 15 second unboxing ad for product 3f9c…, with my avatar Mia. Playful tone, 9:16. Render it with no frame review.",
  "generation_spend_cap_credits": 150,
  "quote_only": true
}
```

Read `credits_max` in the answer. Then send the same body with the `quote_id` in place of `quote_only`. The run starts and answers `202`.

What the agent does:

1. It reads the product facts and your brand.
2. It writes the script in the named format, with a hook in the first 3 seconds, the product on screen by 3 seconds and one call to action, and it checks each claim against the product facts.
3. It drafts the storyboard, casts the person and the product, and prices every shot on one approval card.
4. It renders the shots, joins them, mixes a music bed under the speech, and burns in captions.

Name a format to get its beat structure: product review, how-to, unboxing, product showcase, try-on, TV spot, before and after, duo UGC, green-screen reaction, reply to a comment, gift reaction, podcast clip, street interview or song ad. Refer to [Agent](/agent) for the looks and the product effects.

<Callout type="warn">
  With one cast person, the storyboard renders one frame for each shot first. The frames wait for a person to approve them in roasOS. Write "no frame review" or "one take" in the instruction to render straight through from an unattended run.
</Callout>

## 5. Follow the run

Ask Claude to call `roasos_get_agent_run_status` until the status is terminal. `roasos_get_agent_run_events` shows each step. When the run lists an approval in `pending_approvals`, open its `approve_url`. It names the run's thread in the roasOS app: approve the card there. Your own software can also approve it with `POST /v1/agent-runs/{id}/gates/{gate_id}/approve`.

The render takes a few minutes. Do not ask Claude to poll every second.

## 6. Get the ad

Ask Claude to call `roasos_get_agent_run_result`. The answer says what the agent made. Then call `roasos_list_generations`. The newest video is the finished ad. The shot clips are there too, so an editor can cut a new version.

roasOS checks each frame and each clip for a wrong person, a warped or misspelled label, garbled text and broken lip-sync. A failed check is advice only. Ask the agent for a new render of one shot. That render is a new approval.

## Next

* Make more versions: ask for three hooks on three angles on the same storyboard.
* Put the ad in front of people: refer to [Meta Ads with roasOS in Claude](/workflows/meta-ads-with-claude).
