Skip to content
cloudhostDocs
API reference

Image resizing

Resize, crop and convert an app's images at /_img (and Next.js's /_next/image) from its own files or allowed https hosts; results cached per team; transformations billed per 1,000.

GET/v1/apps/{name}/images

Image settings and usage#

The app's image resizing settings, its limits, this month's transformations and cache hits, the cache against the team's limit, and whether Hobby's free amount is used up (originals are served).

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200object

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/images" \
  -H "Authorization: Bearer $KEY"
PATCH/v1/apps/{name}/images

Change image settings#

Change any of enabled, hosts, widths, qualities, formats and ttl_seconds; live within seconds. Errors 400 image_bad_*, 409 image_limit.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

  • enabledboolean
  • hostsstring[]

    host names (img.example.com) or wildcards (*.example.com); https only, never addresses

  • widthsinteger[]
  • qualitiesinteger[]

    0–10 items

  • formatsstring[]
  • ttl_secondsinteger

    60–2678400

Response

200object

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X PATCH "https://api.ibel.ai/v1/apps/my-api/images" \
  -H "Authorization: Bearer $KEY" \
  -d '{"enabled":true,"hosts":["…"],"widths":[1],"qualities":[1],"formats":["webp"],"ttl_seconds":60}'
GET/v1/apps/{name}/images/usage

Image usage by day#

Per day: transformations (billed per 1,000), cache hits, originals served unchanged, bytes in and out.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • daysintegerquery

    1–90 · default 30

Response

200object

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/images/usage" \
  -H "Authorization: Bearer $KEY"
DELETE/v1/apps/{name}/images/cache

Clear the image cache#

Forget every cached result of the app; each is made, and counted, again on its next request.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200object

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/apps/my-api/images/cache" \
  -H "Authorization: Bearer $KEY"
GET/v1/images

The team''s image resizing#

Every app's transformations this month and its cache, and the team's cache against its plan limit.

Credential
An API key or a dashboard session
Roles
Any role

Response

200object

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/images" \
  -H "Authorization: Bearer $KEY"