Docs / Overview

Welcome to the theGlitch API

theGlitch offers 19 image transforms from a single platform — for developers and creators alike. Fast edits (resize, format, watermark, vectorize to SVG) and AI-powered transforms (background removal, upscale, colorize, image to text, product scene, listing copy) all share the same API.

Whichever channel you use, the result and price are the same:

Web Panel

Drag, drop in the browser. Process up to 100 images at a time without code.

Open panel

REST API

Call from your backend with one request. Standard HTTP, JSON response.

Quickstart

MCP Server

Direct calls from AI assistants like Claude and Cursor.

View MCP
First request? Get your first response in 60 seconds via the Quickstart below.

Quickstart

Create an account, get a key, send your first request — 60 seconds.

  1. Get an API key

    Panel → API Keys → New key. Your access key is a unique 32-character string.

  2. Send your first request

    Resize an image to 800px wide:

    ~/glitch · curl
    curl "https://theglitch.app/api/v1/resize?url=https://theglitch.app/showcase/resize-before.webp&width=800" \  -H "X-Api-Key: YOUR_API_KEY" \  -o result.webp
  3. Get the response

    Response: 200 OK + processed image (binary), written to result.webp.

  4. Try more

    All 19 processing endpoints are below: API Reference.

Tip: If you want to try without code, the Web Panel is one click away.

Authentication

All processing requests are authenticated with the X-Api-Key header. View and copy your access keys from the panel. How many keys you can hold at once depends on your plan: Free and Starter 1, Pro 5, Business 20. On plans that allow several keys you rotate without downtime by creating a new key and revoking the old one; on single-key plans you must revoke first and then create, and requests in between return 401.

curl · header
curl "https://theglitch.app/api/v1/resize?width=800" \  -H "X-Api-Key: YOUR_API_KEY" \  -F "file=@photo.jpg" -o result.webp
Security: Never expose your API key on the client. Always keep it server-side.

Input Methods

