[{"data":1,"prerenderedAt":479},["ShallowReactive",2],{"navigation":3,"\u002Freference\u002Fsmartcrop":80,"\u002Freference\u002Fsmartcrop-surround":474},[4,30,60,75],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"\u002Fgetting-started","1.getting-started",[10,15,20,25],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"WordPress plugin","\u002Fgetting-started\u002Fwordpress-plugin","1.getting-started\u002F2.wordpress-plugin","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"API quickstart","\u002Fgetting-started\u002Fapi-quickstart","1.getting-started\u002F3.api-quickstart","i-lucide-terminal",{"title":26,"path":27,"stem":28,"icon":29},"FAQ","\u002Fgetting-started\u002Ffaq","1.getting-started\u002F4.faq","i-lucide-circle-help",{"title":31,"path":32,"stem":33,"children":34,"page":6},"Reference","\u002Freference","2.reference",[35,40,45,50,55],{"title":36,"path":37,"stem":38,"icon":39},"Optimize API","\u002Freference\u002Foptimize-api","2.reference\u002F1.optimize-api","i-lucide-image",{"title":41,"path":42,"stem":43,"icon":44},"Smart crop","\u002Freference\u002Fsmartcrop","2.reference\u002F2.smartcrop","i-lucide-crop",{"title":46,"path":47,"stem":48,"icon":49},"Job polling","\u002Freference\u002Fjobs","2.reference\u002F3.jobs","i-lucide-list-checks",{"title":51,"path":52,"stem":53,"icon":54},"Plans & limits","\u002Freference\u002Fplans-and-limits","2.reference\u002F4.plans-and-limits","i-lucide-credit-card",{"title":56,"path":57,"stem":58,"icon":59},"Account usage","\u002Freference\u002Faccount","2.reference\u002F5.account","i-lucide-gauge",{"title":61,"path":62,"stem":63,"children":64,"page":6},"AI","\u002Fai","3.ai",[65,70],{"title":66,"path":67,"stem":68,"icon":69},"AI alt text & SEO","\u002Fai\u002Falt-text-and-seo","3.ai\u002F1.alt-text-and-seo","i-lucide-sparkles",{"title":71,"path":72,"stem":73,"icon":74},"AI background removal","\u002Fai\u002Fbackground-removal","3.ai\u002F2.background-removal","i-lucide-scissors",{"title":76,"path":77,"stem":78,"icon":79},"Account API","\u002Faccount-api","4.account-api","i-lucide-key-round",{"id":81,"title":41,"body":82,"description":467,"extension":468,"links":469,"meta":470,"navigation":471,"path":42,"seo":472,"stem":43,"__hash__":473},"docs\u002F2.reference\u002F2.smartcrop.md",{"type":83,"value":84,"toc":462},"minimark",[85,103,108,131,164,238,270,274,291,295,420,426,458],[86,87,88,89,93,94,98,99,102],"p",{},"A proportional resize fits an image inside a box. Smart crop instead\nproduces an ",[90,91,92],"strong",{},"exact"," ",[95,96,97],"code",{},"width"," x ",[95,100,101],{},"height"," output by analyzing the image and\ncropping around whatever's most visually important, instead of just cutting\nfrom the center.",[104,105,107],"h2",{"id":106},"request","Request",[109,110,115],"pre",{"className":111,"code":112,"language":113,"meta":114,"style":114},"language-http shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","POST \u002Fv1\u002Fsmartcrop\nPOST \u002Fv1\u002Fsmartcrop?async=true\n","http","",[95,116,117,125],{"__ignoreMap":114},[118,119,122],"span",{"class":120,"line":121},"line",1,[118,123,124],{},"POST \u002Fv1\u002Fsmartcrop\n",[118,126,128],{"class":120,"line":127},2,[118,129,130],{},"POST \u002Fv1\u002Fsmartcrop?async=true\n",[86,132,133,136,137,143,144,147,148,151,152,155,156,159,160,163],{},[95,134,135],{},"multipart\u002Fform-data",", same shape as ",[138,139,140],"a",{"href":37},[95,141,142],{},"\u002Fv1\u002Foptimize",":\nan ",[95,145,146],{},"image"," field, and a ",[95,149,150],{},"data"," field whose ",[95,153,154],{},"resize.width"," and\n",[95,157,158],{},"resize.height"," are ",[90,161,162],{},"required",".",[109,165,170],{"className":166,"code":167,"filename":168,"language":169,"meta":114,"style":114},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl -X POST https:\u002F\u002Fapi.helloimg.io\u002Fv1\u002Fsmartcrop \\\n  -H \"Authorization: Bearer \u003Cyour API key>\" \\\n  -F \"image=@photo.jpg\" \\\n  -F 'data={\"resize\":{\"width\":800,\"height\":800}}'\n","Terminal","bash",[95,171,172,192,209,224],{"__ignoreMap":114},[118,173,174,178,182,185,188],{"class":120,"line":121},[118,175,177],{"class":176},"sBMFI","curl",[118,179,181],{"class":180},"sfazB"," -X",[118,183,184],{"class":180}," POST",[118,186,187],{"class":180}," https:\u002F\u002Fapi.helloimg.io\u002Fv1\u002Fsmartcrop",[118,189,191],{"class":190},"sTEyZ"," \\\n",[118,193,194,197,201,204,207],{"class":120,"line":127},[118,195,196],{"class":180},"  -H",[118,198,200],{"class":199},"sMK4o"," \"",[118,202,203],{"class":180},"Authorization: Bearer \u003Cyour API key>",[118,205,206],{"class":199},"\"",[118,208,191],{"class":190},[118,210,212,215,217,220,222],{"class":120,"line":211},3,[118,213,214],{"class":180},"  -F",[118,216,200],{"class":199},[118,218,219],{"class":180},"image=@photo.jpg",[118,221,206],{"class":199},[118,223,191],{"class":190},[118,225,227,229,232,235],{"class":120,"line":226},4,[118,228,214],{"class":180},[118,230,231],{"class":199}," '",[118,233,234],{"class":180},"data={\"resize\":{\"width\":800,\"height\":800}}",[118,236,237],{"class":199},"'\n",[86,239,240,243,244,247,248,251,252,255,256,259,260,255,263,266,267,269],{},[95,241,242],{},"resize.smartcrop"," is set to ",[95,245,246],{},"true"," for you — you don't need to send it.\nAny other ",[138,249,250],{"href":37},"optimize option"," (",[95,253,254],{},"level",", ",[95,257,258],{},"convert",",\n",[95,261,262],{},"keep_exif",[95,264,265],{},"lossless",") can be included in the same ",[95,268,150],{}," object.",[104,271,273],{"id":272},"response","Response",[86,275,276,277,282,283,286,287,290],{},"Same as ",[138,278,280],{"href":279},"\u002Freference\u002Foptimize-api#response",[95,281,142],{},": a ",[95,284,285],{},"202"," with a\njob to poll by default, or the result directly if you're not using\n",[95,288,289],{},"?async=true"," and the request finishes before the timeout.",[104,292,294],{"id":293},"errors","Errors",[296,297,298,314],"table",{},[299,300,301],"thead",{},[302,303,304,308,311],"tr",{},[305,306,307],"th",{},"Status",[305,309,310],{},"Body",[305,312,313],{},"Cause",[315,316,317,333,352,380,403],"tbody",{},[302,318,319,325,330],{},[320,321,322],"td",{},[95,323,324],{},"400",[320,326,327],{},[95,328,329],{},"{ \"error\": { \"code\": \"invalid_request\", \"message\": \"Missing 'image' field\" } }",[320,331,332],{},"No image file in the request.",[302,334,335,339,344],{},[320,336,337],{},[95,338,324],{},[320,340,341],{},[95,342,343],{},"{ \"error\": { \"code\": \"invalid_request\", \"message\": \"smartcrop requires resize.width and resize.height (positive integers)\" } }",[320,345,346,348,349,351],{},[95,347,154],{}," or ",[95,350,158],{}," is missing, zero, negative, or not an integer.",[302,353,354,358,363],{},[320,355,356],{},[95,357,324],{},[320,359,360],{},[95,361,362],{},"{ \"error\": \"resize.smartcrop cannot be combined with resize.percent: a smart crop is an exact width x height, not a proportion\", \"code\": \"invalid_resize\" }",[320,364,365,366,368,369,371,372,375,376,379],{},"Both ",[95,367,97],{},"\u002F",[95,370,101],{}," and ",[95,373,374],{},"percent"," were sent. Note the different, ",[90,377,378],{},"flat"," shape — see the callout below.",[302,381,382,387,392],{},[320,383,384],{},[95,385,386],{},"401",[320,388,389],{},[95,390,391],{},"{ \"error\": \"invalid api key\" }",[320,393,394,395,398,399,402],{},"Missing or malformed ",[95,396,397],{},"Authorization"," header. Applies to every ",[95,400,401],{},"\u002Fv1\u002F*"," route — one shared check in front of all of them.",[302,404,405,410,415],{},[320,406,407],{},[95,408,409],{},"429",[320,411,412],{},[95,413,414],{},"{ \"error\": \"monthly image limit reached\", \"code\": \"limit_reached\" }",[320,416,417,418,163],{},"Free plan, 1,000 images already processed this calendar month — see ",[138,419,51],{"href":52},[421,422,423],"callout",{},[86,424,425],{},"Without both dimensions, smart crop would otherwise fall back silently to a\nproportional resize instead of a crop — so this call rejects the request\noutright rather than returning an image that was never actually cropped.",[421,427,428],{},[86,429,430,431,433,434,437,438,440,441,443,444,447,448,453,454,457],{},"The two ",[95,432,324],{},"s above with nested ",[95,435,436],{},"error.message"," bodies are this endpoint's\nown pre-checks. Every other error on this page — auth, the plan-gate ",[95,439,409],{},",\nand the ",[95,442,374],{},"-conflict case above — uses the flat\n",[95,445,446],{},"{ \"error\": \"...\", \"code\": \"...\" }"," shape instead, the same as\n",[138,449,451],{"href":450},"\u002Freference\u002Foptimize-api#errors",[95,452,142],{},". Don't assume every error\nfrom ",[95,455,456],{},"\u002Fv1\u002Fsmartcrop"," is nested.",[459,460,461],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}",{"title":114,"searchDepth":121,"depth":127,"links":463},[464,465,466],{"id":106,"depth":127,"text":107},{"id":272,"depth":127,"text":273},{"id":293,"depth":127,"text":294},"POST \u002Fv1\u002Fsmartcrop — subject-aware crop to an exact width and height.","md",null,{},{"icon":44},{"title":41,"description":467},"RftT6jerP6FyQA26kdGg59qQjLzp-Cgu6iio2DhR-34",[475,477],{"title":36,"path":37,"stem":38,"description":476,"icon":39,"children":-1},"POST \u002Fv1\u002Foptimize — quality levels, target formats, resize options, and what the response looks like.",{"title":46,"path":47,"stem":48,"description":478,"icon":49,"children":-1},"GET \u002Fv1\u002Fjobs\u002F{job_id} — poll an async optimize, smartcrop, or multi-format job until it's done.",1787466466329]