BobaBanana API

POST /v1/jobs/{job_id}/upscale: upscale a job

POST /v1/jobs/{job_id}/upscale is the endpoint to upscale a finished image or video job. Makes a new job with a larger, sharper copy of a finished job's image or video. The source job is untouched; the new job's source_job_id names it. Videos keep their sound. Answers 202 with a queued job.

View as Markdown

At a glance

Endpoint
POST /v1/jobs/{job_id}/upscale
Base URL
https://bobabanana.com/api/v1
Auth
Authorization: Bearer bb_...
Success
202 (or 200 with dry_run: true)
Safe to retry
yes, with an Idempotency-Key header
Guide
Upscale

Request#

Path parameters#

Path parameters
Name Type Required Default Limits Description
job_id string yes The job's id, e.g. x_8d21c0f4a9b3.

Headers#

Headers
Header Required Description
Authorization yes Bearer bb_...: your API key (or send X-API-Key: bb_...)
Content-Type yes application/json
idempotency-key no Any unique string up to 255 characters (a UUID is ideal). A retry with the same key and the same body within 24 hours returns the first job instead of making a second one; the same key with a different body is 422 idempotency_key_reused.

Body (JSON)#

Every field is optional; the body may be left out.

Body (JSON)
Field Type Required Default Limits Description

Example request#

Twice the size:

curl
curl https://bobabanana.com/api/v1/jobs/x_8d21c0f4a9b3/upscale \
  -H "Authorization: Bearer $BOBABANANA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "factor": 2
  }'
Python
import os
import uuid

import requests

r = requests.post(
    "https://bobabanana.com/api/v1/jobs/x_8d21c0f4a9b3/upscale",
    headers={"Authorization": f"Bearer {os.environ['BOBABANANA_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
    json={
        "factor": 2,
    },
    timeout=60,
)
r.raise_for_status()
print(r.json())
JavaScript
const res = await fetch("https://bobabanana.com/api/v1/jobs/x_8d21c0f4a9b3/upscale", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BOBABANANA_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    "factor": 2
  }),
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
console.log(await res.json());

More request bodies#

A 480p video to 1080p, with a cost cap (video_1080p):

{
  "factor": 2.25,
  "max_credits": 60
}

Response#

200 (DryRunEstimate): dry_run: true: the price of this request. Nothing is queued, held or stored.

{
  "object": "estimate",
  "dry_run": true,
  "type": "video_upscale",
  "credits_estimate": 36,
  "credits_available": 950,
  "enough_credits": true,
  "billing_mode": "credits"
}

202 (Job): Successful Response

{
  "id": "x_0c9e4a7d2b85",
  "object": "job",
  "type": "video_upscale",
  "status": "queued",
  "created": 1764950400,
  "input": {
    "source_job_id": "x_5b70e2d9c4a1",
    "factor": 2.25
  },
  "output": {},
  "eta_seconds": 240,
  "poll_after_seconds": 30,
  "cost": {
    "credits_estimate": 36,
    "credits_charged": 0,
    "credits_released": 0,
    "status": "held"
  },
  "source_job_id": "x_5b70e2d9c4a1",
  "output_size": {
    "width": 1920,
    "height": 1080
  }
}

Errors#

Errors use the error object. The codes this endpoint can return (what to do about each is in Error codes):

Errors
Status Code Meaning
400 bad_request The Content-Length header is not a number.
400 cost_above_max The job would cost more than max_credits. credits_estimate gives the price.
400 fetch_timeout Downloading a URL input took too long.
400 invalid_metadata metadata has more than 16 keys, a key over 40 characters or a value over 500.
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.
400 invalid_url The URL is not https://, its host cannot be found, or it points to a private address.
401 invalid_api_key The key is wrong, revoked or belongs to no workspace.
401 missing_api_key No API key was sent.
402 insufficient_credits The workspace's available credits are less than the job's estimate. required and available give both numbers.
403 workspace_suspended The workspace that owns the key is suspended.
404 job_not_found No job with this id for this API key (another key's jobs are invisible).
409 idempotency_in_progress A request with this Idempotency-Key is still being processed. Retry-After: 5 s.
413 too_large The request body is over the limit for this endpoint (JSON bodies 100 MB, uploads 64 MB).
422 idempotency_key_reused This Idempotency-Key was already used with a different request.
422 invalid_json The body is not valid JSON.
429 daily_limit_reached This key has used its jobs for the last 24 hours. Retry-After: 3600 s.
429 queue_full The workspace has too many steps waiting.
429 too_many_active_jobs This key already has its maximum of unfinished jobs. Retry-After: 30 s.
429 too_many_attempts Too many requests with wrong keys came from your address. Retry-After is set.
500 internal_error Something went wrong on our side.
503 engine_unavailable This kind of generation is not available right now. Retry-After: 300 s.
503 maintenance BobaBanana is being updated; changes are paused for a few minutes. Reads still work. Retry-After is set.