BobaBanana API

BobaBanana API objects: jobs, files, assets, errors and events

Every object the BobaBanana API sends or accepts, with its fields and an example. Field lists are generated from the OpenAPI spec, so they match what the API sends.

View as Markdown

Job#

The Job schema.

Job
Field Type Description
id string
object "job"
type one of image, video, speech, sound_effect, image_upscale, video_upscale
status one of queued, running, succeeded, failed, canceled
created integer
finished integer
input object What the job was made from, as stored: uploads by file_id, assets by @handle
output JobOutput Result links once the job has succeeded; empty before
error JobError
cost JobCost
webhook JobWebhook Delivery state when the job was created with a webhook_url, else null
eta_seconds integer (optional) Unfinished jobs: estimated seconds until it finishes
poll_after_seconds integer (optional) Unfinished jobs: a good wait before the next poll
warnings list of string (optional) Succeeded jobs: steps that did not deliver (their credits were released)
metadata object of string (optional) Your metadata, echoed back
source_job_id string (optional) Upscale jobs: the job whose result is upscaled
output_size OutputSize (optional) Upscale jobs: the size of the result
notice string (optional) Upscale jobs: set while the upscale cannot start yet; the job waits
{
  "id": "x_8d21c0f4a9b3",
  "object": "job",
  "type": "image",
  "status": "succeeded",
  "created": 1764950400,
  "finished": 1764950472,
  "input": {
    "reference_images": [
      {
        "file_id": "file_3f9c2a1b7d4e",
        "label": "a mustard yellow three-seat sofa"
      }
    ],
    "assets": [],
    "prompt": "the sofa in a sunlit loft, morning light, wide shot",
    "aspect_ratio": "16:9"
  },
  "output": {
    "image": {
      "url": "https://bobabanana.com/api/v1/files/content/...",
      "content_type": "image/png"
    }
  },
  "error": null,
  "cost": {
    "credits_estimate": 4,
    "credits_charged": 4,
    "credits_released": 0,
    "status": "charged"
  },
  "webhook": null
}

Job cost#

The JobCost schema.

Job cost
Field Type Description
credits_estimate integer Credits reserved when the job was accepted
credits_charged integer
credits_released integer Credits returned for steps that did not deliver
status one of held, charged, released, partly_charged, exempt
video_price_key string (optional) Videos: the price used, e.g. video, video_ref (references), video_frames (first + last frame), video_1080 or video_2160
resolution one of 720p, 1080p, 2160p (optional) Videos: the resolution the job was quoted and is made at
{
  "credits_estimate": 18,
  "credits_charged": 0,
  "credits_released": 0,
  "status": "held",
  "video_price_key": "video",
  "resolution": "720p"
}

Job output#

Signed result links, by kind; only the kinds the job makes are present.

Job output
Field Type Description
image Link (optional)
video Link (optional)
speech Link (optional)
sound_effect Link (optional)
{
  "image": {
    "url": "https://bobabanana.com/api/v1/files/content/...",
    "content_type": "image/png"
  }
}

The Link schema.

Result link
Field Type Description
url string Signed download URL, valid for at least 24 hours; fetch the job again for a fresh one
content_type string
{
  "url": "https://bobabanana.com/api/v1/files/content/...",
  "content_type": "image/png"
}

Job error#

The JobError schema.

Job error
Field Type Description
code string render_failed or canceled
message string
steps object of string (optional) render_failed: what went wrong in each failed step
{
  "code": "render_failed",
  "message": "The picture step failed.",
  "steps": {
    "image": "The picture step failed."
  }
}

Job webhook state#

The JobWebhook schema.

Job webhook state
Field Type Description
status one of pending, delivered, failed, suppressed
attempts integer
last_status integer (optional) HTTP status your endpoint returned on the last attempt
{
  "status": "delivered",
  "attempts": 1,
  "last_status": 200
}

Webhook event#

The body of a webhook POST.

