PixelMagic Image API
One REST API for AI image generation, editing, upscaling, background removal, object removal, layers and image translation — plus an MCP server so AI agents can use the same tools. Requests use the same credits as the web app.
Authentication
Create an API key in your dashboard (it is shown once) and send it as a Bearer token:Authorization: Bearer sk_live_…. Image endpoints accept an uploaded file or a public HTTPS image_url.
Quick start
curl -X POST https://pixelmagic.studio/api/v1/remove \
-H "Authorization: Bearer $PIXELMAGIC_API_KEY" \
-F "file=@product.jpg" \
-o product-cutout.pngEndpoints
| Endpoint | Request | Response |
|---|---|---|
Generate POST /api/v1/generate | JSON { prompt, model?, ...params } | image/png |
Edit POST /api/v1/edit | multipart { file | image_url, prompt, model?, refs? } or JSON { image_urls: [...], prompt } | image/png |
Upscale POST /api/v1/upscale | multipart { file | image_url, model?, scale? } | image/png |
Remove background POST /api/v1/remove | multipart { file | image_url } | image/png |
Remove object POST /api/v1/remove-object | multipart { file, mask } or JSON { image_url, mask_url } | image/png |
Layers POST /api/v1/layers | multipart { file | image_url } | { layers: [dataURI], count, creditsUsed } |
Localize POST /api/v1/localize | multipart { file | image_url, languages, prompt?, enhance? } | { results: [{ language, image }], creditsUsed } |
Enhance prompt POST /api/v1/enhance | JSON { prompt, kind? } | { prompt } (free) |
Account GET /api/v1/me | — | { ok, credits, plan } |
Models GET /api/v1/models | — (no key needed) | { models: [{ id, name, category, credits, params, … }], latest_aliases } |
Multi-reference edits: the first image is edited, extra images are references the prompt can call “image 2”, “image 3” (+1 credit each). Remove-object masks are white where the object should be erased.
Choosing a model
Pass model with any id from GET /api/v1/models (e.g. flux2-pro, seedream-5-flash), or a family alias that always uses the newest model of that family — latest:generate:flux, latest:edit:nano-banana. Omit it for the default. An unknown model returns HTTP 400 (it is never silently swapped). Model-specific settings such as aspect_ratio, image_size or quality go in the same body; values outside a model's listed options fall back to its default.
Rate limits
Requests are limited per API key per minute by plan — Free 5, Starter 20, Pro 60, Business 200. Over the limit you get HTTP 429.
MCP server for AI agents
Give Claude Desktop, Cursor or any MCP client the full toolkit: generate, edit, upscale, remove background, remove object, layers, localize, enhance, list models, account and health. Every tool calls the REST API above, so it uses the same key, credits and limits.
{
"mcpServers": {
"pixelmagic": {
"command": "uvx",
"args": ["pixelmagic-mcp"],
"env": { "PIXELMAGIC_API_KEY": "sk_live_..." }
}
}
}Needs uv. More integrations — Figma, Photoshop, Zapier, Make, CLI — are on the integrations page. A plain-text summary for LLMs is at /llms.txt.