canonical: https://jentic.com/apis/apilayer.com/apilayer

# Apilayer Image Upload API

Jentic publishes the only available OpenAPI specification for the apilayer Image Upload API, keeping it validated and agent-ready. The Image Upload API uploads JPG, PNG, and GIF images directly or by URL, then exposes operations for resize, crop, and optimize. It is built for product catalogs and content sites that need a single vendor for storage and on-the-fly transformation, and authentication uses an apikey header issued from the apilayer dashboard. Seven endpoints cover the upload, retrieval, deletion, and three transformation actions.

## For AI agents

Upload, transform, and serve images through 7 apilayer endpoints covering upload, resize, crop, optimize, and delete.

## Scope

Does not handle video processing, AI background removal, or DAM-style metadata workflows - use for image upload, transformation, and retrieval only.

## Capabilities

- Upload an image directly via multipart POST or by URL with POST /upload/url
- Retrieve image metadata and the hosted URL via GET /image/{imageId}
- Resize an existing image to specified width and height via POST /resize
- Crop an existing image to a target rectangle via POST /crop
- Optimize an image's file size while preserving visible quality via POST /optimize
- Delete a previously uploaded image via DELETE /image/{imageId} when it is no longer needed

## Use cases

### Product image pipeline

Upload product photographs once via POST /upload, then call /resize, /crop, and /optimize to derive the thumbnails, hero images, and listing tiles a storefront needs. The Image Upload API hosts the resulting images so the storefront can serve them directly without operating its own CDN. This collapses what is usually a multi-tool pipeline into a small set of REST calls behind a single apikey.

Example prompt: POST /upload with the original image, then POST /resize with the returned imageId, width=800, and height=800 to produce a square thumbnail.

### Content migration from external URLs

Move images already hosted elsewhere into apilayer's storage by passing the source URL to POST /upload/url. The API fetches and stores the image and returns a stable imageId you can use with /resize, /crop, and /optimize. This is well suited for migrating a blog or catalog onto apilayer without manually downloading and re-uploading every asset.

Example prompt: POST /upload/url with body {url:'https://oldsite.example.com/photo.jpg'} to import the image and receive its new imageId.

### On-demand image optimization for performance

Run /optimize over uploaded images to reduce payload size for faster page loads, especially on mobile. The endpoint preserves visible quality while stripping unnecessary metadata and re-encoding more efficiently, and the optimized result can be retrieved through /image/{imageId}. This gives a cheap performance lift without changing the storefront's image markup.

Example prompt: POST /optimize with the imageId and optional quality parameter to produce a smaller file while keeping the same dimensions.

### Agent-driven media operations

An AI agent maintaining a content catalog can call upload, transform, and delete operations through Jentic without ever holding the apilayer apikey. Jentic returns the relevant operation schemas on demand and injects credentials at execution time, so the agent's job is just to pick the right transformation for each piece of content.

Example prompt: Through Jentic, search 'upload and resize an image', load the apilayer.com /upload and /resize operations, and execute them in sequence with the new asset.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /upload | Upload an image via multipart |
| POST | /upload/url | Upload an image from a remote URL |
| POST | /resize | Resize an uploaded image |
| POST | /crop | Crop an uploaded image |
| POST | /optimize | Optimize file size of an uploaded image |
| GET | /image/{imageId} | Retrieve image metadata |
| DELETE | /image/{imageId} | Delete an uploaded image |

## Key resources

- **Upload** — Upload images directly or from a URL via /upload and /upload/url.
- **Manipulation** — Resize, crop, and optimize images via /resize, /crop, and /optimize.
- **Retrieval** — Get and delete hosted images via /image/{imageId}.

## Why Jentic

- **Setup:** Wiring the apilayer Image Upload API by hand means setting up its API key, learning the upload and transformation operations, and handling image responses yourself. Through Jentic you install once, import apilayer Image Upload from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** The apilayer Image Upload API puts the image id in the URL path (/image/{imageId}) while uploads and transforms take parameters in the request, so scope the agent to the operations it needs, such as uploading and retrieving an image, and leave out delete unless you add it. You choose the allowed operations, so the agent only calls what you list.
- **Credential handling:** Your apilayer key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'upload an image' or 'resize an image', and Jentic returns the matching apilayer Image Upload operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Cloudinary Upload API** — Mature media platform with extensive transformation pipelines.
- **Filestack** — Upload and processing API with strong picker UI components.
- **remove.bg** — Specialised background-removal API.

## FAQ

### Why is there no official OpenAPI spec for the Image Upload API?

apilayer does not publish a standalone OpenAPI specification for the Image Upload API. Jentic generates and maintains this spec so that AI agents and developers can call Image Upload API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer .

### What authentication does the Image Upload API use?

The API uses an apiKey passed in the apikey request header. Issue keys from the apilayer dashboard. Through Jentic, the apikey is held in the vault and added to the request server-side, so the raw key never reaches the agent.

### Can I import an image from an existing URL instead of uploading bytes?

Yes. POST /upload/url with the source URL and apilayer fetches the image, stores it, and returns an imageId you can use with /resize, /crop, /optimize, or /image/{imageId}.

### How do I run an image optimization through Jentic?

Search Jentic for 'optimize an image', load the apilayer.com /optimize operation, and execute with the imageId from a prior /upload call. The optimized image is retrievable via GET /image/{imageId}.

### What formats does the Image Upload API support?

The spec describes JPG, PNG, and GIF inputs. /resize, /crop, and /optimize operate on those formats and return processed assets in the same family. WebP and HEIC are not declared in the spec.

### What are the rate limits for the Image Upload API?

Rate limits are not declared in the OpenAPI spec. apilayer enforces monthly quotas tied to subscription plan, visible on the apilayer dashboard. Treat HTTP 429 as a signal to back off.

### Can I limit what my agent is allowed to do with the Image Upload API?

Yes. Jentic One is self-hosted, so you run it and your own rules decide which apilayer Image Upload operations your agent may call. You can allow just uploading and retrieving images (POST /upload, POST /upload/url, GET /image/{imageId}) plus the transforms you need (POST /resize, POST /crop, POST /optimize), and leave out DELETE /image/{imageId} so the agent cannot remove hosted assets. Your Jentic One instance holds the apilayer key and injects it at execution time, so the agent only calls the operations you list and never sees the raw credential.
