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

Source: https://bobabanana.com/docs/api/reference/objects/

> Fields of every BobaBanana API object: Job, cost, output links, File, Asset, Error, webhook Event, estimates, Balance, Price and Status.

**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.

## Job {#job}

The `Job` schema.

| 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](https://bobabanana.com/docs/api/reference/objects/#job-output) | Result links once the job has succeeded; empty before |
| `error` | [JobError](https://bobabanana.com/docs/api/reference/objects/#job-error) |  |
| `cost` | [JobCost](https://bobabanana.com/docs/api/reference/objects/#job-cost) |  |
| `webhook` | [JobWebhook](https://bobabanana.com/docs/api/reference/objects/#job-webhook) | 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 |

```json
{
  "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 {#job-cost}

The `JobCost` schema.

| 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 |

```json
{
  "credits_estimate": 18,
  "credits_charged": 0,
  "credits_released": 0,
  "status": "held",
  "video_price_key": "video",
  "resolution": "720p"
}
```

## Job output {#job-output}

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

| Field | Type | Description |
|---|---|---|
| `image` | [Link](https://bobabanana.com/docs/api/reference/objects/#link) (optional) |  |
| `video` | [Link](https://bobabanana.com/docs/api/reference/objects/#link) (optional) |  |
| `speech` | [Link](https://bobabanana.com/docs/api/reference/objects/#link) (optional) |  |
| `sound_effect` | [Link](https://bobabanana.com/docs/api/reference/objects/#link) (optional) |  |

```json
{
  "image": {
    "url": "https://bobabanana.com/api/v1/files/content/...",
    "content_type": "image/png"
  }
}
```

## Result link {#link}

The `Link` schema.

| 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 |  |

```json
{
  "url": "https://bobabanana.com/api/v1/files/content/...",
  "content_type": "image/png"
}
```

## Job error {#job-error}

The `JobError` schema.

| 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 |

```json
{
  "code": "render_failed",
  "message": "The picture step failed.",
  "steps": {
    "image": "The picture step failed."
  }
}
```

## Job webhook state {#job-webhook}

The `JobWebhook` schema.

| 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 |

```json
{
  "status": "delivered",
  "attempts": 1,
  "last_status": 200
}
```

## Webhook event {#event}

The body of a webhook POST.

| 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](https://bobabanana.com/docs/api/reference/objects/#job) |  |

```json
{
  "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 {#file}

The `FileObject` schema.

| 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) |  |

```json
{
  "id": "file_3f9c2a1b7d4e",
  "object": "file",
  "type": "image",
  "name": "sofa.jpg",
  "bytes": 482113,
  "created": 1764950300,
  "expires_at": 1765036700,
  "width": 1600,
  "height": 1067,
  "warnings": []
}
```

## Asset {#asset}

The `Asset` schema.

| 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 |

```json
{
  "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 {#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.

| 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 |

```json
{
  "code": "insufficient_credits",
  "message": "Needs 120 credits, you have 40.",
  "required": 120,
  "available": 40,
  "docs": "https://bobabanana.com/docs/api/errors/"
}
```

## Dry-run estimate {#dry-run-estimate}

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

| 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) |  |

```json
{
  "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 {#video-estimate}

The `VideoEstimate` schema.

| 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' |

```json
{
  "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 {#upscale-options}

The `UpscaleOptions` schema.

| 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 |  |

```json
{
  "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 {#balance}

The `Balance` schema.

| Field | Type | Description |
|---|---|---|
| `object` | `"balance"` |  |
| `credits_available` | integer | Balance minus credits held for unfinished jobs |
| `credits_held` | integer |  |
| `billing_mode` | one of `credits`, `exempt` |  |

```json
{
  "object": "balance",
  "credits_available": 950,
  "credits_held": 50,
  "billing_mode": "credits"
}
```

## Price {#price}

The `Price` schema.

| 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 |

```json
{
  "key": "video",
  "base_credits": 6,
  "per_second_credits": 2,
  "per_100_chars_credits": 0,
  "pricing": "fixed"
}
```

## Status {#status}

The `Status` schema.

| 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](https://bobabanana.com/docs/api/reference/objects/#price) |  |

```json
{
  "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 {#media}

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

| 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. |

```json
{
  "url": "https://example.com/sofa.jpg",
  "label": "a mustard yellow sofa"
}
```

## Voice sample {#voice-sample}

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

| 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. |

```json
{
  "file_id": "file_7a2c9e4b1d08",
  "transcript": "Hi, this is a short sample of my voice."
}
```

## Sound effect (in a video) {#sound-effect}

The `SoundEffect` schema.

| Field | Type | Required | Default | Limits | Description |
|---|---|---|---|---|---|
| `prompt` | string | yes |  | 1 to 300 characters |  |
| `duration_seconds` | number | no | `8` | 2 to 20 |  |

```json
{
  "prompt": "storm wind and crashing waves",
  "duration_seconds": 6
}
```
