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

> ## Agent Instructions
> To build and serve your own model, start at /deploy/development/quickstart and /deploy/development/overview. Deploying is the default path: reactor init scaffolds a workspace, reactor auth login authenticates, and reactor model deploy registers the model, publishes the release with the weights/ folder, and activates it on Reactor's GPUs, in one command from that workspace. Docker must be running, because the publish step builds the image locally. Bump model.version in reactor.yaml before redeploying a change, because a release that already has an image is reactivated as it is. Deployment access is granted per account, so contact team@reactor.inc if a deploy is refused. Every key in reactor.yaml is documented at /deploy/platform/reactor-yaml. Model code imports reactor_runtime; Python client code imports reactor_sdk. The runtime overview explains the model interface. Running the model on your own machine with reactor run is optional and needs a GPU you attach with --gpus; /deploy/development/local-testing covers that loop and pairs a complete brightness model with a Python client test in a separate brightness-test workspace.
> Reactor hosts multiple models, each with its own connect slug (modelName) and command/event schema. The video model catalog — slug, typed SDK package, and links to its schema — is at /model-api-reference/overview. Robotics policy documentation starts at /robotics/overview; The launch policies are Cosmos Nano DROID (/robotics/cosmos/nano-policy-droid/), DreamZero DROID (/robotics/dreamzero/droid/), and FLUX Action DROID (/robotics/flux-action/droid/), organized by model family and embodiment. Some models expose one slug per experience (e.g. HappyOyster); always take the slug from the model's own pages, never guess it.
> Fastest path to a working app: `npx create-reactor-app my-app --model=<slug>` scaffolds a complete app with secure auth wired up. Typed TypeScript SDKs are published as @reactor-models/<model>; Python uses the base reactor-sdk package.
> Auth: exchange an API key (rk_...) for a JWT via POST https://api.reactor.inc/tokens from your server. Never put the API key in client-side code.
> Append .md to any docs URL for clean Markdown. Search these docs via the MCP server at https://docs.reactor.inc/mcp.

# Pika H3 Flex prompt guide

> Write scenes for Pika H3 Flex with text, first and last frames, references, and continuation.

Pika H3 Flex makes a clip's picture and sound together, from one prompt. Say who or what appears,
what happens, how the camera moves, and what the viewer hears. Plain sentences work, and so does the
labeled structure below. The model uses your prompt exactly as you send it, without adding text or
rewriting it.

