Reference

Klarifai Studio API

Photoreal AI rendering for architecture & interiors. Turn sketches, photos and CAD screenshots into magazine-quality renders, then upscale to 4K — the same engine behind design.klarifai.co.uk, over a small, synchronous REST API.

Base URLhttps://design.klarifai.co.uk/api/v1

Authentication

Every request needs an API key. Create one in your developer dashboard — it's shown only once. Send it as a Bearer token, or in an x-api-key header. Keys look like kld_live_….

Headers
Authorization: Bearer kld_live_xxxxxxxx
# or
x-api-key: kld_live_xxxxxxxx

Credits & pricing

API calls draw on the same render-credit balance as the web app — buy token packs in your dashboard, no subscription.

POST /render1 credit
POST /upscale1 credit
GET /accountfree

A call that fails after being charged is refunded automatically. Track every call and your spend on the API usage tab.

Endpoints

POST/render· 1 credit

Render an image

Turn a sketch, photo or CAD screenshot into a photoreal interior or exterior render. The request is synchronous — the 200 response already holds the finished image on a stable Klarifai URL. If a render fails after the credit is taken, it is refunded automatically.

Body — application/json

imagestring · urirequired

Public http(s) URL of the source image to render.

typestringoptional

Which render model to use.

interiorexteriordefault interior
stylestringoptional

Design style hint, e.g. “Scandinavian”. Optional.

promptstringoptional

Full prompt that overrides the auto-built one. Optional, max 1200 chars.

outputFormatstringoptional

Output image format.

jpgpngwebpavifdefault jpg
Request
cURL
curl https://design.klarifai.co.uk/api/v1/render \
  --request POST \
  --header 'Authorization: Bearer kld_live_xxxxxxxx' \
  --header 'Content-Type: application/json' \
  --data '{
    "image": "https://example.com/kitchen-sketch.jpg",
    "type": "interior",
    "style": "Scandinavian",
    "outputFormat": "jpg"
  }'
Success
{
  "output_url": "https://design.klarifai.co.uk/storage/.../render.jpg",
  "type": "interior",
  "creditsRemaining": 41,
  "cost": 1
}
POST/upscale· 1 credit

Upscale to 4K

Upscale any render — or any public image — to 4K while preserving detail and sharpness. A separate, explicit step from /render, so you only pay for 4K when you ask for it. Synchronous; credit refunded automatically on failure.

Body — application/json

imagestring · urirequired

Public http(s) URL of the image to upscale (e.g. a /render output_url).

outputFormatstringoptional

Output image format.

jpgpngwebpavifdefault jpg
Request
cURL
curl https://design.klarifai.co.uk/api/v1/upscale \
  --request POST \
  --header 'Authorization: Bearer kld_live_xxxxxxxx' \
  --header 'Content-Type: application/json' \
  --data '{
    "image": "https://design.klarifai.co.uk/storage/.../render.jpg",
    "outputFormat": "jpg"
  }'
Success
{
  "output_url": "https://design.klarifai.co.uk/storage/.../4k.jpg",
  "upscaled": true,
  "creditsRemaining": 40,
  "cost": 1
}
GET/account· free

Check your balance

Return the render-credit balance for the account that owns the API key. This call is never charged.

Request
cURL
curl https://design.klarifai.co.uk/api/v1/account \
  --header 'Authorization: Bearer kld_live_xxxxxxxx'
Success
{
  "render_credits": 42
}

Errors

Every error returns a JSON body with a human error message and a machine code you can switch on. HTTP status reflects the class of failure.

StatusCodeMeaning
401UNAUTHORIZEDMissing or invalid API key
400BAD_IMAGE'image' is not a public http(s) URL
402INSUFFICIENT_CREDITSOut of render credits — top up in the dashboard
502RENDER_FAILEDUpstream render error (credit refunded)
502UPSCALE_FAILEDUpstream upscale error (credit refunded)

Ready to build?

Mint a key and make your first render in two minutes.

Get an API key

Klarifai Studio is part of KlarifAi. Questions? sales@klarifai.co.uk