[{"data":1,"prerenderedAt":417},["ShallowReactive",2],{"navigation_docs":3,"-docs-authentication":102,"-docs-authentication-surround":412},[4,8,12,16,20,24,28,32,36,40,44,82,86,90,94,98],{"title":5,"path":6,"stem":7},"Overview","\u002Fdocs","docs\u002Findex",{"title":9,"path":10,"stem":11},"Quickstart","\u002Fdocs\u002Fquickstart","docs\u002F01.quickstart",{"title":13,"path":14,"stem":15},"Authentication and keys","\u002Fdocs\u002Fauthentication","docs\u002F02.authentication",{"title":17,"path":18,"stem":19},"Images","\u002Fdocs\u002Fimages","docs\u002F03.images",{"title":21,"path":22,"stem":23},"Texts","\u002Fdocs\u002Ftexts","docs\u002F04.texts",{"title":25,"path":26,"stem":27},"Migrating from SightEngine","\u002Fdocs\u002Fmigrating-from-sightengine","docs\u002F05.migrating-from-sightengine",{"title":29,"path":30,"stem":31},"Workflows","\u002Fdocs\u002Fworkflows","docs\u002F06.workflows",{"title":33,"path":34,"stem":35},"Responses and errors","\u002Fdocs\u002Fresponses-and-errors","docs\u002F07.responses-and-errors",{"title":37,"path":38,"stem":39},"Limits and quotas","\u002Fdocs\u002Flimits-and-quotas","docs\u002F08.limits-and-quotas",{"title":41,"path":42,"stem":43},"The journal and ref","\u002Fdocs\u002Fjournal-and-ref","docs\u002F09.journal-and-ref",{"title":45,"path":46,"stem":47,"children":48,"page":81},"Integration guides","\u002Fdocs\u002Fintegration-guides","docs\u002F10.integration-guides",[49,53,57,61,65,69,73,77],{"title":50,"path":51,"stem":52},"Node.js and TypeScript","\u002Fdocs\u002Fintegration-guides\u002Fnodejs","docs\u002F10.integration-guides\u002F1.nodejs",{"title":54,"path":55,"stem":56},"Python","\u002Fdocs\u002Fintegration-guides\u002Fpython","docs\u002F10.integration-guides\u002F2.python",{"title":58,"path":59,"stem":60},"PHP","\u002Fdocs\u002Fintegration-guides\u002Fphp","docs\u002F10.integration-guides\u002F3.php",{"title":62,"path":63,"stem":64},"Go","\u002Fdocs\u002Fintegration-guides\u002Fgo","docs\u002F10.integration-guides\u002F4.go",{"title":66,"path":67,"stem":68},"Supabase Edge Functions","\u002Fdocs\u002Fintegration-guides\u002Fsupabase-edge-functions","docs\u002F10.integration-guides\u002F5.supabase-edge-functions",{"title":70,"path":71,"stem":72},"Cloudflare Workers","\u002Fdocs\u002Fintegration-guides\u002Fcloudflare-workers","docs\u002F10.integration-guides\u002F6.cloudflare-workers",{"title":74,"path":75,"stem":76},"Nuxt and Next","\u002Fdocs\u002Fintegration-guides\u002Fnuxt-and-next","docs\u002F10.integration-guides\u002F7.nuxt-and-next",{"title":78,"path":79,"stem":80},"Moderate an AI agent","\u002Fdocs\u002Fintegration-guides\u002Fmoderate-ai-agents","docs\u002F10.integration-guides\u002F8.moderate-ai-agents",false,{"title":83,"path":84,"stem":85},"AI coding agents","\u002Fdocs\u002Fai-agents","docs\u002F11.ai-agents",{"title":87,"path":88,"stem":89},"Best practices","\u002Fdocs\u002Fbest-practices","docs\u002F12.best-practices",{"title":91,"path":92,"stem":93},"Privacy and data","\u002Fdocs\u002Fprivacy-and-data","docs\u002F13.privacy-and-data",{"title":95,"path":96,"stem":97},"API reference","\u002Fdocs\u002Fapi-reference","docs\u002F14.api-reference",{"title":99,"path":100,"stem":101},"Changelog","\u002Fdocs\u002Fchangelog","docs\u002F15.changelog",{"id":103,"title":13,"body":104,"description":406,"extension":407,"links":408,"meta":409,"navigation":171,"path":14,"seo":410,"stem":15,"__hash__":411},"docs\u002Fdocs\u002F02.authentication.md",{"type":105,"value":106,"toc":399},"minimark",[107,111,116,119,197,204,220,224,227,268,271,275,289,292,296,300,324,328,395],[108,109,110],"p",{},"Every request to the checking API carries an API key. Keys belong to an organization, and you create them in the dashboard.",[112,113,115],"h2",{"id":114},"sending-the-key","Sending the key",[108,117,118],{},"Use either header. They are equivalent.",[120,121,126],"pre",{"className":122,"code":123,"language":124,"meta":125,"style":125},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# The Authorization header\ncurl -H \"Authorization: Bearer $OPENMOD_API_KEY\" ...\n\n# The X-Api-Key header\ncurl -H \"X-Api-Key: $OPENMOD_API_KEY\" ...\n","bash","",[127,128,129,138,166,173,179],"code",{"__ignoreMap":125},[130,131,134],"span",{"class":132,"line":133},"line",1,[130,135,137],{"class":136},"sHwdD","# The Authorization header\n",[130,139,141,145,149,153,156,160,163],{"class":132,"line":140},2,[130,142,144],{"class":143},"sBMFI","curl",[130,146,148],{"class":147},"sfazB"," -H",[130,150,152],{"class":151},"sMK4o"," \"",[130,154,155],{"class":147},"Authorization: Bearer ",[130,157,159],{"class":158},"sTEyZ","$OPENMOD_API_KEY",[130,161,162],{"class":151},"\"",[130,164,165],{"class":147}," ...\n",[130,167,169],{"class":132,"line":168},3,[130,170,172],{"emptyLinePlaceholder":171},true,"\n",[130,174,176],{"class":132,"line":175},4,[130,177,178],{"class":136},"# The X-Api-Key header\n",[130,180,182,184,186,188,191,193,195],{"class":132,"line":181},5,[130,183,144],{"class":143},[130,185,148],{"class":147},[130,187,152],{"class":151},[130,189,190],{"class":147},"X-Api-Key: ",[130,192,159],{"class":158},[130,194,162],{"class":151},[130,196,165],{"class":147},[108,198,199,200,203],{},"A key looks like ",[127,201,202],{},"om_live_\u003Cid>_\u003Csecret>",": a prefix, 12 characters of id and 32 of secret. The id is not secret: it identifies the key in the dashboard and in the journal. The key is stored only as a hash, so we cannot show it again.",[108,205,206,207,211,212,215,216,219],{},"The ",[208,209,210],"a",{"href":26},"SightEngine-compatible endpoints"," take the key in the ",[127,213,214],{},"api_secret"," form field (or query parameter, for the ",[127,217,218],{},"GET"," form) instead.",[112,221,223],{"id":222},"scopes-and-workflows","Scopes and workflows",[108,225,226],{},"When you create a key you choose:",[228,229,230,250,258],"ul",{},[231,232,233,237,238,241,242,245,246,249],"li",{},[234,235,236],"strong",{},"Scopes",": ",[127,239,240],{},"image",", ",[127,243,244],{},"text"," or both. A key without the scope for a kind of content gets ",[127,247,248],{},"403 forbidden"," for it.",[231,251,252,254,255,257],{},[234,253,29],{},": all of them, or a list. A key limited to some workflows gets ",[127,256,248],{}," for any other.",[231,259,260,263,264,267],{},[234,261,262],{},"Expiry",": optional. An expired key gets ",[127,265,266],{},"401 unauthorized",".",[108,269,270],{},"Give each service its own key, with the narrowest scope and workflows it needs.",[112,272,274],{"id":273},"rotating-and-revoking","Rotating and revoking",[228,276,277,283],{},[231,278,279,282],{},[234,280,281],{},"Rotate"," a key from the dashboard to make a new one with the same scopes. The old key keeps working for a grace delay you choose, from 0 to 24 hours, so you can deploy the new one without a gap.",[231,284,285,288],{},[234,286,287],{},"Revoke"," a key to stop it at once.",[108,290,291],{},"A rotated key in its grace delay counts toward your plan's number of keys.",[112,293,295],{"id":294},"keep-keys-on-the-server","Keep keys on the server",[297,298,299],"warning",{},"Never put a key in a web page, a mobile app, a browser extension or a repository. Call the API from your backend, and give your front end the decision, not the key.",[228,301,302,308,317],{},[231,303,304,305,267],{},"Store the key in an environment variable or your platform's secret store. The examples in these docs use ",[127,306,307],{},"OPENMOD_API_KEY",[231,309,310,311,314,315,267],{},"The API does not answer browser cross-origin requests. A request carrying an ",[127,312,313],{},"Origin"," header gets ",[127,316,248],{},[231,318,319,320,323],{},"If a key leaks, revoke it and create another. The ",[208,321,322],{"href":42},"journal"," shows which key made each check, so you can see what the leaked key was used for.",[112,325,327],{"id":326},"errors","Errors",[329,330,331,349],"table",{},[332,333,334],"thead",{},[335,336,337,341,346],"tr",{},[338,339,340],"th",{},"Status",[338,342,343],{},[127,344,345],{},"error.type",[338,347,348],{},"When",[350,351,352,366,379],"tbody",{},[335,353,354,358,363],{},[355,356,357],"td",{},"401",[355,359,360],{},[127,361,362],{},"unauthorized",[355,364,365],{},"The key is missing, malformed, invalid, revoked or expired.",[335,367,368,371,376],{},[355,369,370],{},"403",[355,372,373],{},[127,374,375],{},"forbidden",[355,377,378],{},"The key may not check this kind of content or use this workflow, or the request came from a browser.",[335,380,381,383,388],{},[355,382,370],{},[355,384,385],{},[127,386,387],{},"organization_suspended",[355,389,390,391,267],{},"An operator suspended the organization. Write to ",[208,392,394],{"href":393},"mailto:contact@sway.events","contact@sway.events",[396,397,398],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}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);}",{"title":125,"searchDepth":140,"depth":140,"links":400},[401,402,403,404,405],{"id":114,"depth":140,"text":115},{"id":222,"depth":140,"text":223},{"id":273,"depth":140,"text":274},{"id":294,"depth":140,"text":295},{"id":326,"depth":140,"text":327},"How to call the API with a key, what a key may do and how to keep it safe.","md",null,{},{"title":13,"description":406},"VUIerMJSSl8mTmE_Rkz5w2v91xVJt-avHtamg4rTNPQ",[413,415],{"title":9,"path":10,"stem":11,"description":414,"children":-1},"Your first check in five minutes, from an account to a key and one request.",{"title":17,"path":18,"stem":19,"description":416,"children":-1},"Check an image with POST \u002Fv1\u002Fimage, sent as bytes or as a public URL.",1792436179910]