AI Image Pipeline in 1 Call - Save 75% Tokens, Copy-Paste Flows
AI agent that crops, resizes, converts + compresses image with four separate calls burns four round-trips of tokens. Pipeline does whole chain in one call + returns only final file. Here how to build them, with ready-made flows + copy-paste examples.
Table of Contents
Quick answer
Image pipeline chains several operations — such as crop, resize, convert + compress — into single call. Output of each step feeds next, + agent gets back only final image. On omnikitbolt, pipeline tool accepts ordered steps array + runs whole chain server-side, so agent avoids multiple round-trips + never handles intermediate files. This single biggest token saver when agent works with images.
Why pipelines matter for agents
For human, calling four endpoints in row minor inconvenience. For AI agent it main cost. Every separate tool call round-trip: agent spends tokens to describe operation, waits for response, then spends more tokens to describe next step + pass intermediate file along. Four operations means four times that overhead. Pipeline collapses chain into one request + one response, so agent pays token cost once. In real run, 314 KB screenshot went through crop → resize → WebP → compress + came out at 8.7 KB (−97%) — in single call.
Anatomy of pipeline call
Pipeline tool takes source image (as base64 or URL) + ordered steps array. Each step object with op + its params. Chainable ops include compress, resize, crop, convert, rotate, flip, grayscale, blur, adjust, tint, negate, flatten, border, round + watermark.
{
"imageUrl": "https://example.com/photo.jpg",
"steps": [
{ "op": "crop", "params": { "ratio": "16:9" } },
{ "op": "resize", "params": { "width": 1200 } },
{ "op": "convert", "params": { "format": "webp", "quality": 80 } },
{ "op": "compress", "params": { "quality": 75 } }
]
}Server runs steps in order + returns only final image. You billed 1 credit per step, + failed step refunds whole call.
Ready-made flows to copy
Web-optimize (or just call optimize_for_web tool, which does this in one step):
[
{ "op": "resize", "params": { "width": 1920, "height": 1920, "fit": "inside" } },
{ "op": "convert", "params": { "format": "webp", "quality": 80 } }
]Thumbnail (square crop, small, compressed):
[
{ "op": "crop", "params": { "ratio": "1:1" } },
{ "op": "resize", "params": { "width": 400 } },
{ "op": "convert", "params": { "format": "webp", "quality": 70 } }
]Social square with watermark:
[
{ "op": "crop", "params": { "ratio": "1:1" } },
{ "op": "resize", "params": { "width": 1080 } },
{ "op": "watermark", "params": { "text": "@yourbrand", "position": "bottom-right", "opacity": 0.6 } },
{ "op": "convert", "params": { "format": "jpeg", "quality": 85 } }
]Flows that mix editing + AI
Pipeline chains deterministic image ops. AI vision tools (describe, alt text, OCR, tags, filename) return text, so agent composes them itself around pipeline. Common agent patterns:
- Publish-ready: run
optimize_for_web, thenalt_text+suggest_filenameon same image — web-ready file plus its accessibility text + SEO filename. - Read then shrink:
extract_text(OCR) to capture what screenshot says, then compress pipeline to store it small. - Catalogue:
describe+tagsto index photo library, with thumbnail pipeline for previews.
Calling it over REST
Not using MCP? Same pipeline plain HTTP endpoint:
curl -X POST https://omnikitbolt.com/api/v1/pipeline \
-H "Authorization: Bearer sk_live_YOUR_KEY" \
-F "file=@photo.jpg" \
-F 'steps=[{"op":"resize","params":{"width":1200}},{"op":"convert","params":{"format":"webp","quality":80}}]' \
-o out.webpBuilding flows visually (Node Studio)
Prefer to design flow by hand before handing it to agent? omnikitbolt has visual node editor where you drop first tool, connect next, + watch image transform step by step — same chain agent runs, built with mouse. It fastest way to work out right sequence + parameters, then copy them into pipeline call. Explore tools on for-AI-agents page, or see how omnikitbolt stacks up against other services in our image API comparison for agents.