[{"data":1,"prerenderedAt":417},["ShallowReactive",2],{"navigation":3,"\u002Fai\u002Fbackground-removal":80,"\u002Fai\u002Fbackground-removal-surround":412},[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":71,"body":82,"description":405,"extension":406,"links":407,"meta":408,"navigation":409,"path":72,"seo":410,"stem":73,"__hash__":411},"docs\u002F3.ai\u002F2.background-removal.md",{"type":83,"value":84,"toc":400},"minimark",[85,94,99,116,126,196,200,212,262,266,269,386,396],[86,87,88,89,93],"p",{},"Send an image and get back the same subject on a transparent background, as\na PNG. Available on ",[90,91,92],"a",{"href":52},"Unlimited and Unlimited + AI",".",[95,96,98],"h2",{"id":97},"request","Request",[100,101,106],"pre",{"className":102,"code":103,"language":104,"meta":105,"style":105},"language-http shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","POST \u002Fv1\u002Fai\u002Fbg-remove\n","http","",[107,108,109],"code",{"__ignoreMap":105},[110,111,114],"span",{"class":112,"line":113},"line",1,[110,115,103],{},[86,117,118,121,122,125],{},[107,119,120],{},"multipart\u002Fform-data"," with an ",[107,123,124],{},"image"," field (a raw image body also works,\nwithout the multipart wrapper):",[100,127,132],{"className":128,"code":129,"filename":130,"language":131,"meta":105,"style":105},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl -X POST https:\u002F\u002Fapi.helloimg.io\u002Fv1\u002Fai\u002Fbg-remove \\\n  -H \"Authorization: Bearer \u003Cyour API key>\" \\\n  -F \"image=@product.jpg\" \\\n  -o product-no-bg.png\n","Terminal","bash",[107,133,134,154,172,187],{"__ignoreMap":105},[110,135,136,140,144,147,150],{"class":112,"line":113},[110,137,139],{"class":138},"sBMFI","curl",[110,141,143],{"class":142},"sfazB"," -X",[110,145,146],{"class":142}," POST",[110,148,149],{"class":142}," https:\u002F\u002Fapi.helloimg.io\u002Fv1\u002Fai\u002Fbg-remove",[110,151,153],{"class":152},"sTEyZ"," \\\n",[110,155,157,160,164,167,170],{"class":112,"line":156},2,[110,158,159],{"class":142},"  -H",[110,161,163],{"class":162},"sMK4o"," \"",[110,165,166],{"class":142},"Authorization: Bearer \u003Cyour API key>",[110,168,169],{"class":162},"\"",[110,171,153],{"class":152},[110,173,175,178,180,183,185],{"class":112,"line":174},3,[110,176,177],{"class":142},"  -F",[110,179,163],{"class":162},[110,181,182],{"class":142},"image=@product.jpg",[110,184,169],{"class":162},[110,186,153],{"class":152},[110,188,190,193],{"class":112,"line":189},4,[110,191,192],{"class":142},"  -o",[110,194,195],{"class":142}," product-no-bg.png\n",[95,197,199],{"id":198},"response","Response",[86,201,202,203,207,208,211],{},"On success, the response body ",[204,205,206],"strong",{},"is the image"," — ",[107,209,210],{},"Content-Type: image\u002Fpng",",\nnot a JSON envelope. A few headers describe what happened:",[213,214,215,228],"table",{},[216,217,218],"thead",{},[219,220,221,225],"tr",{},[222,223,224],"th",{},"Header",[222,226,227],{},"Description",[229,230,231,242,252],"tbody",{},[219,232,233,239],{},[234,235,236],"td",{},[107,237,238],{},"X-Processing-Time-Ms",[234,240,241],{},"How long the removal took.",[219,243,244,249],{},[234,245,246],{},[107,247,248],{},"X-Original-Size",[234,250,251],{},"Size of the uploaded image, in bytes.",[219,253,254,259],{},[234,255,256],{},[107,257,258],{},"X-Output-Size",[234,260,261],{},"Size of the resulting PNG, in bytes.",[95,263,265],{"id":264},"errors","Errors",[86,267,268],{},"Errors come back as JSON instead of an image:",[213,270,271,284],{},[216,272,273],{},[219,274,275,278,281],{},[222,276,277],{},"Status",[222,279,280],{},"Body",[222,282,283],{},"Cause",[229,285,286,304,318,341,356,371],{},[219,287,288,293,298],{},[234,289,290],{},[107,291,292],{},"400",[234,294,295],{},[107,296,297],{},"{ \"error\": \"Missing 'image' field in form data\" }",[234,299,300,301,303],{},"No ",[107,302,124],{}," field in a multipart request.",[219,305,306,310,315],{},[234,307,308],{},[107,309,292],{},[234,311,312],{},[107,313,314],{},"{ \"error\": \"Empty request body\" }",[234,316,317],{},"No image data sent at all.",[219,319,320,325,330],{},[234,321,322],{},[107,323,324],{},"401",[234,326,327],{},[107,328,329],{},"{ \"error\": \"invalid api key\" }",[234,331,332,333,336,337,340],{},"Missing or malformed ",[107,334,335],{},"Authorization"," header. Applies to every ",[107,338,339],{},"\u002Fv1\u002F*"," route — one shared check in front of all of them.",[219,342,343,348,353],{},[234,344,345],{},[107,346,347],{},"403",[234,349,350],{},[107,351,352],{},"{ \"error\": \"ai requires the Unlimited + AI plan\", \"code\": \"ai_plan_required\" }",[234,354,355],{},"Free plan — AI isn't available at all.",[219,357,358,363,368],{},[234,359,360],{},[107,361,362],{},"429",[234,364,365],{},[107,366,367],{},"{ \"error\": \"monthly AI credit limit reached\", \"code\": \"ai_credits_exhausted\" }",[234,369,370],{},"Unlimited plan, 100 AI credits already used this month. Unlimited + AI has no cap.",[219,372,373,378,383],{},[234,374,375],{},[107,376,377],{},"500",[234,379,380],{},[107,381,382],{},"{ \"error\": \"Background removal failed\", \"details\": \"...\" }",[234,384,385],{},"Processing failed.",[387,388,389],"callout",{},[86,390,391,392,395],{},"Background removal doesn't run through the optimize\u002Fjob pipeline — there's\nno ",[107,393,394],{},"job_id"," to poll. The response either is the finished image, or an\nerror.",[397,398,399],"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":105,"searchDepth":113,"depth":156,"links":401},[402,403,404],{"id":97,"depth":156,"text":98},{"id":198,"depth":156,"text":199},{"id":264,"depth":156,"text":265},"POST \u002Fv1\u002Fai\u002Fbg-remove — send an image, get back a transparent PNG with the background removed.","md",null,{},{"icon":74},{"title":71,"description":405},"UVz4GWfrDLPlM92RydLIX-eHGOoGSn9EVEC7SVkd6x0",[413,415],{"title":66,"path":67,"stem":68,"description":414,"icon":69,"children":-1},"POST \u002Fv1\u002Fai\u002Fseo — generate alt text, captions, descriptions, and titles from an image URL.",{"title":76,"path":77,"stem":78,"description":416,"icon":79,"children":-1},"Full website and API key CRUD over a bearer-authenticated REST API, for agencies and resellers on the Reseller + AI plan.",1787466466329]