BobaBanana API

GET /v1/jobs/{job_id}/upscale-options: list upscale options

GET /v1/jobs/{job_id}/upscale-options is the endpoint to list upscale sizes and prices for a job. Free. For a finished image or video job: each upscale factor, whether it can be made, the output size and its price in credits. Check it before POST /v1/jobs/{job_id}/upscale.

View as Markdown

At a glance

Endpoint
GET /v1/jobs/{job_id}/upscale-options
Base URL
https://bobabanana.com/api/v1
Auth
Authorization: Bearer bb_...
Success
200
Safe to retry
yes, a read
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_...)

Example request#

curl
curl https://bobabanana.com/api/v1/jobs/x_8d21c0f4a9b3/upscale-options \
  -H "Authorization: Bearer $BOBABANANA_API_KEY"
Python
import os

import requests

r = requests.get(
    "https://bobabanana.com/api/v1/jobs/x_8d21c0f4a9b3/upscale-options",
    headers={"Authorization": f"Bearer {os.environ['BOBABANANA_API_KEY']}"},
    timeout=60,
)
r.raise_for_status()
print(r.json())
JavaScript
const res = await fetch("https://bobabanana.com/api/v1/jobs/x_8d21c0f4a9b3/upscale-options", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.BOBABANANA_API_KEY}`,
  },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
console.log(await res.json());

Response#

200 (UpscaleOptions): Successful Response

{
  "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
    }
  ]
}

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 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.
401 invalid_api_key The key is wrong, revoked or belongs to no workspace.
401 missing_api_key No API key was sent.
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).
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.