Webhook event
Field Type Description
id string Event id, e.g. evt_a81c2e0d9f11; the same on every retry and replay
object "event"
type one of job.succeeded, job.failed, job.canceled
created integer
data Job
{
  "id": "evt_a81c2e0d9f11",
  "object": "event",
  "type": "job.succeeded",
  "created": 1764950473,
  "data": {
    "id": "x_8d21c0f4a9b3",
    "object": "job",
    "type": "image",
    "status": "succeeded",
    "created": 1764950400,
    "finished": 1764950472,
    "input": {
      "reference_images": [
        {
          "file_id": "file_3f9c2a1b7d4e",
          "label": "a mustard yellow three-seat sofa"
        }
      ],
      "assets": [],
      "prompt": "the sofa in a sunlit loft, morning light, wide shot",
      "aspect_ratio": "16:9"
    },
    "output": {
      "image": {
        "url": "https://bobabanana.com/api/v1/files/content/...",
        "content_type": "image/png"
      }
    },
    "error": null,
    "cost": {
      "credits_estimate": 4,
      "credits_charged": 4,
      "credits_released": 0,
      "status": "charged"
    },
    "webhook": null
  }
}

File#

The FileObject schema.

File
Field Type Description
id string
object "file"
type one of image, audio
name string
bytes integer
created integer
expires_at integer (optional) Deleted after this unless a job uses it
width integer (optional)
height integer (optional)
duration number (optional)
warnings list of string (optional)
url string (optional)
{
  "id": "file_3f9c2a1b7d4e",
  "object": "file",
  "type": "image",
  "name": "sofa.jpg",
  "bytes": 482113,
  "created": 1764950300,
  "expires_at": 1765036700,
  "width": 1600,
  "height": 1067,
  "warnings": []
}

Asset#

The Asset schema.

Asset
Field Type Description
id string
object "asset"
handle string
name string
kind string
description string
tags list of string
version integer
preview_url string (optional)
sample_url string (optional) Voices only, with ?include=sample
{
  "id": "a_19be7c3d5f20",
  "object": "asset",
  "handle": "@maya",
  "name": "Maya",
  "kind": "human",
  "description": "A woman in her thirties with short red hair",
  "tags": [
    "cast"
  ],
  "version": 3,
  "preview_url": "https://bobabanana.com/api/v1/files/content/..."
}

Error#

The error. Some codes add fields: insufficient_credits adds required and available, cost_above_max adds credits_estimate, too_many_attempts adds retry_after.

Error
Field Type Description
code string Stable code for programs to read, e.g. insufficient_credits. Every code is listed at https://bobabanana.com/docs/api/errors/
message string
param string (optional) The request field at fault, when there is one
docs string
required integer (optional) insufficient_credits: the credits the job needs
available integer (optional) insufficient_credits: the credits available now
credits_estimate integer (optional) cost_above_max: what the job would cost
{
  "code": "insufficient_credits",
  "message": "Needs 120 credits, you have 40.",
  "required": 120,
  "available": 40,
  "docs": "https://bobabanana.com/docs/api/errors/"
}

Dry-run estimate#

What a create request would cost, from dry_run: true. Nothing is queued, held or stored.

Dry-run estimate
Field Type Description
object "estimate"
dry_run true
type one of image, video, speech, sound_effect, image_upscale, video_upscale
credits_estimate integer Credits the job would hold if sent now: the most it can cost
credits_available integer Your workspace's credits_available now
enough_credits boolean Whether the job would be accepted now as far as credits go
billing_mode one of credits, exempt
within_max_credits boolean (optional) When max_credits was sent: whether the estimate is within it
video_price_key string (optional) Videos: the price used
resolution one of 720p, 1080p, 2160p (optional)
{
  "object": "estimate",
  "dry_run": true,
  "type": "video",
  "credits_estimate": 120,
  "credits_available": 950,
  "enough_credits": true,
  "billing_mode": "credits",
  "within_max_credits": null,
  "video_price_key": "video_1080",
  "resolution": "1080p"
}

Motion transfer estimate#

The VideoEstimate schema.

Motion transfer estimate
Field Type Description
object "estimate"
credits_estimate integer What the job would hold now: the most it can cost
duration_seconds integer
scenes integer How many scenes (shots between cuts) the clip has; 1 for a continuous clip
scenes_made integer How many of them are made: all of them, or 1 with first_shot_only
scene_seconds list of number Each scene's length in seconds, in order
price_multiplier number 1.5 when several scenes are made (each is made on its own and joined), else 1
normal_credits integer (optional) What one continuous clip of the same length costs, before the multiplier
first_shot_only boolean
reason string (optional) Why the price is higher, e.g. 'This clip has 3 scenes'
{
  "object": "estimate",
  "credits_estimate": 150,
  "duration_seconds": 9,
  "scenes": 3,
  "scenes_made": 3,
  "scene_seconds": [
    3.2,
    2.5,
    3.3
  ],
  "price_multiplier": 1.5,
  "normal_credits": 100,
  "first_shot_only": false,
  "reason": "This clip has 3 scenes"
}

