Back to blog

Pika H3 Flex API Guide: Endpoints, Request Example, Pricing and Polling

Nov 1, 2026PikaH3Flex EditorialPikaH3Flex Editorial

How to call the Pika H3 Flex API: getting a key, the text-to-video and image-to-video endpoints, a working request and polling example, image uploads, prices per second and add-ons.

The Pika H3 Flex API is Pika’s hosted, pay-per-second interface to the model at dev.pika.art. You authenticate with an API key, submit a job to a mode-specific endpoint, then poll the job (or use webhooks) until the MP4 is ready. Prices start at $0.01 per output second. This guide shows the request shape we use in production on this site, plus the add-ons and prices listed on Pika’s model page.

Endpoint paths and fields below match our live integration as of November 2026. Pika’s API is new and may change; the dev.pika.art quick start is the source of truth.

What the API offers

Pika groups the Flex family “behind one key and a consistent request shape”:

ModelPrice listed on dev.pika.art
Text → Videofrom $0.01 / sec
Image → Videofrom $0.01 / sec
Reference → Videofrom $0.03 / sec
Draft → Videodraft price deducted
Prompt Rewriter$0.02 / request
Audio Stems$0.001 / sec

Per-second prices rise with resolution (480p is the cheapest; 1080p, 2K and 4K are upscaled). Full tables and worked examples are in our Pika H3 Flex pricing guide. The API is prepaid: you add a USD balance and successful jobs are charged against it.

Step 1: get an API key

Sign in at dev.pika.art, open the API section and create a key. Keep it on your server — never ship it in a browser or mobile app.

Step 2: submit a job

Base URL https://api.dev.pika.art, header X-API-Key. The mode is part of the path:

  • POST /v1/media/pika/pika-h3-flex/text-to-video
  • POST /v1/media/pika/pika-h3-flex/image-to-video
const resp = await fetch(
  'https://api.dev.pika.art/v1/media/pika/pika-h3-flex/text-to-video',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': process.env.PIKA_API_KEY,
      // Safe retries: the same key never creates a second job
      'Idempotency-Key': crypto.randomUUID(),
    },
    body: JSON.stringify({
      prompt:
        'A street drummer plays on an upturned bucket at dusk, handheld camera. Sound: crisp drum hits, city traffic.',
      duration: 5, // 5, 10 or 15
      resolution: '768p', // 480p, 768p, 1080p, 2k, 4k
      aspect_ratio: '9:16',
      rewrite: true, // let Pika expand the prompt
      seed: 42, // optional
      output_mode: 'video',
    }),
  }
);
const job = await resp.json(); // { id, status: 'queued' | 'running' | ... }

For image to video, call the image-to-video endpoint and add image (start frame URL), last_frame_image (end frame URL) or both.

Step 3: upload images (for image to video)

Frames are uploaded first, then referenced by URL:

  1. POST /v1/media/uploads with { "content_type": "image/png", "size_bytes": 123456 }.
  2. PUT the bytes to the returned upload_url (with the returned headers).
  3. Pass the returned url as image or last_frame_image.

Step 4: poll for the result

async function waitForJob(id) {
  for (;;) {
    const r = await fetch(`https://api.dev.pika.art/v1/media/jobs/${id}`, {
      headers: { 'X-API-Key': process.env.PIKA_API_KEY },
    });
    const job = await r.json();
    if (job.status === 'completed') return job; // contains the output file URL
    if (job.status === 'failed') throw new Error(job.error?.message);
    await new Promise((s) => setTimeout(s, 3000));
  }
}

Statuses are queued, running, completed and failed. For production, Pika also documents webhooks so you don’t have to poll. When downloading the output, only attach your API key to requests that go to Pika’s own API host, never to a presigned storage URL.

Production tips from running it

  • Use an idempotency key on every submit so network retries never bill twice.
  • Check balance before submitting and handle 401/403 (bad or unfunded key) and 422 (invalid input) separately from server errors.
  • Moderate prompts first. If you resell generation, screen prompts before calling the API so policy violations never reach the model.
  • Proxy downloads through your backend so the key stays private.
  • Refund users on failure — Pika only charges for successful generations, so failed jobs should cost your users nothing either.

API vs open weights vs a ready-made studio

Pika APIOpen weights (GitHub/Hugging Face)This site
You needCode + prepaid balance80 GB GPU + ~216 GB diskA browser
Resolutions480p–4K480p, 768p480p–4K
Audio stems, rewriterYesNoRewriter yes, stems no
Best forDevelopers building productsResearch, private pipelinesCreators and marketers

Self-hosting details are in the GitHub and Hugging Face guide. If you don’t want to write code, use text to video or image to video here.

FAQ

Is there an official Pika H3 Flex API? Yes, on dev.pika.art, with text, image and reference-to-video endpoints, a prompt rewriter and audio stems.

How much does the Pika H3 Flex API cost? From $0.01 per output second for text and image to video at the lowest resolution; reference-to-video from $0.03 per second.

Is the API synchronous? No. You submit a job and poll /v1/media/jobs/{id} or receive a webhook.

Can I get separate audio tracks? Yes, the Audio Stems add-on returns Dialogue, Score, SFX, Foley and Ambience for $0.001 per second.