BobaBanana API

1080p and 4K videos: requirements, pricing and cost caps

POST /v1/videos with resolution set to 1080p or 2160p makes a sharper clip of 3 to 15 seconds in 16:9 or 9:16, made with premium rendering and priced from a live quote. The job holds the most it can cost when it is accepted and is charged what it really cost, never more. Send max_credits or dry_run: true first.

View as Markdown

At a glance

Endpoint
POST /v1/videos with resolution: 1080p or 2160p
Auth
Authorization: Bearer bb_...
Returns
202 with a job; output.video.url is an MP4
Length
3 to 15 s (10 at most with last_frame)
Shapes
16:9 and 9:16
Price keys
video_1080, video_2160 (live quote)
Price check
dry_run: true, or max_credits to cap it

Requirements#

  1. resolution: 1080p or 2160p (4K). The default is 720p.
  2. Length: duration_seconds from 3 to 15; with last_frame, 10 at most.
  3. Shape: aspect_ratio 16:9 or 9:16.
  4. No speech or soundtrack yet: voice, script and audio are refused. A sound_effect is fine.
  5. Settings: premium rendering must be allowed for the workspace. In the studio's Settings, "Make work quickly at busy times" must be on, and "Make work that shows people quickly at busy times" too when the video shows a person.

Every start works: image, last_frame, text to video with or without references, and extend_video.

Example#

curl
curl https://bobabanana.com/api/v1/videos \
  -H "Authorization: Bearer $BOBABANANA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "image": {
      "url": "https://example.com/car.png"
    },
    "motion": "slow orbit around the car",
    "resolution": "2160p",
    "aspect_ratio": "16:9",
    "duration_seconds": 8,
    "max_credits": 400
  }'
Python
import os
import uuid

import requests

r = requests.post(
    "https://bobabanana.com/api/v1/videos",
    headers={"Authorization": f"Bearer {os.environ['BOBABANANA_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
    json={
        "image": {
            "url": "https://example.com/car.png",
        },
        "motion": "slow orbit around the car",
        "resolution": "2160p",
        "aspect_ratio": "16:9",
        "duration_seconds": 8,
        "max_credits": 400,
    },
    timeout=60,
)
r.raise_for_status()
print(r.json())
JavaScript
const res = await fetch("https://bobabanana.com/api/v1/videos", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BOBABANANA_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    "image": {
      "url": "https://example.com/car.png"
    },
    "motion": "slow orbit around the car",
    "resolution": "2160p",
    "aspect_ratio": "16:9",
    "duration_seconds": 8,
    "max_credits": 400
  }),
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
console.log(await res.json());

How the price is set#

  1. When you send the job, BobaBanana gets a live quote for that resolution and length.
  2. The job holds cost.credits_estimate, the most it can cost; cost.video_price_key is video_1080 or video_2160 and cost.resolution names the resolution.
  3. When it succeeds, the job is charged what it really cost, never more than the estimate, and the rest is released.
  4. If the price rises above the accepted estimate before it renders, or the render fails, the job fails and its credits are released; send it again for a new price.

GET /v1/prices shows video_1080 and video_2160 with "pricing": "live_quote": their credits are the most they cost at the regular rate. Rely on the job's cost.credits_estimate.

Cap the cost#

Send max_credits with every 1080p and 4K job. A job that would cost more answers 400 cost_above_max with credits_estimate in the error, and nothing is held. To see the price without sending a job, use dry_run: true:

{
  "image": {
    "url": "https://example.com/car.png"
  },
  "motion": "slow orbit around the car",
  "resolution": "1080p",
  "duration_seconds": 8,
  "dry_run": true
}

The answer is 200 with a dry-run estimate (credits_estimate, enough_credits, video_price_key, resolution). Nothing is queued, held or stored. max_credits: 0 is not a free price check; use dry_run.

resolution_unavailable#

400 resolution_unavailable means 1080p or 4K cannot be made for this request or workspace now. The message says why:

  1. "Make work quickly at busy times" is off in Settings;
  2. the video shows a person and "Make work that shows people quickly at busy times" is off;
  3. the workspace reached its monthly spending limit for premium rendering;
  4. 1080p and 4K are not available right now.

Turn on the switch it names, use 720p, or retry later.

Errors for this page#

Errors for this page
Status Code Meaning What to do
400 cost_above_max The job would cost more than max_credits. credits_estimate gives the price. Raise max_credits to at least credits_estimate, or change the request (shorter, smaller, fewer steps).
400 fetch_failed Downloading a URL input failed or returned an HTTP error. Open the URL without cookies to check it; signed links may have expired.
400 invalid_image The image could not be opened, or it has too many pixels. Send a valid PNG, JPG or WEBP picture.
400 invalid_request A field is missing, has the wrong type or breaks a rule. param names the field. Type and range problems found while reading the body are 422 with the same code. Read error.param and error.message, fix that field and send again. Do not retry unchanged.
400 resolution_unavailable 1080p or 4K cannot be made for this request or workspace right now. Use 720p, or read the message for the setting or shape to change.
402 insufficient_credits The workspace's available credits are less than the job's estimate. required and available give both numbers. Add credits in the studio, or make a smaller job. Nothing was held.

Frequently asked questions#

Do 1080p and 4K videos wait in the queue?#

They do not wait in the studio's queue, but premium jobs are sent one at a time, so a job can still wait its turn. eta_seconds on the job estimates the wait.

Can a 4K video speak?#

Not yet. voice, script and audio are refused at 1080p and 2160p. Make the talking clip at 720p, or upscale a finished 720p video.

Why did my 4K job fail without a render error?#

The live price rose above the estimate the job was accepted at before it rendered. Its credits were released; send it again for a new price.

Is upscaling a cheaper way to get 1080p?#

Often. A finished 720p video can be upscaled with POST /v1/jobs/{job_id}/upscale; GET /v1/jobs/{job_id}/upscale-options gives the sizes and credits. A native 1080p or 4K render usually shows more detail.

Last updated · View as Markdown · llms.txt