There are 4 ways to send an image to the API. Every processing endpoint accepts all four. If you send more than one, this order wins: form file → url → image → binary body; in a form upload only the first file is read.

  1. 1 · URL

    Pass a public http(s) address via the url query parameter. Localhost, private and internal-network addresses are refused; up to 5 redirects are followed; a non-2xx source response returns 400 INVALID_INPUT. The download is capped at 10 s / 25 MB and our requests carry the TheGlitch/1.0 User-Agent. URL inputs are cached for 60 minutes.

  2. 2 · Base64

    The image field in a JSON body (data-URI supported): Content-Type: application/json.

  3. 3 · Binary body

    Send raw bytes directly in the body with an image/* Content-Type.

  4. 4 · Form upload

    Upload a file via the multipart file field.

4 input · curl
# 1) URL
curl "https://theglitch.app/api/v1/resize?url=https://theglitch.app/showcase/resize-before.webp&width=800" -H "X-Api-Key: KEY" -o out.webp

# 2) Base64 (JSON body)
curl -X POST "https://theglitch.app/api/v1/resize?width=800" -H "X-Api-Key: KEY" \
  -H "Content-Type: application/json" -d '{"image":"data:image/jpeg;base64,/9j/4AAQ..."}' -o out.webp

# 3) Binary body
curl -X POST "https://theglitch.app/api/v1/resize?width=800" -H "X-Api-Key: KEY" \
  -H "Content-Type: image/jpeg" --data-binary @photo.jpg -o out.webp

# 4) Form upload
curl -X POST "https://theglitch.app/api/v1/resize?width=800" -H "X-Api-Key: KEY" -F "file=@photo.jpg" -o out.webp
Important: Only the file is read from form uploads — send parameters like width and format in the query string, not as form fields.
Limits: Max input 25 MB · every request has a time budget: 30 s for quick transforms, 90 s for AI transforms (exceeding it returns 408 TIMEOUT). Upload time counts against that budget, so on a slow connection you can hit 408 well before 25 MB · source images up to 80 megapixels · for AI upscale the source is capped at 2.1 megapixels (1448×1448) · restoration output is normalized to about 1 megapixel · URL fetch timeout 10 s (exceeding it returns 408 TIMEOUT) · output resolution is plan-based (2048–8000 px).

All Transforms

19 processing endpoints (plus the read-only /v1/info). They share the same authentication. /v1/image-info and /v1/listing-copy return JSON, /v1/ocr returns JSON by default, /v1/vectorize returns SVG; the rest return a binary image.

MethodEndpointDescription
GET POST/v1/processEverything in one request (main endpoint)
GET POST/v1/resizeResize
GET POST/v1/convertFormat conversion
GET POST/v1/effectsBrightness, contrast, saturation, blur
GET POST/v1/watermarkAdd a watermark
GET POST/v1/optimizeOptimize for the web
GET POST/v1/preset/{name}Social media presets
GET POST/v1/image-infoImage metadata (JSON response)
GET POST/v1/vectorizeLogo and icon to SVG (SVG response)
GET POST/v1/remove-bgBackground removal (AI)
GET POST/v1/upscaleAI 2x / 4x upscale
GET POST/v1/colorizeColorize black-and-white
GET POST/v1/face-restoreFace restore
GET POST/v1/restoreOld photo restore
GET POST/v1/remove-objectObject removal (AI)
GET POST/v1/headshotProfessional headshot (AI)
GET POST/v1/ocrImage to text — OCR (AI)
GET POST/v1/listing-copyMarketplace listing draft from a photo — JSON (AI)
GET POST/v1/product-sceneProduct scene: extra product image (AI)
GET/v1/infoAPI capabilities & version info

GET POST /v1/process

The main endpoint that combines everything in one request: resize, effects, rotation, watermark, format conversion and presets together. Any combination still counts as 1 request.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
widthintOptional1 … 8000Target width (px). Aspect ratio is preserved when given alone.
heightintOptional1 … 8000Target height (px). Aspect ratio is preserved when given alone.
modestringOptionalfit (fit · fill · pad · stretch (contain=fit, cover=fill))Resize behavior: fit contains, fill center-crops, pad letterboxes, stretch ignores aspect ratio. contain=fit, cover=fill are aliases.
padColorstringOptional#FFFFFF (#RRGGBB)Background color of the letterbox area when mode=pad. In a GET request encode # as %23.
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.
formatstringOptionalauto (auto · jpeg · png · webp · tiff · avif · gif)Output format. auto: picked from the Accept header, defaults to WebP.
brightnessintOptional0 (-100 … 100)Brightness. -100 is completely black, +100 twice as bright.
contrastintOptional0 (-100 … 100)Contrast. Negative washes out, positive deepens.
saturationintOptional0 (-100 … 100)Saturation. -100 equals grayscale.
blurintOptional0 (0 … 100)Gaussian blur intensity.
sharpenintOptional0 (0 … 100)Sharpening intensity. Start low (10–30); high values can introduce artifacts.
grayscaleboolOptionalfalseConverts to grayscale.
sepiaboolOptionalfalseApplies a warm sepia tone.
rotateintOptional0 (0 · 90 · 180 · 270)Clockwise rotation. 90° increments only.
flipHboolOptionalfalseMirror horizontally (left-right).
flipVboolOptionalfalseMirror vertically (top-bottom).
presetstringOptional14 preset adıApplies a social media preset (size + crop). See the Preset section for names.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Example

curl
curl "https://theglitch.app/api/v1/process?url=https://theglitch.app/showcase/resize-before.webp&width=800&format=webp&brightness=10&sharpen=20" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o result.webp
  • AI flags like removeBackground, upscale and colorize are also accepted — see the AI endpoint sections. Only ONE AI flag is allowed per request; more than one returns 400 MULTIPLE_AI_OPERATIONS, so chain AI operations with separate requests. An AI flag must be a plain query parameter or a top-level field of a UTF-8 JSON body. Requests using an AI flag deduct AI credits.
  • POST + JSON body is supported; query string values take precedence for url/image/width/height.

Each successful call counts as 1 request against your monthly quota (a combo of effects + resize + format is still 1).

GET POST /v1/resize

Resizes the image to target dimensions. Provide at least one of width/height; mode controls cropping.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
widthintOptional1 … 8000Target width (px). Aspect ratio is preserved when given alone.
heightintOptional1 … 8000Target height (px). Aspect ratio is preserved when given alone.
modestringOptionalfit (fit · fill · pad · stretch (contain=fit, cover=fill))Resize behavior: fit contains, fill center-crops, pad letterboxes, stretch ignores aspect ratio. contain=fit, cover=fill are aliases.
padColorstringOptional#FFFFFF (#RRGGBB)Background color of the letterbox area when mode=pad. In a GET request encode # as %23.
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.
formatstringOptionalauto (auto · jpeg · png · webp · tiff · avif · gif)Output format. auto: picked from the Accept header, defaults to WebP.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Example

curl
curl "https://theglitch.app/api/v1/resize?url=https://theglitch.app/showcase/resize-before.webp&width=800&height=600&mode=fill" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o result.webp
  • Output resolution is plan-limited (Free 2048px, Starter 4000px, Pro+ 8000px). An explicit width/height above the limit returns VALIDATION_ERROR. If you request no resize and the source is larger than the limit, the output is scaled down to fit it, preserving the aspect ratio.

Each successful call counts as 1 request against your monthly quota (a combo of effects + resize + format is still 1).

GET POST /v1/convert

Converts the image to another format. Without format, auto behavior applies (Accept header → WebP default).

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
formatstringOptionalauto (auto · jpeg · png · webp · tiff · avif · gif)Output format. auto: picked from the Accept header, defaults to WebP.
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Example

curl
curl "https://theglitch.app/api/v1/convert?url=https://theglitch.app/showcase/resize-before.webp&format=webp&quality=80" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o result.webp
  • GIF output is served as PNG. TIFF and AVIF are available on paid plans — see File Formats.

Each successful call counts as 1 request against your monthly quota (a combo of effects + resize + format is still 1).

GET POST /v1/effects

Brightness, contrast, saturation, blur, sharpen, grayscale, sepia plus rotate/flip. All effects can be combined in a single request.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
brightnessintOptional0 (-100 … 100)Brightness. -100 is completely black, +100 twice as bright.
contrastintOptional0 (-100 … 100)Contrast. Negative washes out, positive deepens.
saturationintOptional0 (-100 … 100)Saturation. -100 equals grayscale.
blurintOptional0 (0 … 100)Gaussian blur intensity.
sharpenintOptional0 (0 … 100)Sharpening intensity. Start low (10–30); high values can introduce artifacts.
grayscaleboolOptionalfalseConverts to grayscale.
sepiaboolOptionalfalseApplies a warm sepia tone.
rotateintOptional0 (0 · 90 · 180 · 270)Clockwise rotation. 90° increments only.
flipHboolOptionalfalseMirror horizontally (left-right).
flipVboolOptionalfalseMirror vertically (top-bottom).
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.
formatstringOptionalauto (auto · jpeg · png · webp · tiff · avif · gif)Output format. auto: picked from the Accept header, defaults to WebP.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Example

curl
curl "https://theglitch.app/api/v1/effects?url=https://theglitch.app/showcase/resize-before.webp&brightness=15&contrast=20&sharpen=25" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o result.webp
  • Rotation and flips are applied before effects and resizing.
  • If grayscale and sepia are both set, grayscale wins.

Each successful call counts as 1 request against your monthly quota (a combo of effects + resize + format is still 1).

GET POST /v1/watermark

Adds a text watermark. 5 positions, custom color, size and opacity.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
watermarkTextstringRequired—Watermark text (Unicode supported). URL-encode special characters in GET requests.
watermarkPositionstringOptionalbottom-right (top-left · top-right · bottom-left · bottom-right · center)Watermark placement.
watermarkOpacityintOptional50 (0 … 100)Opacity: 0 invisible, 100 solid.
watermarkFontSizeintOptional24 (12 … 120 px)Font size (px).
watermarkColorstringOptional#FFFFFF (#RRGGBB)Text color. Send # as %23 in GET requests.
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.
formatstringOptionalauto (auto · jpeg · png · webp · tiff · avif · gif)Output format. auto: picked from the Accept header, defaults to WebP.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Example

curl
curl "https://theglitch.app/api/v1/watermark?url=https://theglitch.app/showcase/resize-before.webp&watermarkText=theGlitch.app&watermarkPosition=center&watermarkOpacity=40" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o result.webp
  • watermarkText is required and must be sent in the query string; if empty, MISSING_WATERMARK is returned.
  • The watermark is applied before resizing; combine with other operations via /process.

Each successful call counts as 1 request against your monthly quota (a combo of effects + resize + format is still 1).

GET POST /v1/optimize

Automatic web optimization: output is WebP unless a format is specified, default quality 85.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Example

curl
curl "https://theglitch.app/api/v1/optimize?url=https://theglitch.app/showcase/resize-before.webp&quality=80" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o result.webp
  • If a format parameter is provided, it overrides the WebP default.

Each successful call counts as 1 request against your monthly quota (a combo of effects + resize + format is still 1).

GET POST /v1/preset/{name}

Applies a social media size preset. name is a path parameter (case-insensitive, underscore naming). All presets use mode=fill (center crop).

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.
formatstringOptionalauto (auto · jpeg · png · webp · tiff · avif · gif)Output format. auto: picked from the Accept header, defaults to WebP.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Available presets

namepxDescription
instagram_square1080 × 1080Feed post (1:1)
instagram_story1080 × 1920Story / Reels (9:16)
instagram_post1080 × 1350Portrait post (4:5)
facebook_cover820 × 312Page cover photo
facebook_post1200 × 630Feed post / link share
twitter_header1500 × 500Profile header
twitter_post1200 × 675Tweet image (16:9)
linkedin_banner1584 × 396Company banner
linkedin_post1200 × 627Feed post
youtube_thumbnail1280 × 720Video thumbnail (16:9)
youtube_banner2560 × 1440Channel banner
og_image1200 × 630Open Graph / SEO preview
whatsapp_status1080 × 1920Status image (9:16)
tiktok_video1080 × 1920Video cover (9:16)

Example

curl
curl "https://theglitch.app/api/v1/preset/og_image?url=https://theglitch.app/showcase/resize-before.webp" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o og.webp
  • An unknown name returns INVALID_PRESET along with the list of valid presets.
  • Combine with effect/format parameters: /preset/og_image?url=…&brightness=10&format=jpeg

Each successful call counts as 1 request against your monthly quota (a combo of effects + resize + format is still 1).

GET POST /v1/image-infoJSON response

Returns image metadata. Unlike every other endpoint, the response is JSON, not binary (Content-Type: application/json).

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Response fields

NameTypeDescription
widthintWidth (px)
heightintHeight (px)
formatstringDetected format: jpeg, png, webp, gif, tiff, avif
colorTypestringColour model: rgb, rgba, grayscale or cmyk. Nothing outside these four values is returned.
hasAlphaboolWhether a transparency channel exists
orientationintRaw EXIF orientation tag (1-8). width and height already report the oriented size; this field only tells you what the source tag was.
fileSizeintFile size (bytes)
fileSizeHumanstringHuman-readable size (e.g. "240.0 KB")
200 · application/json
{
  "width": 1920,
  "height": 1080,
  "format": "jpeg",
  "colorType": "rgb",
  "hasAlpha": false,
  "orientation": 1,
  "fileSize": 245760,
  "fileSizeHuman": "240.0 KB"
}

Example

curl
curl "https://theglitch.app/api/v1/image-info?url=https://theglitch.app/showcase/resize-before.webp" \
  -H "X-Api-Key: YOUR_API_KEY"
  • This endpoint does not process the image; it only decodes and inspects it. Counts as 1 request.

Each successful call counts as 1 request against your monthly quota (a combo of effects + resize + format is still 1).

GET POST /v1/vectorizeSVG response

Turns a flat-color logo or icon into a scalable SVG vector. It runs on our own servers: it counts as 1 request against your quota, not against AI credits. The response is image/svg+xml.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
colorsintOptional8 (2 … 16)Number of palette colors, 2–16 (default 8). Fewer colors give a simpler output.
curvesstringOptionalspline (spline · polygon)spline (default): smooth curves · polygon: straight edges.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Response headers

HeaderExampleDescription
Content-Typeimage/svg+xml; charset=utf-8The body is UTF-8 SVG text.
Content-Security-Policydefault-src 'none'; style-src 'unsafe-inline'Even if the SVG is opened directly in a browser, no script runs and no external resource loads.
X-Content-Type-OptionsnosniffThe browser does not guess the content type; the file is always handled as SVG.

Example

curl
curl "https://theglitch.app/api/v1/vectorize?url=https://theglitch.app/logo-512.png&colors=4&curves=polygon" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o logo.svg
  • Works best for flat-color logos and icons; heavy gradients come out simplified. It is not meant for turning photos into vectors: a photo-like, very detailed image is refused with 400 VALIDATION_ERROR.
  • Turkish letters in a logo (Ç, Ğ, İ, Ö, Ş, Ü) keep their dots and cedillas; the lettering comes back as shapes (paths), not as editable text.
  • Input is PNG, JPEG or WebP; at most 4 megapixels, longest edge 4096 px. A photo-like image is refused before vectorizing starts and costs nothing; if vectorizing has run and the output turns out too detailed to serve, you also get 400 VALIDATION_ERROR, and that request counts as 1 request against your quota.
  • The output is cleaned: DTDs, scripts, event attributes and external links are removed and only basic shape elements remain; ids get a per-request prefix and the root element always has a viewBox.
  • The image is not written to persistent storage: temporary files are kept in memory only and deleted as soon as processing finishes.

Each successful call counts as 1 request against your monthly quota (a combo of effects + resize + format is still 1).

GET POST /v1/remove-bgAI · 1 credit

Removes the background with AI; the result has a transparent background.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
formatstringOptionalauto (auto · jpeg · png · webp · tiff · avif · gif)Output format. auto: picked from the Accept header, defaults to WebP.
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Example

curl
curl "https://theglitch.app/api/v1/remove-bg?url=https://theglitch.app/showcase/bg-before.webp" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o result.png
  • With format=auto the output is forced to PNG to preserve transparency. An explicit format wins.

A successful call deducts from your monthly AI credits only; it does not count against the request quota. The cost depends on the operation: remove-bg, upscale, colorize, remove-object, ocr (per image) and listing-copy cost 1 credit; product-scene costs 2 (studio), 6 (relight) or 7 (lifestyle); face-restore, restore and headshot cost 9. Which failed requests are charged is listed under Quotas & Limits. (If your request quota is exhausted, AI calls also return 429 REQUEST_QUOTA_EXCEEDED.)

GET POST /v1/upscaleAI · 1 credit

Upscales resolution 2x or 4x with AI; sharpens low-resolution images.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
upscaleScaleintOptional4 (2 · 4)Upscale factor: 2x or 4x. Any other value returns INVALID_SCALE.
formatstringOptionalauto (auto · jpeg · png · webp · tiff · avif · gif)Output format. auto: picked from the Accept header, defaults to WebP.
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Example

curl
curl "https://theglitch.app/api/v1/upscale?url=https://theglitch.app/showcase/up-before.webp&upscaleScale=4" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o result.webp
  • Combine with effects, watermark or format: /upscale?url=…&upscaleScale=2&sharpen=20&format=webp
  • Two separate limits apply: (1) the source image cannot exceed 2.1 megapixels (1448×1448) — this limit is independent of the scale factor; (2) the upscaled size (source × factor) must stay within your plan's resolution limit — on Free (2048px) that means sources up to 512px for 4×, or 1024px for 2×. If either is exceeded, VALIDATION_ERROR is returned before the AI runs and no AI credits are used.

A successful call deducts from your monthly AI credits only; it does not count against the request quota. The cost depends on the operation: remove-bg, upscale, colorize, remove-object, ocr (per image) and listing-copy cost 1 credit; product-scene costs 2 (studio), 6 (relight) or 7 (lifestyle); face-restore, restore and headshot cost 9. Which failed requests are charged is listed under Quotas & Limits. (If your request quota is exhausted, AI calls also return 429 REQUEST_QUOTA_EXCEEDED.)

GET POST /v1/colorizeAI · 1 credit

Brings black & white or faded photos to natural color with AI.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
formatstringOptionalauto (auto · jpeg · png · webp · tiff · avif · gif)Output format. auto: picked from the Accept header, defaults to WebP.
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Example

curl
curl "https://theglitch.app/api/v1/colorize?url=https://theglitch.app/showcase/color-before.webp" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o result.webp

A successful call deducts from your monthly AI credits only; it does not count against the request quota. The cost depends on the operation: remove-bg, upscale, colorize, remove-object, ocr (per image) and listing-copy cost 1 credit; product-scene costs 2 (studio), 6 (relight) or 7 (lifestyle); face-restore, restore and headshot cost 9. Which failed requests are charged is listed under Quotas & Limits. (If your request quota is exhausted, AI calls also return 429 REQUEST_QUOTA_EXCEEDED.)

GET POST /v1/face-restoreAI · 9 credits

Restores blurry, low-resolution or degraded faces with AI.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
formatstringOptionalauto (auto · jpeg · png · webp · tiff · avif · gif)Output format. auto: picked from the Accept header, defaults to WebP.
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Example

curl
curl "https://theglitch.app/api/v1/face-restore?url=https://theglitch.app/showcase/face-before.webp" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o result.webp
  • Whatever the input measures, the output is normalized to about 1 megapixel; the aspect ratio and the orientation are roughly preserved. Sending a larger source does not produce a larger result — keep your original. Very wide or very tall images (a panorama, say) can come back noticeably reshaped.

A successful call deducts from your monthly AI credits only; it does not count against the request quota. The cost depends on the operation: remove-bg, upscale, colorize, remove-object, ocr (per image) and listing-copy cost 1 credit; product-scene costs 2 (studio), 6 (relight) or 7 (lifestyle); face-restore, restore and headshot cost 9. Which failed requests are charged is listed under Quotas & Limits. (If your request quota is exhausted, AI calls also return 429 REQUEST_QUOTA_EXCEEDED.)

GET POST /v1/restoreAI · 9 credits

Repairs old, damaged or faded photographs with AI; age-related degradation is fixed automatically.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
formatstringOptionalauto (auto · jpeg · png · webp · tiff · avif · gif)Output format. auto: picked from the Accept header, defaults to WebP.
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Example

curl
curl "https://theglitch.app/api/v1/restore?url=https://theglitch.app/showcase/feat-photo-before.webp" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o result.webp
  • Scratch, tear and stain repair is automatic; no separate parameter is needed for it.
  • Whatever the input measures, the output is normalized to about 1 megapixel; the aspect ratio and the orientation are roughly preserved. Sending a larger source does not produce a larger result — keep your original. Very wide or very tall images (a panorama, say) can come back noticeably reshaped.

A successful call deducts from your monthly AI credits only; it does not count against the request quota. The cost depends on the operation: remove-bg, upscale, colorize, remove-object, ocr (per image) and listing-copy cost 1 credit; product-scene costs 2 (studio), 6 (relight) or 7 (lifestyle); face-restore, restore and headshot cost 9. Which failed requests are charged is listed under Quotas & Limits. (If your request quota is exhausted, AI calls also return 429 REQUEST_QUOTA_EXCEEDED.)

GET POST /v1/remove-objectAI · 1 credit

Removes masked objects with AI and fills the background naturally.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
maskstringRequired—Mask image: a URL in the query string or base64 in the JSON body. Must match source dimensions; white areas mark objects to remove, black areas are preserved.
formatstringOptionalauto (auto · jpeg · png · webp · tiff · avif · gif)Output format. auto: picked from the Accept header, defaults to WebP.
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Example

curl
curl "https://theglitch.app/api/v1/remove-object?url=https://theglitch.app/showcase/obj-before.webp&mask=YOUR_MASK_URL" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o result.webp
  • mask is required. Send a URL in the query string, or base64 data in the mask field of a JSON body (POST); if it is missing, MISSING_MASK is returned.
  • To prepare a mask, paint the areas to remove white in any editor and save as a PNG with the same dimensions as the source.

A successful call deducts from your monthly AI credits only; it does not count against the request quota. The cost depends on the operation: remove-bg, upscale, colorize, remove-object, ocr (per image) and listing-copy cost 1 credit; product-scene costs 2 (studio), 6 (relight) or 7 (lifestyle); face-restore, restore and headshot cost 9. Which failed requests are charged is listed under Quotas & Limits. (If your request quota is exhausted, AI calls also return 429 REQUEST_QUOTA_EXCEEDED.)

GET POST /v1/headshotAI · 9 credits

Generates a studio-style professional headshot from a portrait photo with AI — for CVs, LinkedIn and company team pages. The result is an image; format and quality apply as on the other AI endpoints.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
backgroundstringOptionalneutral (neutral · white · gray · black · office)Portrait background: neutral (default), white, gray, black or office.
aspectRatiostringOptional3:4 (3:4 · 1:1 · 4:5 · 2:3)Output aspect ratio: 3:4 (default), 1:1, 4:5 or 2:3.
formatstringOptionalauto (auto · jpeg · png · webp · tiff · avif · gif)Output format. auto: picked from the Accept header, defaults to WebP.
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Example

curl
curl "https://theglitch.app/api/v1/headshot?url=https://theglitch.app/showcase/det-face-s3-before.webp&background=office&aspectRatio=3:4" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o headshot.webp
  • This is NOT a biometric ID photo: it cannot be used for passports, ID cards, driving licences or official applications.
  • Only send your own photo, or a photo of someone who has given you permission (terms of use).
  • No gender or similar attribute is asked for; the headshot is generated from the uploaded photo.

A successful call deducts from your monthly AI credits only; it does not count against the request quota. The cost depends on the operation: remove-bg, upscale, colorize, remove-object, ocr (per image) and listing-copy cost 1 credit; product-scene costs 2 (studio), 6 (relight) or 7 (lifestyle); face-restore, restore and headshot cost 9. Which failed requests are charged is listed under Quotas & Limits. (If your request quota is exhausted, AI calls also return 429 REQUEST_QUOTA_EXCEEDED.)

GET POST /v1/ocrAI · 1 creditJSON response

Reads the text in an image with AI: receipts, invoices, menus, business cards, old documents. The default response is JSON (text, markdown, blocks, warnings); use output to get plain text, Markdown, HTML, CSV, Word (DOCX) or PDF.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
outputstringOptionaljson (json · txt · md · html · csv · docx · pdf)Output format. json (default) returns a structured result; txt, md, html and csv return text; docx and pdf return a downloadable document. Content types are in the table below.
csvDelimiterstringOptional; (; · , · tab)Delimiter for output=csv only: ; (default, Turkish Excel), , or tab.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Output formats

outputContent-TypeDescription
jsonapplication/json; charset=utf-8Default. Structured result; fields below.
txttext/plain; charset=utf-8Plain text; table cells are separated by tabs.
mdtext/markdown; charset=utf-8Markdown (GFM); tables as Markdown tables.
htmltext/html; charset=utf-8An HTML document (lang="tr"). Text in the image is never treated as markup; no raw HTML is produced.
csvtext/csv; charset=utf-8Tables the image prints with their own header row; otherwise one text column with a row per line. Receipts and price lists come back as plain lines, not tables. UTF-8 with a BOM, delimiter set by csvDelimiter.
docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentA Word document; attachment, filename="ocr.docx".
pdfapplication/pdfA re-typeset text PDF with Turkish characters embedded; attachment, filename="ocr.pdf".

JSON fields (output=json)

NameTypeDescription
textstringAll extracted text, as plain text.
markdownstringThe same content as Markdown (GFM).
blocksarrayThe document structure, in order: each block has a type (heading, paragraph, list, table) and, depending on the type, level, text, items or rows.
warningsstring[]Fixed warning keys (e.g. truncated, low_confidence, fallback_used); empty means no warnings.

Example: an image that contains a table with its own printed header row (Ürün, Tutar). A table is returned as a table only when the image prints a header row; receipt items and price lists come back as plain lines.

200 · application/json · output=json
{
  "text": "KAHVE EVİ\n\nFiş No: 0042\n\nÜrün\tTutar\nTürk kahvesi\t60,00\nSu\t15,00\n",
  "markdown": "# KAHVE EVİ\n\nFiş No: 0042\n\n| Ürün | Tutar |\n|---|---|\n| Türk kahvesi | 60,00 |\n| Su | 15,00 |\n",
  "blocks": [
    { "type": "heading", "level": 1, "text": "KAHVE EVİ" },
    { "type": "paragraph", "text": "Fiş No: 0042" },
    { "type": "table", "rows": [["Ürün", "Tutar"], ["Türk kahvesi", "60,00"], ["Su", "15,00"]] }
  ],
  "warnings": []
}

Example

curl
curl "https://theglitch.app/api/v1/ocr?url=https://theglitch.app/showcase/det-ocr-hero-before.webp&output=json" \
  -H "X-Api-Key: YOUR_API_KEY"
  • The output is a draft: check it against the original image before you use it, especially numbers, names and tables.
  • The input is a single image; PDF input is not accepted. Send a multi-page document page by page as images — each image is a separate request and is charged separately.
  • csv: only tables the image prints with their own header row are written as tables, row by row. Receipts and price lists are not treated as tables and stay as plain lines; if there is no table, no error is returned — each line of text becomes a single-column (text) row. The file is UTF-8 with a BOM; the default delimiter is a semicolon, for Turkish Excel (csvDelimiter).
  • docx and pdf return a file to download (Content-Disposition: attachment; filename="ocr.docx" / "ocr.pdf"). The PDF is the extracted text re-typeset, with an embedded font for Turkish characters; the original image is not included.
  • warnings carries fixed keys: truncated (the output looks cut short or stuck repeating; text may be missing or duplicated), fallback_used (the first reading looked unusable and the image was read again), low_confidence (no text was found, or it could not be read reliably). An empty array means no warnings. The same keys also arrive, comma-separated, in the X-Glitch-Warnings response header for every output format; the header is absent when there are no warnings.

A successful call deducts from your monthly AI credits only; it does not count against the request quota. The cost depends on the operation: remove-bg, upscale, colorize, remove-object, ocr (per image) and listing-copy cost 1 credit; product-scene costs 2 (studio), 6 (relight) or 7 (lifestyle); face-restore, restore and headshot cost 9. Which failed requests are charged is listed under Quotas & Limits. (If your request quota is exhausted, AI calls also return 429 REQUEST_QUOTA_EXCEEDED.)

GET POST /v1/listing-copyAI · 1 creditJSON response

Writes a Turkish marketplace listing draft from a product photo (Trendyol, Hepsiburada, n11 format). The response is JSON: title, description, features, color, material, keywords, altText and warnings.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
brandstringOptional≤ 60Brand name, 60 characters max. If given it is used in the title; otherwise a brand is written only if it can be read on the product. It reaches the model as data, not as an instruction.
categorystringOptional≤ 60Category hint (e.g. sneaker), 60 characters max. It reaches the model as data.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

JSON fields

NameTypeDescription
titlestringTitle in the brand + product type + key feature pattern, 100 characters max. A brand appears only if you sent one or it can be read on the product.
descriptionstringProduct description; paragraphs are separated by a blank line.
featuresstring[]Feature bullets that can be seen in the photo.
colorstring | nullDominant color; null when it cannot be determined from the photo.
materialstring | nullMaterial; null when it cannot be determined from the photo (no guessing).
keywordsstring[]Lower-case Turkish search keywords.
altTextstringAn objective image description for blind and low-vision users, 125 characters max.
warningsstring[]Warning keys: fallback_used (the first draft did not match the schema and was rewritten with a backup model), truncated (the title or alt text went over its limit and was shortened), wording_review (the text contains an exaggeration, health claim or unverifiable performance claim to review before publishing; the text is not changed, only flagged). An empty array means no warnings.

Example: a real response for the white shoe photo in the request above, with category=sneaker. The text can differ on every call and is a draft.

200 · application/json; charset=utf-8
{
  "title": "Beyaz Kanvas Dokulu Bağcıklı Sneaker Ayakkabı",
  "description": "Bu beyaz sneaker, sade ve yalın tasarımıyla günlük stilinizin temel parçalarından biri olmaya adaydır. Kanvas dokulu dış yüzeyi ve aynı tondaki dikiş detaylarıyla temiz bir görünüm sunan bu ayakkabı, her türlü kıyafetle kolayca uyum sağlar. Bağcıklı kapanış sistemi, ayak yapınıza göre ayarlanabilen bir yapı sunarken, ayakkabının genelindeki beyaz renk bütünlüğü modern bir estetik yaratır. Metal halkalı bağcık delikleri ve tonal bağcıklarıyla bütünüyle beyaz bir görünüm sergiler.\n\nGündelik kombinlerinizde kot pantolonlar, şortlar veya keten pantolonlarla bir araya getirerek zahmetsiz bir şıklık yakalayabilirsiniz. Sade tasarımı sayesinde hem spor hem de yarı resmi kıyafetlerle birlikte kullanılabilir. Ürünün burun kısmındaki dokulu kauçuk detay, tasarıma hareket katarken yan panellerdeki dikişler belirgin bir görünüm sergiler. Gardırobunuzdaki farklı renk ve desenlerle rahatça eşleştirebileceğiniz bu çok yönlü model, stilinize ferah bir dokunuş ekler.\n\nŞehir hayatının hareketli temposuna uyum sağlayan bu model, düşük bilekli yapısı ve klasik silüetiyle dikkat çeker. Taban kenarlarındaki ince çizgisel detaylar ve burun bölümündeki pütürlü doku, tasarımın yalınlığını destekleyen estetik unsurlardır. Farklı mekanlarda kullanıma uygun olan bu tasarım, nötr rengi sayesinde mevsim geçişlerinde de kurtarıcı bir parça rolü üstlenir. Minimalist detayları ve beyazın zamansız etkisini birleştiren bu ürünü, çeşitli aksesuarlarınızla kolayca tamamlayarak kendi tarzınızı yansıtabilirsiniz.",
  "features": ["Bağcıklı kapanış sistemi", "Kanvas dokulu dış yüzey", "Düşük bilekli tasarım", "Beyaz metal kuşgözü detayları", "Tonal dikiş özellikleri", "Dokulu burun koruması"],
  "color": "beyaz",
  "material": null,
  "keywords": ["beyaz sneaker", "kanvas ayakkabı", "bağcıklı sneaker", "günlük ayakkabı", "düz taban sneaker", "beyaz ayakkabı", "spor ayakkabı", "bez ayakkabı"],
  "altText": "Yan profilden görünen, beyaz renkli, kanvas dokulu ve beyaz bağcıklı düşük bilekli sneaker ayakkabı.",
  "warnings": []
}

Example

curl
curl "https://theglitch.app/api/v1/listing-copy?url=https://theglitch.app/showcase/feat-bgrm-shoe-before.webp&category=sneaker" \
  -H "X-Api-Key: YOUR_API_KEY"
  • The output is a draft: check details such as brand, size and material before you publish. Health claims and superiority claims such as "the best" or "flawless" are forbidden in the prompt; this is not a guarantee of legal compliance.
  • brand and category are optional (60 characters max) and reach the model as data, not as instructions; control characters are stripped.
  • color and material come back null when they are not visible in the photo (no guessing). The title is at most 100 characters and the alt text at most 125.
  • For now it writes Turkish only.
  • If the model cannot produce a result that matches the schema, it is retried once with a backup model; if that also fails you get 503 GPU_ERROR (Retry-After: 30) and no credits are charged.

A successful call deducts from your monthly AI credits only; it does not count against the request quota. The cost depends on the operation: remove-bg, upscale, colorize, remove-object, ocr (per image) and listing-copy cost 1 credit; product-scene costs 2 (studio), 6 (relight) or 7 (lifestyle); face-restore, restore and headshot cost 9. Which failed requests are charged is listed under Quotas & Limits. (If your request quota is exhausted, AI calls also return 429 REQUEST_QUOTA_EXCEEDED.)

GET POST /v1/product-sceneAI · 2–7 credits

Creates an extra image for a marketplace listing from a product photo: a white background with a soft shadow (studio), the chosen lifestyle setting (lifestyle) or studio light that keeps the background (relight). The result is an image.

Parameters

NameTypeRequiredDefault · RangeDescription
urlstringOptional—Public http(s) URL of the image to process. The response is cached for 60 minutes; if the image behind the URL changes, vary a parameter (e.g. &v=2) to get a fresh result.
imagestringOptional—Base64-encoded image (data-URI supported). Send in the JSON body.
filefileOptional—Multipart form file (field name: file). Keep other parameters in the query string.
sceneTypestringOptionalstudio (studio · lifestyle · relight)studio (default): white background with a soft shadow · lifestyle: the chosen lifestyle setting · relight: studio light, keeping the background. The credits charged depend on the type.
scenePresetstringOptionaloak_living (oak_living · marble_bath · kitchen_counter · concrete_minimal)Only with sceneType=lifestyle: oak_living (default; light oak table, Scandinavian living room), marble_bath (marble bathroom counter), kitchen_counter or concrete_minimal (minimal concrete).
aspectRatiostringOptional2:3 (2:3 · 1:1 · 3:4 · 4:5)Output aspect ratio: 2:3 (default, marketplace), 1:1, 3:4 or 4:5.
formatstringOptionalauto (auto · jpeg · png · webp · tiff · avif · gif)Output format. auto: picked from the Accept header, defaults to WebP.
qualityintOptional85 (1 … 100)Compression quality for lossy formats (JPEG, WebP). No effect on PNG.

Input can be url, image (base64), file (form) or a raw binary body — see Input Methods.

Response

HeaderExampleDescription
Content-Typeimage/webpThe result is an image; format and quality apply as on the other AI endpoints (WebP by default).
X-Glitch-Noticeproduct-redrawnProduct scene (product-scene) only: product-redrawn means the product was redrawn by AI (its original pixels were not pasted back); do not use that image as the main image. The relight type always redraws the product.

Example

curl
curl "https://theglitch.app/api/v1/product-scene?url=https://theglitch.app/showcase/feat-bgrm-shoe-before.webp&sceneType=studio&aspectRatio=2:3" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -o scene.webp
  • Credits depend on the type: studio 2, lifestyle 7, relight 6 AI credits. Without sceneType, studio is charged.
  • This is for extra images: the marketplace main image should stay the original white-background photo.
  • In the studio and lifestyle types the product's original pixels are pasted back into the result when the placement check passes. If it fails, lifestyle retries with a backup model, while studio returns the raw output with the X-Glitch-Notice: product-redrawn header. If the backup fails the check too, the lifestyle result carries the same header.
  • The relight type does not paste pixels back: the product is redrawn by AI, and lettering, logos and texture may change. Its output should not be used as the main image.
  • No free-text prompt is accepted; the scene is chosen only through sceneType and scenePreset. Ideally send a photo with a single product: if no product can be separated from the background, you get 422 GPU_INPUT_REJECTED and no credits are charged.
  • An invalid sceneType, scenePreset or aspectRatio value is rejected with 400 VALIDATION_ERROR before any AI call; no credits are charged. scenePreset is used only by the lifestyle type and is ignored by the others.

A successful call deducts from your monthly AI credits only; it does not count against the request quota. The cost depends on the operation: remove-bg, upscale, colorize, remove-object, ocr (per image) and listing-copy cost 1 credit; product-scene costs 2 (studio), 6 (relight) or 7 (lifestyle); face-restore, restore and headshot cost 9. Which failed requests are charged is listed under Quotas & Limits. (If your request quota is exhausted, AI calls also return 429 REQUEST_QUOTA_EXCEEDED.)

Quotas & Limits

Monthly request quotas depend on your plan. AI requests draw from a separate balance of AI credits, and every AI operation has a fixed credit cost. There is no per-minute rate limit. The quota period is your billing period on paid plans and the UTC calendar month on the Free plan (it resets on the 1st).

PlanRequests / moAI credits / moMax resolution
Free500102048 × 2048
Starter15,0002004000 × 4000
Pro75,0002,0008000 × 8000
Business300,00010,0008000 × 8000
Scale1,000,00030,0008000 × 8000
  • A single request combining resize + 5 effects + format conversion = 1 request.
  • AI endpoints deduct from your AI credits only; they do not count against the request quota. The credit cost depends on the operation: remove-bg, upscale, colorize, remove-object, ocr (per image) and listing-copy cost 1 credit; product-scene costs 2 (studio), 6 (relight) or 7 (lifestyle); face-restore, restore and headshot cost 9. vectorize (SVG) is not an AI operation and counts against the request quota. Current weights are in the aiUnits field of /api/v1/info, and the credits charged by a call in the X-Glitch-AI-Units header (sent only when credits were charged). If you have fewer credits left than the operation costs, the request returns 429 GPU_QUOTA_EXCEEDED without running; the body carries required, limit, used and resetsAt.
  • Only successful responses count against the request quota; the one exception is vectorize, where a request refused after vectorizing has run (an output too detailed to serve) also counts as 1 request. For AI credits, a successful call deducts its weight, and so does a request that disconnects after the AI work was sent to the provider or fails after the AI step for a reason not on our side. A fault on the AI service, temporary throttling (GPU_BUSY), an image the model rejects (GPU_INPUT_REJECTED), 4xx validation errors and our own timeouts (408) deduct nothing.
  • URL inputs are cached for 60 minutes (the window refreshes on each hit); an identical request returns instantly without reprocessing. Cached responses do not count against your quota and carry no X-Glitch-Processing-Time. Professional headshots, image to text, listing copy and SVG vectorization results are never cached: on those endpoints an identical request is processed again and counts again.
  • When your request quota runs out, AI requests stop too: you get 429 REQUEST_QUOTA_EXCEEDED even if you still have AI credits left.

Responses include custom headers so you can monitor your usage:

HeaderExampleDescription
X-Glitch-PlanproYour current subscription plan
X-Glitch-Requests-Remaining74922Requests remaining in this period, including this one. AI requests are not counted here.
X-Glitch-GPU-Remaining1958AI credits remaining in this period, including this request
X-Glitch-AI-Units9The AI credits charged by this call. Sent only when credits were charged; if the header is absent, this call was not charged.
X-Glitch-Warningslow_confidenceOn image to text (ocr), listing copy (listing-copy) and vectorize: comma-separated warning keys. ocr: low_confidence, truncated, fallback_used (sent with every output format); listing-copy: fallback_used, truncated, wording_review (the same as warnings in the JSON response); vectorize: large_output (the SVG is over 2 MB or 5,000 paths). Absent when there are no warnings.
X-Glitch-Noticeproduct-redrawnProduct scene (product-scene) only: product-redrawn means the product was redrawn by AI (its original pixels were not pasted back); do not use that image as the main image. The relight type always redraws the product.
X-Glitch-Processing-Time142msServer-side processing duration
Retry-After10On 429 responses and on 503 GPU_ERROR: how many seconds to wait before retrying. For AI_FAILURE_LIMIT, fix the input before trying again once it has passed.
Tip: These counts include the request being served, so 0 means you just used the last one and the next request returns 429 with REQUEST_QUOTA_EXCEEDED or GPU_QUOTA_EXCEEDED. You can also get GPU_QUOTA_EXCEEDED before your AI credits reach 0: when fewer credits are left than the operation costs (say 5 credits for a 9-credit restore). Treat them as a close estimate rather than an exact ledger: requests running in parallel may not be reflected yet. A 429 can also arrive with quota to spare: the GPU_BUSY code means the AI service is momentarily busy and the call can be retried after Retry-After; AI_FAILURE_LIMIT means too many of your recent AI requests failed on the model — once the wait is over, send a corrected input, not the same request.

Error Codes

Error responses are always JSON with a 4xx/5xx status code. Successful responses are binary images, except /image-info and /listing-copy (JSON), /ocr (JSON, text or a document, depending on output) and /vectorize (SVG). Tell success from failure by the status code, not the Content-Type.

Error response format

4xx/5xx · application/json
{
  "error": true,
  "code": "INVALID_INPUT",
  "message": "No image input provided. Use url, image (base64), file upload, or binary body."
}
Extra fields: Some errors carry more than these three fields: 429 quota responses add limit, used, resetsAt, retryAfterSeconds and upgrade (plus required for AI credits); 429 GPU_BUSY and AI_FAILURE_LIMIT add retryAfterSeconds; 401 adds signup and docs.
HTTPCodeDescription
400INVALID_INPUTImage input missing or invalid (one of url / image / file / binary body is required). Also returned when an AI flag is not sent as a plain query parameter or a top-level field of a UTF-8 JSON body (e.g. a prefixed query name, a UTF-16 body).
400MULTIPLE_AI_OPERATIONSMore than one AI flag in a single request (e.g. /process?removeBackground=true&upscale=true), or an AI flag added to an /ocr request. Send each AI operation as its own request; retrying the same request gives the same result.
400INVALID_FORMATThe requested output format is not supported, or the uploaded file is in a format we do not accept. The error message names the format. /vectorize accepts PNG, JPEG and WebP only.
403FORMAT_REQUIRES_PLANTIFF and AVIF are available on paid plans — on both input and output. The response body carries format, direction and requiredPlan. This request does not count against your monthly quota.
400VALIDATION_ERRORImage exceeds size, resolution (plan-based), the 80-megapixel decode limit, the 2.1-megapixel (1448×1448) source cap for AI upscaling, or format limits, or a parameter value is invalid (e.g. quality; background or aspectRatio for headshot; output or csvDelimiter for ocr; sceneType, scenePreset or aspectRatio for product-scene; a brand or category over 60 characters and a blank image for listing-copy; colors, curves, the 4-megapixel / 4096 px input limit, an input too detailed to vectorize (photo-like) and an output too detailed to serve for vectorize). On AI endpoints this is returned before the request reaches the AI, so it costs no AI credits. On vectorize, a refusal that comes after vectorizing has run (an output too detailed to serve) still counts as 1 request against your quota.
400MISSING_WATERMARKwatermarkText parameter is missing (required in the query string).
400INVALID_SCALEupscaleScale must be 2 or 4.
400MISSING_MASKmask parameter is missing (send a URL in the query string or base64 in the JSON body).
400INVALID_MASKMask image could not be resolved (invalid URL/base64).
400INVALID_PRESETUnknown preset name; the response includes the list of valid presets.
400INVALID_IMAGEImage could not be decoded (corrupt or unsupported file). Returned by /image-info, /ocr, /listing-copy and /vectorize (on /ocr and /listing-copy before the AI step, so no credit is spent); the other processing endpoints report the same condition as VALIDATION_ERROR.
401UNAUTHORIZEDAPI key missing or invalid.
403GPU_NOT_AVAILABLEAI transforms are not included in your current plan; these endpoints stay closed until you upgrade.
403FEATURE_DISABLEDThe requested feature is disabled on the server.
408TIMEOUTThe request exceeded its time budget: 30 s for quick transforms, 90 s for AI transforms. Upload time and the source-URL fetch (10 s) both count against that budget.
413PAYLOAD_TOO_LARGEThe request body exceeded the server limit. A base64 body is about a third larger than the raw image, so it can hit the cap first.
422GPU_INPUT_REJECTEDThe AI model refused this input — the image may be corrupt or carry unsupported content, the object-removal mask may not match the image, or no product could be separated from the background for a product scene. This is permanent: retrying the same input will not help. Size-related refusals do NOT land here — they return VALIDATION_ERROR before the AI runs and cost no AI credits.
429REQUEST_QUOTA_EXCEEDEDMonthly request quota exhausted.
429GPU_QUOTA_EXCEEDEDNot enough AI credits left for this operation. The body carries required (the operation's cost), limit, used and resetsAt (when the period ends); Retry-After runs until the end of the period.
429GPU_BUSYThe AI service is momentarily busy. Wait the number of seconds in the Retry-After header (also in the retryAfterSeconds field) and retry — this is not a quota error.
429SERVER_BUSYConcurrency gate: the server is at capacity right now. Wait for the Retry-After header's value and retry — this is not a quota error.
429AI_FAILURE_LIMITToo many of your account's recent AI requests failed in the model, so new AI requests are refused for a short while. Once the Retry-After header (also retryAfterSeconds in the body) has passed, retry with a corrected input (image, format, mask). This is not a quota error.
500PROCESSING_ERRORInternal image processing error.
500GPU_UNAVAILABLEA problem on our side: the AI provider is not configured, or the provider rejected our account or configuration. Retrying will not help — open a support ticket if it persists.
503GPU_ERRORThe AI service failed temporarily — this is not permanent. The response always carries Retry-After: 30; wait that long and retry. It is also returned when there is no capacity for an image this size at that moment; a smaller image may go through.
503GPU_UPLOAD_FAILEDThe image could not be sent for AI processing. This is transient: wait a moment and retry the same request. This response carries no Retry-After.
The Retry-After header Every 429 response and 503 GPU_ERROR carry a Retry-After header (always 30 s for GPU_ERROR), and it is exposed through CORS for browser calls. When the header is there, use the seconds it gives you instead of a fixed delay. 408 TIMEOUT and 503 GPU_UPLOAD_FAILED do not carry it; both can still be retried, with a delay you pick yourself.

File Formats

FormatInputOutputNote
JPG / JPEG—
PNG—
WebP—
AVIFPaid plans only — input and output. AVIF’s quality scale is not the same as WebP’s: at the same quality value it produces higher fidelity and therefore a larger file. For smaller files try a quality of 60-70.
TIFFPaid plans only — input and output. Output is lossless (Deflate) and quality is ignored.
GIFGIF input is read, output is served as PNG. For animated GIFs only the first frame is processed.
BMPBMP is not supported. If you upload one you get an error that names the format; your file is not corrupt.
format=auto: The best format is picked from the Accept header, defaulting to WebP. With background removal, auto falls back to PNG to keep transparency.

Webhooks

Receiving long-running AI results via webhooks is on our roadmap — coming soon. The draft below shows the planned payload shape.

Coming soon
draft payload
{  "event": "transform.completed",  "job_id": "job_8f3a91",  "endpoint": "/v1/upscale",  "status": "ok",  "duration_ms": 3214,  "result_url": "https://cdn.theglitch.app/r/8f3a91.png"}

Changelog

v1.1 · October 2026

  • Image to text (OCR): reads the text on receipts, invoices, menus, business cards and old documents, and returns it as JSON, TXT, Markdown, HTML, CSV, Word (DOCX) or PDF. The output is a draft — check it before you use it. 1 AI credit per image.
  • Professional headshot: a studio-style portrait for CVs, LinkedIn and company team pages, with 5 backgrounds and 4 aspect ratios. It is not a biometric ID photo. 9 AI credits per call.
  • Listing copy: a Turkish listing draft from a product photo in the format Trendyol, Hepsiburada and n11 use — title, description, features, color, material, keywords and alt text (JSON). It is a draft; check it before you publish. Batch processing can also collect the listings in a single CSV. 1 AI credit per image.
  • Product scene: an extra image from a product photo — white background (2 credits), relight (6 credits) or a lifestyle setting (7 credits). The marketplace main image should stay the original white-background photo; the panel and the API tell you when the product was redrawn by AI.
  • Vectorize to SVG: turns flat-color logos and icons into 2–16 color SVG vectors; Turkish letters in a logo keep their shape. It uses no AI credits and counts as 1 request.
  • The AI quota is now AI credits: each AI operation deducts its own weight — background removal, upscaling, colorize, object removal, OCR and listing copy cost 1; product scene costs 2, 6 or 7 depending on the type; face restore, photo restore and professional headshot cost 9. The free plan now includes 10 credits a month.
  • New error codes: MULTIPLE_AI_OPERATIONS (more than one AI operation in a single request) and AI_FAILURE_LIMIT (repeated failed AI requests, with Retry-After). 503 GPU_ERROR now always carries Retry-After: 30.
  • The Studio now has 19 operations and shows how many credits an AI operation will use before it runs. The separate "scratch repair" option in photo restore is gone: restoration already removes scratches.

v1.0.1 · 17 August 2026

  • AI requests no longer count against your monthly request quota. Background removal, upscaling, colorize, face restore, photo restore and object removal now consume only the AI quota, so a plan's request allowance is the full amount advertised.
  • X-Glitch-Requests-Remaining and X-Glitch-GPU-Remaining now include the request being served. The last request your plan allows reports 0 instead of 1, matching the 429 you get on the next one.
  • Remaining counts are a close estimate rather than an exact ledger: requests running in parallel may not be reflected yet.

v1.0 · 29 May 2026

  • 8 quick image processing tools: resize, format conversion, effects, watermark, optimize, crop, social media sizes and image info.
  • 6 AI tools: background removal, AI upscaling, colorize, face restore, photo restore and object removal.
  • 3 access channels: web panel, REST API and MCP server.
  • 4 plans: Free, Starter, Pro and Business.

All release notes