Create a free account to get an API key
imgly API for developers and bots
Upload images to imgly from scripts, apps and AI agents, then use the permanent links anywhere: in posts on other websites, in chats, in documents. Two ways to connect, one contract:
- REST:
https://imgly.top/api/v1 - MCP (Model Context Protocol, Streamable HTTP):
https://imgly.top/mcp
1. Get a key
Sign in, open Settings > API keys, and create a key. Pick its permissions:
| Permission | Allows |
|---|---|
images:write |
Upload images |
images:read |
Read and list your images |
images:delete |
Delete your images |
posts:write |
Create and delete posts |
posts:read |
Read posts |
Keys look like imk_ followed by 40 letters and digits. They are shown once. Send them as:
Authorization: Bearer imk_...
X-Api-Key: imk_... also works.
2. Limits
- Each key: 1,000 uploads and 10 GB per day by default (resets at midnight UTC).
- Max file size: 20 MB, GIFs 50 MB. Max 50 megapixels.
- 120 requests per minute per key. Responses carry
X-RateLimit-LimitandX-RateLimit-Remaining. - Formats: JPEG, PNG, GIF (animated is fine), WebP (still images).
Adult or sexual content is never allowed. Every upload is scanned. Rejected uploads return blocked_content and add a strike to the key; three strikes revoke it.
3. Upload an image
POST /api/v1/images
Send exactly one of:
file: multipart file uploadsource_url: a public http or https URL to copy the image frombase64: the image bytes in base64 (adata:image/...;base64,prefix is fine)
Optional fields: title (120 chars, also used as alt text), description (1000 chars), idempotency_key (retries with the same key return the first result instead of a duplicate).
# From a URL
curl -X POST https://imgly.top/api/v1/images \
-H "Authorization: Bearer $IMGLY_KEY" \
-H "Content-Type: application/json" \
-d '{"source_url":"https://example.com/picture.jpg","title":"Example","idempotency_key":"offer-123-logo"}'
# A local file
curl -X POST https://imgly.top/api/v1/images \
-H "Authorization: Bearer $IMGLY_KEY" \
-F "[email protected]" -F "title=Example"
Response (201 Created, or 200 with "duplicate": true when you uploaded the same file before):
{
"image": {
"id": "aB3xK9q",
"status": "ready",
"title": "Example",
"mime": "image/jpeg",
"width": 1600,
"height": 900,
"size": 284113,
"animated": false,
"urls": {
"direct": "https://i.imgly.top/aB3xK9q.jpg",
"medium": "https://i.imgly.top/aB3xK9q_m.webp",
"thumb": "https://i.imgly.top/aB3xK9q_t.webp",
"page": "https://imgly.top/i/aB3xK9q"
},
"embed": {
"markdown": "",
"html": "<img src=\"https://i.imgly.top/aB3xK9q.jpg\" width=\"1600\" height=\"900\" alt=\"Example\">",
"bbcode": "[img]https://i.imgly.top/aB3xK9q.jpg[/img]"
}
},
"duplicate": false
}
Which URL to use:
urls.direct: the full-size original. Permanent, hotlinking allowed.urls.medium: up to 1080 px wide WebP. Best for article images and cards.urls.thumb: 320 px wide WebP.
If status is review, the filter was unsure and a moderator will check the image. Its URLs start working after approval; poll GET /api/v1/images/{id}.
4. Other endpoints
| Method | Path | Permission | Purpose |
|---|---|---|---|
GET |
/api/v1/images/{id} |
images:read |
One of your images |
GET |
/api/v1/images?limit=30&cursor=... |
images:read |
Your images, newest first. Pass next_cursor to page. |
DELETE |
/api/v1/images/{id} |
images:delete |
Delete permanently. Links stop working. |
POST |
/api/v1/posts |
posts:write |
Publish images as a post (see below) |
GET |
/api/v1/posts/{id} |
posts:read |
A post |
DELETE |
/api/v1/posts/{id} |
posts:write |
Delete your post (the images stay) |
GET |
/api/v1/tags?limit=50 |
any | Existing tags, featured and most used first |
GET |
/api/v1/me |
any | Daily quota, key permissions, account |
GET |
/api/v1/docs |
none | This guide as Markdown |
Create a post
curl -X POST https://imgly.top/api/v1/posts \
-H "Authorization: Bearer $IMGLY_KEY" -H "Content-Type: application/json" \
-d '{"title":"Free cloud credits this week","image_ids":["aB3xK9q"],"tags":["deals","cloud"],"visibility":"public"}'
title: optional, up to 140 characters. Untitled posts show as "Untitled post".description: optional, up to 5000.image_ids: 1 to 50 of your uploaded image IDs, in display order.tags: up to 5. Reuse names fromGET /api/v1/tags; new tags are limited per day.captions: optional object of image ID to caption (up to 500 characters each), shown under each image.visibility:public(feed and search) orunlisted(link only). Keys created without "Allow public posts" can only create unlisted posts.- Public posts from accounts younger than 7 days wait for a moderator (
"status": "pending").
5. Errors
Every error has the same shape and a stable code:
{ "error": { "code": "quota_exceeded", "message": "Daily upload limit reached (1000 images). It resets at midnight UTC." } }
| HTTP | code | Meaning |
|---|---|---|
| 401 | unauthenticated |
Missing or invalid key |
| 403 | forbidden |
The key lacks a permission |
| 404 | not_found |
Not one of your images or posts |
| 413 | too_large |
File or pixel count over the limit |
| 415 | unsupported_type |
Not JPEG, PNG, GIF or still WebP |
| 422 | blocked_content |
Rejected by the content filter |
| 422 | invalid_image, missing_image, invalid_base64, invalid_source_url, source_fetch_failed |
Fix the request |
| 429 | quota_exceeded, rate_limited |
Wait; see Retry-After or meta.resets_at |
6. MCP for AI agents
Add imgly as a remote MCP server in Claude, ChatGPT, Grok, Cursor, VS Code, OpenClaw or any MCP client:
- URL with the key in the path (for clients without custom headers):
https://imgly.top/mcp/imk_... - Or URL
https://imgly.top/mcpwith headerAuthorization: Bearer imk_...
Tools (shown according to the key's permissions):
| Tool | Does |
|---|---|
upload_image |
Upload from source_url or base64. Returns the same object as REST. |
get_image, list_my_images, delete_image |
Manage your images |
create_post, get_post, delete_post |
Publish to the feed |
list_tags |
Existing tags |
get_quota |
Remaining daily allowance |
Tool errors come back as results with isError: true and the same error.code values, so agents can read and fix them.
Quick test with curl:
curl -s https://imgly.top/mcp -H "Authorization: Bearer $IMGLY_KEY" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"upload_image","arguments":{"source_url":"https://example.com/a.png"}}}'
7. Recipe: images for another site (for example dealfinder.top)
- Your bot finds an image it wants to use (a product screenshot, a logo).
- It calls
upload_imagewithsource_urland anidempotency_keysuch asdealfinder-offer-<slug>. - It takes
urls.medium(orurls.direct) from the result and passes that URL to the other site.
The other site stores only the URL. imgly keeps the file, serves it from its CDN, and the link never changes.
Support
Questions about the API, higher quotas or a key that stopped working: email [email protected] with your username and the key prefix (never the full key).