# Pika H3 Flex

> Run Pika H3 Flex by pika online or via API. $0.02/sec 480p, $0.04/sec 768p, $0.07/sec 1080p, $0.08/sec 2K, $0.16/sec 4K; stems +$0.001/stem-sec, no setup.

**URL:** https://inference.sh/apps/pika/pika-h3-flex
**Last updated:** 2026-11-08

---

Pika H3 Flex video with synchronized audio. Text-to-video or first/last-frame image-to-video, 3-15s, native 480p/768p, upscaled 1080p, 2K and 4K. Optional dialogue, music and effect stems.

- app: `pika/pika-h3-flex`
- maker: [pika](https://inference.sh/apps/pika.md)
- category: [video](https://inference.sh/apps/category/video.md)
- input → output: text → video, image → video
- tasks: [text to video](https://inference.sh/apps/tag/text-to-video.md), [image to video](https://inference.sh/apps/tag/image-to-video.md), [first last frame](https://inference.sh/apps/tag/first-last-frame.md), [native audio](https://inference.sh/apps/tag/native-audio.md)
- price: $0.02/sec 480p, $0.04/sec 768p, $0.07/sec 1080p, $0.08/sec 2K, $0.16/sec 4K; stems +$0.001/stem-sec
- runs via: api, javascript and python sdk, belt cli, mcp

## pika-h3-flex API Guide

### About
pika h3 flex video with synchronized audio. text-to-video or first/last-frame image-to-video, 3-15s, native 480p/768p, upscaled 1080p, 2k and 4k. optional dialogue, music and effect stems.

### Get an API Key
Create one in [settings → api keys](https://app.inference.sh/settings/keys). The examples read it from `INFERENCE_API_KEY`.

```bash
export INFERENCE_API_KEY="inf_your_key"
```

### 1. Calling the API

#### Install the Client

```bash
pip install inferencesh
```

#### Run and Get Result
Submit a request and wait for the final result.

```python
import os
from inferencesh import inference

client = inference(api_key=os.environ["INFERENCE_API_KEY"])

## version @6abkym2g pinned
result = client.run({
        "app": "pika/pika-h3-flex@6abkym2g",
        "input": {
            "prompt": "A red fox trots along a frozen riverbank at dawn, breath steaming. 0-3s: low tracking shot beside the fox. 3-5s: it stops and looks straight into the lens. Sound: crunching snow, distant crows, no music."
        }
    })

print(result["output"])
```

#### Stream Live Updates
Get real-time progress updates as the task runs.

```python
import os
from inferencesh import inference

client = inference(api_key=os.environ["INFERENCE_API_KEY"])

## version @6abkym2g pinned
## stream=True yields updates as they arrive
for update in client.run({
        "app": "pika/pika-h3-flex@6abkym2g",
        "input": {
            "prompt": "A red fox trots along a frozen riverbank at dawn, breath steaming. 0-3s: low tracking shot beside the fox. 3-5s: it stops and looks straight into the lens. Sound: crunching snow, distant crows, no music."
        }
    }, stream=True):
    if update.get("progress"):
        print(f"progress: {update['progress']}%")
    if update.get("output"):
        print(f"output: {update['output']}")
```

#### Run in the Background
Start the task and get its id back right away, then check on it with `GET /tasks/{id}`. It is done when `status` is 10 (completed), 11 (failed) or 12 (cancelled).

```python
import os
from inferencesh import inference, TaskStatus

client = inference(api_key=os.environ["INFERENCE_API_KEY"])

## returns as soon as the task is created
task = client.run({
        "app": "pika/pika-h3-flex@6abkym2g",
        "input": {
            "prompt": "A red fox trots along a frozen riverbank at dawn, breath steaming. 0-3s: low tracking shot beside the fox. 3-5s: it stops and looks straight into the lens. Sound: crunching snow, distant crows, no music."
        }
    }, wait=False)

## later: read its current state
state = client.tasks.get(task["id"]).data
if state["status"] == TaskStatus.COMPLETED:
    print(state["output"])
```

### 2. Files

#### Automatic Upload

```python
## local file paths are automatically uploaded
result = client.run({
    "app": "pika/pika-h3-flex@6abkym2g",
    "input": {
        "image": "/path/to/local/image.png",  # detected & uploaded
        "audio": "https://example.com/audio.mp3",  # url passed through
    }
})
```

#### Manual Upload

```python
## upload and get a hosted URL
file = client.files.upload("/path/to/file.png")
print(file.uri)  # https://cloud.inference.sh/...
```

### 3. Schema

#### Input
- **prompt** (string) *required*: What happens in the video. Describe shots with time ranges (0-4s, 4-8s), camera moves, subjects, lighting and the sound (dialogue, ambience, music or 'no music').
- **image** (string): First-frame image (JPEG, PNG or WebP, up to 24 MiB and 40 MP). Resized and center-cropped to the output canvas.
- **last_frame_image** (string): Last-frame image, same limits as image. Can be used alone or together with image.
- **duration** (integer): Video length in whole seconds, 3 to 15. Billed per output second.
- **aspect_ratio** (string): Output aspect ratio. auto follows the prompt, or the first keyframe when one is given.
- **resolution** (string): 480p and 768p are native. 1080p, 2k and 4k generate at 768p and upscale once, keeping audio and frame rate.
- **rewrite** (boolean): Let Pika expand the prompt before generation. Turn off to use the prompt verbatim.
- **seed** (integer): Seed. 0 lets Pika choose.
- **audio_stems** (boolean): Also return the soundtrack split into Dialogue, Music and Effect WAV stems. Billed per stem second on top of the video.
- **stems_channel_mode** (string): Audio stems only. mono downmixes before separation; stereo keeps both channels.

#### Output
- **seed** (integer): Seed Pika used for this video.
- **stems** (array): Dialogue, Music and Effect WAV stems when audio_stems is on.
- **video** (string): Generated MP4 (H.264 + AAC, 24 fps).

## other video apps

- [Pika H3 Flex (self-hosted)](https://inference.sh/apps/pika/pika-h3-flex-oss.md): GPU time, billed per millisecond
- [Pika H3 Flex Upscale](https://inference.sh/apps/pika/pika-h3-flex-upscale.md): $0.05-$0.14/sec (480p src), $0.03-$0.12/sec (768p src); 1080p/2K/4K targets
- [Pika H3 Flex Reference to Video](https://inference.sh/apps/pika/pika-h3-flex-reference.md): $0.06/sec 480p, $0.12/sec 768p, $0.15/sec 1080p, $0.16/sec 2k, $0.20/sec 4k (output+input video sec). Stems: $0.001/sec
- [Gemini Omni 1.2 Flash](https://inference.sh/apps/google/gemini-omni-1-2-flash.md): $0.0232/sec 360p, $0.0695/sec 720p, $0.1043/sec 1080p, $0.2085/sec 4K, plus $1.50/M input and $9.00/M thinking tokens
- [VACE](https://inference.sh/apps/pruna/vace.md): $0.40/video

## faq

### how much does Pika H3 Flex cost?

$0.02/sec 480p, $0.04/sec 768p, $0.07/sec 1080p, $0.08/sec 2K, $0.16/sec 4K; stems +$0.001/stem-sec. you pay per run from your inference shell credits. no subscription is required.

### how do I run Pika H3 Flex via api?

call pika/pika-h3-flex with the javascript or python sdk, the rest api, or `belt app run pika/pika-h3-flex` from a terminal. the api reference on this page lists every input.

### who makes Pika H3 Flex?

Pika H3 Flex is made by pika and runs on inference shell. every pika app is listed at https://inference.sh/apps/pika.

### can my agent use Pika H3 Flex?

yes. agents call it as a tool through the inference shell mcp server (https://api.inference.sh/mcp), the belt cli or the sdk, and pay per run like you do.

### what are the alternatives to Pika H3 Flex?

other video apps on inference shell include Pika H3 Flex (self-hosted), Pika H3 Flex Upscale, Pika H3 Flex Reference to Video, Gemini Omni 1.2 Flash. they run through the same api, so switching is a one-line change.