> [!TIP]
>
> Pika publishes its own [prompt guidance for H3
> Flex](https://github.com/Pika-Labs/Pika-H3-Flex/blob/main/docs/prompt-guidance.md), with complete
> examples. This guide follows it.

## Start with text alone

A prompt with no references is a complete request. Write the scene in the order it plays. First set
the look and say who is where. Then describe what happens and how it ends. Describe the camera and
the sound, and say so if you want silence or no music.

```text theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
A ceramic artist in a green apron sits at a pottery wheel in a sunlit studio. Warm natural light,
true colour, fine film grain.
[Shot 1] A wide shot. She shapes a blue bowl on the spinning wheel, then stops the wheel and lifts
the bowl to look at the glaze. The camera slowly pushes in toward her hands.
[Shot 2] At 00:05.000, cut to a close-up of her face. She smiles and says (S1),
<d>[English] This one is almost ready.</d>
Keep the artist, her apron, and the studio exactly the same in every shot. Nothing morphs.
Everything moves at normal real-time speed, with no slow motion.
Sound: the wheel hums, then slows to a stop. Rain taps the window.
Music: none.
```

Pika's own structure for a text-only clip has three fields: `integrated_multimodal_description` for
the picture, action, and synchronized sound, then `overall_soundscape` and `non_diegetic_music`.
Plain text like the example above works too.

`state_update.clip_seconds_choices` lists the allowed clip lengths, from 5 to 15.083 seconds. Set
`seconds` on `enqueue`, or read the current default from `state_update.clip_seconds`. Choose a
length that gives every shot time to play out.

## Plan shots and cuts

A clip can be one continuous shot or several shots joined by hard cuts.

* Begin with `[Shot 1]`, with no time.
* Start each later shot with its cut time, in order and within the clip length, for example
  `[Shot 2] At 00:04.000, cut to …`.
* In each shot, say who appears, where they are, and what they do.
* Use a cut for new information, such as a new place or angle. For a small change in distance or
  angle, move the camera instead.
* For a single take, write `one continuous shot`. For a fixed view, write
  `The camera remains fixed.`

Describe camera moves as plain sentences, with their size and speed: push in, pull out, pan, truck,
tilt, orbit, track, or hold. Give the start and end of the move:

```text theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
The camera slowly pushes in from in front of her, ending on a close-up of her face.
```

A push in moves the camera; a zoom changes the lens.

## Add guard lines

A few short lines fix common problems. Add the ones that apply near the end of the prompt:

| Problem | Line to add |
| - | - |
| Motion plays in slow motion | `Everything moves at normal real-time speed, with no slow motion.` |
| People or objects change shape | `Keep every person and object exactly the same in every shot. Nobody and nothing morphs.` |
| Scenes blend into each other | `Scene changes happen only on a hard cut, never as a morph or a dissolve.` |
| Unwanted text on screen | `No on-screen text, titles, captions, or subtitles.` |
| Speech does not match the mouth | `Real people speak with natural lip-sync.` |
| Sound is too quiet or muddy | `Mix the sound effects and music clearly and fully audible.` |
| Unwanted music or singing | `No music, no score, no singing.` |

A short style line also helps keep the look steady: the light, the colour, the lens, and the film
grain, for example `Soft daylight, muted 1970s film tones, fine grain.`

## Write dialogue and sound

Give each speaker a stable ID such as `(S1)` or `(S2)`, and put the spoken words in a dialogue tag
with their language: `<d>[English] It works again.</d>`. Describe who speaks and how outside the
tag, for example `He says in a quiet, raspy voice (S1), <d>[English] It works again.</d>`. If you
want only the lines you wrote, say so: `Only these two lines.`

Describe sounds where they happen in the shot. Then summarize the whole clip in two short lines:

* **Sound**: the ambience, physical sounds, and non-verbal human sounds. Do not repeat the dialogue.
* **Music**: the score only the viewer hears, with its instruments, speed, and changes in volume.
  Write `none` if there is no score. A radio or band that the characters can hear belongs in the
  shot description.

## First and last frames

Send `first_frame_image`, `last_frame_image`, or both to set how a clip opens and ends. Frame images
cannot share a clip with references. Describe the action that connects the two frames, and keep it
to one continuous shot unless you need a cut.

Pika's prompt for this mode begins with an alignment line, then uses the three text-only fields. In
the prompt, a single frame image is `<Picture 1>`. With both, the first frame is `<Picture 1>` and
the last frame is `<Picture 2>`. Write the clip's length with two decimals where the line asks for
it.

For a first frame only:

```text theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
For the target video, at 0.00 seconds into the target video, <Picture 1> (from [Shot 1]) is fully referenced.

integrated_multimodal_description:
[Shot 1] Begin from <Picture 1>. The potter presses her thumbs into the clay and opens it into a bowl.

overall_soundscape:
The wheel hums and wet clay squeaks under her fingers.

non_diegetic_music:
N/A
```

For a last frame only, `<Picture 1>` is the ending image:

```text theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
How the reference pictures align with the target video — <Picture 1> (from [Shot 1]) aligns with the 8.00-second mark of the target video.

integrated_multimodal_description:
[Shot 1] A lump of clay spins on the wheel. Her hands shape it into a tall vase. End with the subject and framing aligned with <Picture 1>.
```

For both frames:

```text theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
How the reference pictures align with the target video — <Picture 1> (from [Shot 1]) aligns with the 0.00-second mark of the target video; <Picture 2> (from [Shot 1]) aligns with the 8.00-second mark of the target video.

integrated_multimodal_description:
[Shot 1] Begin aligned with <Picture 1>. Her hands raise the clay into a cylinder, then open it into a wide bowl. End aligned with <Picture 2>.
```

The model rebuilds each frame image rather than pasting it, so the first or last frame comes close
to the image but is not an exact copy. It center-crops each image to the canvas, so keep the
important part of the picture near the middle.

## Use the six-field structure

For prompts with references, Pika recommends six fields, in this order: `subject_definitions`,
`summary`, `retention_analysis`, `detailed_description`, `overall_soundscape`, and
`non_diegetic_music`. The field names are prompt text, not API parameters. Start `summary` with a
task marker: `[reference generation]` for a new clip from references, or `[video continuation]` for
a clip that continues an earlier one. This example uses two images, a character and a setting:

```text theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
subject_definitions:
<Subject 1> is the character from <Picture 1>, retaining appearance and clothing.
<Subject 2> is the setting from <Picture 2>, retaining its layout and visual style.

summary:
[reference generation] <Subject 1> explores <Subject 2> in one continuous shot.

retention_analysis:
<Subject 1>: fully_preserved - keep the defined appearance and outfit.
<Subject 2>: fully_preserved - retain the defined setting.

detailed_description:
[Shot 1] <Subject 1> takes two slow steps through <Subject 2>, pauses and smiles.
The camera gently tracks forward. Keep one character and a coherent setting.

overall_soundscape:
Quiet environmental ambience and soft footsteps. No dialogue.

non_diegetic_music:
N/A
```

In `retention_analysis`, say how much of each subject to keep:

| Value | Use it to |
| - | - |
| `fully_preserved` | Keep the subject as it is in its reference. |
| `partially_preserved` | Keep the subject but change one part of it, such as its outfit. |
| `attribute_transfer` | Take only some features, such as a pose, a style, or an outfit, and apply them to another subject. |
| `weak_reference` | Keep only a broad idea, such as the mood of a room, and redesign the rest. |
| `removed` | Leave the subject out of the clip. |

These values apply only to the features you defined. If `subject_definitions` names only a face and
hair, a new background does not change whether the subject is `fully_preserved`.

## Name image references

Send up to 9 images in `reference_images`. In the prompt, `<Picture 1>` is the first image,
`<Picture 2>` is the second, and so on. Give each image one clear role: a person, an object, a
setting, or a style. Then name the details that matter, such as clothing or the layout of a room.
State the role firmly:

```text theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
<Picture 1> is the hero, a boy in a sky-blue knitted suit. He is always this boy.
```

A `<Subject N>` label lets later sentences refer back to the person or place from a picture. Use it
in the action and camera lines so the model connects them to the right reference.

Reference images guide appearance. They are not keyframes, so the clip does not start or end on an
exact image; describe the opening and closing moments in the prompt instead. If you reorder the
images, their labels change, so update the prompt to match.

Use `set_canvas` to choose the shape of the output. A reference image's shape does not set the
video's shape.

## Use reference videos

Reference videos are experimental. Send up to 3 in `reference_videos`, each 2 to 15 seconds long and
at most 15 seconds together. In the prompt, `<Video 1>` is the first video, `<Video 2>` is the
second, and so on.

Give each video one clear job, such as an action, a camera move, or a setting. Say what to take from
it and what to leave out:

```text theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
<Subject 1> is the woman from <Picture 1>, retaining her face, hair, and outfit.
<Subject 2> is the pedaling action from <Video 1>.
[Shot 1] <Subject 1> pedals a stationary bike indoors, with the cadence and posture of <Subject 2>.
Take only the motion from <Video 1>, not the rider or the room.
```

A video with sound also takes an audio label, just before its own place. With the default order, one
image, one video with sound, and one audio clip are `<Picture 1>`, `<Video 1>`, `<Audio 1>` for the
video's sound, and `<Audio 2>` for the audio clip. If the video has no sound, the audio clip is
`<Audio 1>`. Use a video without sound if you do not want its soundtrack to guide the clip.

## Give audio references a role

Send up to 3 audio clips in `reference_audios`. Each clip is 2 to 15 seconds long, and together they
last at most 15 seconds. The sound of a reference video does not count toward these limits. Without
reference videos, `<Audio 1>` is the first clip, `<Audio 2>` is the second, and so on.

Give each audio clip its own sentence that says whether it is a voice, a sound effect, or music. Tie
a voice to the person who uses it:

```text theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
<Subject 1> is the singer from <Picture 1>, in a small rehearsal room.
<Audio 1> is the voice of <Subject 1>.
[Shot 1] <Subject 1> faces the microphone and sings (S1), <d>[English] Stay with the morning light.</d>
The camera remains fixed.
Sound: her voice in a quiet room.
Music: a soft piano chord under her voice.
```

Put the words you want spoken or sung in the prompt, because a voice reference guides how the voice
sounds, not what it says.

In the six-field structure, say in `retention_analysis` how to use each audio clip:

| Value | Use it to |
| - | - |
| `fully_copy` | Use the whole recording as the clip's soundtrack. |
| `partially_copy` | Reuse a part of the recording, or add or remove sounds after copying it. |
| `reference` | Make new audio guided by the recording, such as a new line in the same voice. |
| `weak_reference` | Borrow only the kind of sound or the mood, such as a relaxed jazz feel. |

These values say what you intend. The model treats audio as guidance, so even `fully_copy` is not an
exact copy of the sample. Listen to each clip before you depend on an exact sound.

A request with reference audio must also include a reference image, a reference video, or a latent
continuation.

## Continue a clip

There are two ways to continue a clip. By default, `continue_from_clip_id` makes a latent
continuation: the last 2.33 seconds of the earlier clip, sound included, guide the start of the new
one, so motion, camera, and sound carry across the boundary. Set `continue_from_clip_id` to a clip
that has finished generating. Write a new action for the next clip, and say what stays the same:

```text theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
[Shot 1] The artist sets the blue bowl on a shelf and steps back to look at it.
Keep her green apron, the warm light, and the slow camera move.
Everything moves at normal real-time speed, with no slow motion.
Sound: the wheel hum fades while rain continues outside.
Music: none.
```

A latent continuation still accepts 3 uploaded audio clips. The continued sound takes the next label
after all your other audio labels, but it does not use an audio slot: `<Audio 1>` if you upload no
audio, or `<Audio 4>` if you upload three and no reference video. You can name it in the prompt, for
example `<Audio 2> continues the piano.` The end of the earlier clip counts as one of the 3
reference videos, so you can add at most 2 of your own.

For a latent continuation, the model keeps the 8 most recently generated clips. Continue a clip
before it expires. Continuation does not give the model long-term scene memory, and over many clips
the appearance and story can drift. Restate the important details in each prompt, and add reference
images to keep subjects steady.

### Continue from the last frame

A frame continuation, `continue_mode: "frame"`, opens the new clip on the last frame of the earlier
one. It takes a prompt only, with no references and no frame images. Only the picture carries over,
so the sound may restart at the boundary. You can queue it before the earlier clip has finished
generating, and you can use any clip in either queue or in `queue_update.history`.

Write it like a first-frame prompt: the earlier clip's last frame is `<Picture 1>`.

```text theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
For the target video, at 0.00 seconds into the target video, <Picture 1> (from [Shot 1]) is fully referenced.

integrated_multimodal_description:
[Shot 1] Begin from <Picture 1>. She lifts the bowl off the wheel and carries it to a shelf by the window.

overall_soundscape:
Footsteps on a wooden floor and rain on the window.

non_diegetic_music:
N/A
```

## Keep prompts within the budget

A prompt can have up to 2,048 text tokens, including the labels the model adds for each reference,
each frame image, and a continued clip. If a request goes over the budget, `enqueue` fails with
`request_rejected`, and the reason gives the count and the limit. The model never shortens a prompt
for you. Shorten it or remove references, and try again.

## Common fixes

| Problem | Fix |
| - | - |
| An action has no clear end | Describe the actions in order and state the final visible result: not `She stirs the coffee.` but `After stirring, she sets the spoon on the saucer.` |
| Two scenes run together | Put each scene in its own shot with a cut time: `[Shot 1]` in the cafe, then `[Shot 2] At 00:03.000, cut to` the coast. |
| References fight each other | Say what each image supplies: `Use <Picture 1> only for the composition and <Picture 2> only for her appearance.` |
| A whole reference image shows up | Name only the features to use and describe the new scene: `Use only the character's appearance. Show one character in a cafe, without panels or labels.` |
| The wrong person acts, or out of order | Name who does each action, in sequence: `She hands the pen to her colleague. The colleague takes it and signs.` |
| The wrong number of people appear | State the count and positions directly: `Four men stand around the car.` |

## See also

* [Pika H3 Flex overview](https://docs.reactor.inc/model-api-reference/pika-h3-flex/overview.md)
* [Pika H3 Flex schema](https://docs.reactor.inc/model-api-reference/pika-h3-flex/schema.md)
* [Pika H3 Flex tutorial](https://docs.reactor.inc/model-api-reference/pika-h3-flex/tutorial.md)
* [Commands and messages](https://docs.reactor.inc/concepts/commands-and-messages.md)
* [Pika's prompt guidance for H3 Flex](https://github.com/Pika-Labs/Pika-H3-Flex/blob/main/docs/prompt-guidance.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.