SciFig

API reference

Image upscales

Upscale an image to 2K, 4K or 8K.

JSON body#

POST /images/upscales. Required scope: figures:generate.

FieldTypeRequiredDefaultRules
imagestringyes—An image file_id
scalestringyes—2k, 4k (Starter plan or higher) or 8k (Plus plan or higher); a credit-pack balance above zero counts as Pro
scaleCredits
2k50
4k100
8k150

An image that already reaches the target size returns 400 INVALID_REQUEST with details.reason = UPSCALE_ALREADY_AT_TARGET and charges nothing. Generated illustrations are about 2K, so ask for 4k or 8k. A timed-out upscale is refunded and not delivered later. The response is a job; see Jobs and bounded waiting for its fields and statuses. Errors are listed under Errors.

cURL#

curl -X POST https://scifig.ai/api/v1/images/upscales \
  -H "Authorization: Bearer $SCIFIG_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=25" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "<file_id>",
    "scale": "4k"
  }'

JavaScript#

const response = await fetch('https://scifig.ai/api/v1/images/upscales', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.SCIFIG_API_KEY}`,
    'Idempotency-Key': crypto.randomUUID(),
    Prefer: 'wait=25',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "image": "<file_id>",
    "scale": "4k"
  }),
});
const result = await response.json();
console.log(response.status, result);

Python#

import os
import uuid

import requests

headers = {
    "Authorization": f"Bearer {os.environ['SCIFIG_API_KEY']}",
    "Idempotency-Key": str(uuid.uuid4()),
    "Prefer": "wait=25",
}
response = requests.post(
    "https://scifig.ai/api/v1/images/upscales",
    headers=headers,
    json={
        "image": "<file_id>",
        "scale": "4k"
    },
    timeout=60,
)
print(response.status_code, response.json())