ImgPipeline Developer API
The ImgPipeline Developer API allows you to integrate image optimization and AI-powered background removal directly into your applications, microservices, and CI/CD pipelines. Our backend is executed completely at the edge on our global edge network, guaranteeing high throughput and low-latency responses.
β‘ 60-Second Production Quickstart
ImgPipeline is a drop-in replacement. You can switch from competitors and push to production with zero code refactoring in three simple steps:
Swap Config
Replace your existing competitor base URL and credentials. Zero refactoring required:
// TinyPNG replacement
tinify.key = "imgp_...";
tinify.proxy = "https://api.imgpipeline.com/shrink";
Deploy to Prod
Save your config and deploy. Or automate optimizations by adding the GitHub Action to your repository's actions.
Authentication
To authenticate your requests, you must generate an API Key inside the developer dashboard. Send this key in the Authorization header of every request as a Bearer token:
Authorization: Bearer imgp_your_api_key_here
Endpoint Matrix
ImgPipeline acts as a 1:1 drop-in replacement proxy for major media processing APIs, allowing you to optimize your media infrastructure billing with zero code refactoring.
/v1/shrink
Drop-in replacement for TinyPNG API. Compresses the provided image file binary and centers it on a solid background if margins are added.
Request Options
Authorization: Bearer token (or standard HTTP Basic authentication where the username is your API key)Content-Type:application/octet-streamor raw image MIME type- Query Parameter
bg: Hex background color code for padded margins (e.g.#FFFFFF, Default:#FFFFFF) - Query Parameter
strip_metadata: Set totrueto strip GPS location, camera details, and EXIF headers
cURL Example
curl -X POST "https://api.imgpipeline.com/v1/shrink?bg=%23FFFFFF&strip_metadata=true" \
-H "Authorization: Bearer imgp_your_api_key_here" \
-H "Content-Type: application/octet-stream" \
--data-binary @product.png \
--output optimized.png
/v1/removebg
Drop-in replacement for Remove.bg API. Removes backgrounds from images using edge-based GPU AI networks.
Request Options
Authorization: Bearer token, active Day Pass, orX-Api-KeyheaderContent-Type:multipart/form-dataorapplication/octet-stream- Multipart field
image_file: Binary file data - Multipart field
image_url: Fetch and process image from a public URL - Multipart field
image_file_b64: Base64-encoded image string
Response Formats
Returns raw transparent PNG bytes by default. If the Accept header is set to application/json, returns a JSON object containing the base64 output: { "data": { "result_b64": "..." } }.
/v2/edit/background
Drop-in replacement for the Photoroom background editor API. Isolate your subject and replace backgrounds with solid colors.
Request Options
x-api-key: Your API key header (or standard Bearer token in theAuthorizationheader)Content-Type:multipart/form-data- Multipart field
image_file: Binary file data - Multipart field
image_url: Target URL of the image to fetch - Multipart field
bg_color: Hex code (e.g.#FFFFFF) to apply as a solid background. If set, centers the subject on a 1:1 padded frame.
cURL Example
curl -X POST "https://api.imgpipeline.com/v2/edit/background" \
-H "x-api-key: imgp_your_api_key_here" \
-F "[email protected]" \
-F "bg_color=#F3F4F6" \
--output subject-isolated.png
/v1/upload
Drop-in replacement for the Kraken.io image optimizer API. Submits images and returns optimized assets.
Request Options
Content-Type:application/jsonormultipart/form-data- JSON Payload structure:
{ "auth": { "api_key": "YOUR_KEY" }, "url": "https://remote.com/image.jpg" } - Multipart
file/image: File payload - Multipart
auth: JSON string containing api credentials{"api_key": "YOUR_KEY"}
Response Output (JSON)
{
"success": true,
"file_name": "optimized.jpg",
"original_size": 240500,
"kraked_size": 89400,
"saved_bytes": 151100,
"kraked_url": "https://api.imgpipeline.com/v1/output/temp-uuid"
}
/cloudinary-proxy/image/fetch/:params/*
Alternative to Cloudinary fetching. Transformed assets are fully cached at the global edge network. Subsequent cached deliveries consume 0 credits.
URL Transformation Matrix
w_[pixels]: Resize width (e.g.w_300)h_[pixels]: Resize height (e.g.h_300)c_fit/c_limit: Contain image inside boundariesc_fill: Crop image to cover areac_crop: Direct pixel croppingc_scale: Scale down dimensions- Query Parameter
api_keyorkey: Your API key credential
Example HTML Tag
<img src="https://api.imgpipeline.com/cloudinary-proxy/image/fetch/w_400,h_400,c_fill/https://example.com/product.jpg?key=imgp_your_key">
/v1/chat/completions
Drop-in replacement for OpenAI Vision completion API. Employs Gemini 2.5 Flash at the edge to describe images or compile metadata and alt texts.
API Compatibility
Matches standard OpenAI payload schema (with messages, image_url content type) and system instructions. Ideal for automated alt text generators.
Node.js Integration
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: 'imgp_your_api_key_here',
baseURL: 'https://api.imgpipeline.com/v1'
});
const response = await openai.chat.completions.create({
model: 'gpt-4o-mini',
messages: [{
role: 'user',
content: [
{ type: 'text', text: 'Generate descriptive alt text.' },
{ type: 'image_url', image_url: { url: 'https://example.com/product.jpg' } }
]
}]
});
console.log(response.choices[0].message.content);
/aws/rekognition
Drop-in alternative to AWS Rekognition for image content classification and safety moderation checks.
Request Options
Authorization: Standard AWS SigV4 header containing your API key as the Credential keyX-Api-Key: Direct key header fallback- JSON Payload structure:
{ "Image": { "Bytes": "BASE64_BYTES..." }, "MinConfidence": 50 }
Response Output (JSON)
{
"ModerationLabels": [
{ "Name": "Suggestive", "Confidence": 89.2, "ParentName": "Explicit Nudity" },
{ "Name": "Violence", "Confidence": 92.4 }
],
"ModerationModelVersion": "EdgeResNet-50.1"
}
/api/seo-rename
Custom API endpoint. Analyzes image content via AI to output search-engine-optimized, hyphenated, lowercase names. Supports batch renaming.
Request Options
Authorization: Bearer token (Required)Content-Type:application/json- JSON Single:
{ "name": "IMG_9912.png", "image": "BASE64_DATA" } - JSON Batch:
{ "images": [{ "name": "...", "image": "..." }] }
cURL Example
curl -X POST "https://api.imgpipeline.com/api/seo-rename" \
-H "Authorization: Bearer imgp_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"name":"IMG_9912.png", "image":"data:image/png;base64,iVBORw0K..."}'
CI/CD Automation
Optimize your codebase resources automatically during your deploy workflow. Our custom GitHub Action scans repository paths, shrinks matching visual files via the Edge API, and replaces them directly before triggering target CD deployments.
Example Github Workflow Configuration:
name: Optimize Assets
on: [push]
jobs:
optimize:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Run ImgPipeline Optimization
uses: CodeWays-PTY/ImgPipeline/github-action@main
with:
api-key: ${{ secrets.IMGPIPELINE_API_KEY }}
image-glob: '\.(png|jpg|jpeg)$'
How is your API Key protected?
The api-key input uses GitHub's native Encrypted Secrets. You must save your personal ImgPipeline API Key in your repository settings under Secrets and Variables > Actions. It is injected at runtime, completely hidden from workflow logs, and never exposed in the source code.
Who pays for execution?
Runner VM costs are billed directly to your own GitHub account (using your free monthly builder minutes or private runner quotas). ImgPipeline only charges you for the actual image processingβeach file successfully optimized consumes exactly 1 credit from your personal balance.