Upscale options#

The UpscaleOptions schema.

Upscale options
Field Type Description
object "upscale_options" (optional)
job_id string
media one of image, video
width integer
height integer
seconds number (optional)
available boolean
reason string (optional)
notice string (optional) Set while upscaling cannot start yet: the job is accepted and waits
estimate_seconds integer
options list of UpscaleOption
{
  "object": "upscale_options",
  "job_id": "x_5b70e2d9c4a1",
  "media": "video",
  "width": 854,
  "height": 480,
  "seconds": 6.0,
  "available": true,
  "reason": "",
  "notice": "",
  "estimate_seconds": 180,
  "options": [
    {
      "factor": 2,
      "available": true,
      "reason": "",
      "width": 1708,
      "height": 960,
      "credits": 30
    },
    {
      "factor": 2.25,
      "available": true,
      "reason": "",
      "width": 1920,
      "height": 1080,
      "credits": 36
    },
    {
      "factor": 4,
      "available": false,
      "reason": "Too large for a video.",
      "width": 3416,
      "height": 1920,
      "credits": 0
    }
  ]
}

Balance#

The Balance schema.

Balance
Field Type Description
object "balance"
credits_available integer Balance minus credits held for unfinished jobs
credits_held integer
billing_mode one of credits, exempt
{
  "object": "balance",
  "credits_available": 950,
  "credits_held": 50,
  "billing_mode": "credits"
}

Price#

The Price schema.

Price
Field Type Description
key string
base_credits integer
per_second_credits integer
per_100_chars_credits integer
pricing one of fixed, live_quote (optional) live_quote: 1080p and 2160p videos are priced from the live premium rendering price when the job is accepted (see the job's cost.credits_estimate); the credits shown are the most they cost at the regular premium rate
{
  "key": "video",
  "base_credits": 6,
  "per_second_credits": 2,
  "per_100_chars_credits": 0,
  "pricing": "fixed"
}

Status#

The Status schema.

Status
Field Type Description
object "status"
your_queue_length integer Your workspace's unfinished steps
engines object of Availability image, video, speech and sound_effect: available now or not
typical_seconds object of integer Typical time a job of each kind takes now, in seconds
prices list of Price
{
  "object": "status",
  "your_queue_length": 2,
  "engines": {
    "image": {
      "available": true,
      "reason": null
    },
    "video": {
      "available": true,
      "reason": null
    },
    "speech": {
      "available": true,
      "reason": null
    },
    "sound_effect": {
      "available": true,
      "reason": null
    }
  },
  "typical_seconds": {
    "image": 60,
    "video": 240,
    "speech": 20,
    "sound_effect": 15
  },
  "prices": [
    {
      "key": "image",
      "base_credits": 4,
      "per_second_credits": 0,
      "per_100_chars_credits": 0,
      "pricing": "fixed"
    },
    {
      "key": "video",
      "base_credits": 6,
      "per_second_credits": 2,
      "per_100_chars_credits": 0,
      "pricing": "fixed"
    }
  ]
}

Media input#

One input file. Give exactly one of file_id, url or data.

Media input
Field Type Required Default Limits Description
file_id string no 0 to 64 characters ID from POST /v1/files, e.g. file_3f9c2a1b7d4e
url string no 0 to 2000 characters Public https:// URL to download
data string no Base64 file contents, or a data: URI (about 25 MB at most)
label string no 0 to 200 characters What this reference shows, e.g. 'the red leather sofa'. Improves results with several references.
{
  "url": "https://example.com/sofa.jpg",
  "label": "a mustard yellow sofa"
}

Voice sample#

A recording of the voice to clone: 5 to 30 seconds, one speaker, no music.

Voice sample
Field Type Required Default Limits Description
file_id string no 0 to 64 characters
url string no 0 to 2000 characters
data string no
transcript string no 0 to 1000 characters Exact words spoken in the sample. If omitted, BobaBanana transcribes it first.
{
  "file_id": "file_7a2c9e4b1d08",
  "transcript": "Hi, this is a short sample of my voice."
}

Sound effect (in a video)#

The SoundEffect schema.

Sound effect (in a video)
Field Type Required Default Limits Description
prompt string yes 1 to 300 characters
duration_seconds number no 8 2 to 20
{
  "prompt": "storm wind and crashing waves",
  "duration_seconds": 6
}