# Beatra Skill + MCP — Animate an image

> Turn one still image into motion, optionally following driving audio.
> Self-contained workflow guide for AI agents.
> Human-readable page: https://docs.beatra.ai/en/docs/capabilities/videos/image-to-video

- Primary surface: the Universal Beatra Skill with authenticated MCP.
- Install or reconnect: https://beatra.ai/install.md
- MCP endpoint: `https://mcp.beatra.ai/mcp`
- Billable action: `beatra.videos.animate`
- Dynamic model facts: call `beatra.models.list` with `capability: "image_to_video"` only when model constraints, controls, or prices matter.
- Interaction model: create one opaque `client_request_id`, submit the finalized arguments exactly once, then poll the returned `task_id` with `beatra.tasks.get` until terminal.
- Local media: call `beatra.assets.upload`, perform the returned HTTPS PUT exactly, and use the artifact ID from the PUT response.

REST/OpenAPI is the fallback protocol path, not the primary agent packaging.

---

## Primary agent path

Use `beatra.videos.animate` when one image defines the opening composition. If
both a first and last frame matter, use `beatra.videos.interpolate` instead.

1. Upload a local image and optional local audio with `beatra.assets.upload`.
2. Call `beatra.models.list` with `capability: "image_to_video"` when model
   constraints, audio support, or price matter.
3. Describe motion and camera behavior without contradicting the source image.
4. Submit once with one `client_request_id`, then poll with
   `beatra.tasks.get`.

## Tool arguments

```json
{
  "prompt": "The subject turns toward camera while the camera eases forward",
  "image": { "type": "artifact", "artifact_id": "artifact_first_frame" },
  "driving_audio": { "type": "artifact", "artifact_id": "artifact_optional_audio" },
  "resolution": "720p",
  "duration": 6,
  "client_request_id": "vid-animate-opaque-1"
}
```

`driving_audio` is optional. The image can also be a public HTTPS `url` media
reference or a `data_uri` whose complete encoded value is at most 256KB; use an
uploaded artifact for anything larger. Local filesystem paths are never valid
input.

## Models, controls, and cost

Common controls are `prompt`, `negative_prompt`, `resolution`,
`duration`, `aspect_ratio`, `seed`, `enhance_prompt`, and `watermark`.
Use each only according to the selected model's metadata.

Use `beatra.models.list` as the current source for accepted media combinations,
audio limits, resolutions, duration, derived aspect-ratio behavior, defaults,
and customer prices. Image-driven models may derive the output ratio from the
input and ignore `aspect_ratio`.

Resolution and duration normally affect cost. Do not silently reduce either.
Use `model: "auto"` unless the user names a selectable model.

### MiniMax H3

Set `model: "minimax-h3"` to animate an image with MiniMax H3. The prompt is
required, the output is 2K, duration is 4–15 seconds, and the output ratio is
derived from the input image. H3 accepts `watermark` but not driving audio or
the other optional controls. The input image is free and generated output costs
590 credits per second.

## Task status and recovery

Poll the same `task_id` through `queued` and `running`. If the create response
is lost, retry identical arguments with the same `client_request_id`; changed
image, audio, prompt, model, or output controls require a new ID. Terminal task
state is the only source for artifacts and billing.

## REST API

Direct protocol integrations may use `POST /v1/videos/image-to-video`. Follow
the generated [API operation](https://docs.beatra.ai/en/docs/api-reference/operations/videos/videos_i2v_v1_videos_image_to_video_post).
Skill + MCP is the recommended integration; REST serves custom applications.

---

## Appendix: shared Skill + MCP contract

### Retry identity

One logical generation has one `client_request_id`. If the create response is
lost, retry the exact same arguments with that ID. If any prompt, media, model,
or output control changes, use a new ID. Never create another paid task merely
because the first task is `queued` or `running`.

### Polling and billing truth

Poll with `beatra.tasks.get` using bounded backoff. Stop at `succeeded`,
`failed`, or `canceled`. Only the task response is authoritative for the
resolved model, artifacts, charged credits, and refunded credits.

### Recovery

Preserve structured Beatra error codes. Reconnect on authentication failure;
stop and request a balance action on insufficient balance; refresh current
constraints with `beatra.models.list` after model validation; request a new
upload grant after expiration or MIME/length mismatch. Changed generation
arguments always require a new `client_request_id`.
