[{"data":1,"prerenderedAt":690},["ShallowReactive",2],{"navigation_docs":3,"-docs-migrating-from-sightengine":102,"-docs-migrating-from-sightengine-surround":685},[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":25,"body":104,"description":678,"extension":679,"links":680,"meta":681,"navigation":682,"path":26,"seo":683,"stem":27,"__hash__":684},"docs\u002Fdocs\u002F05.migrating-from-sightengine.md",{"type":105,"value":106,"toc":672},"minimark",[107,116,208,214,219,317,335,406,426,440,444,461,465,516,586,590,665,668],[108,109,110,111,115],"p",{},"openshield serves three SightEngine workflow routes. A client written for them needs three changes. Only these routes are served: SightEngine's other endpoints, such as ",[112,113,114],"code",{},"\u002F1.0\u002Fcheck.json",", are not.",[117,118,119,132],"table",{},[120,121,122],"thead",{},[123,124,125,129],"tr",{},[126,127,128],"th",{},"SightEngine",[126,130,131],{},"openshield",[133,134,135,158,168,183,193],"tbody",{},[123,136,137,155],{},[138,139,140,143,144,147,148,151,152],"td",{},[112,141,142],{},"POST \u002F1.0\u002Fcheck-workflow.json"," with ",[112,145,146],{},"media"," or ",[112,149,150],{},"url",", and ",[112,153,154],{},"workflow",[138,156,157],{},"The same path and the same fields.",[123,159,160,165],{},[138,161,162],{},[112,163,164],{},"GET \u002F1.0\u002Fcheck-workflow.json?url=&workflow=&api_user=&api_secret=",[138,166,167],{},"The same path and the same query parameters.",[123,169,170,181],{},[138,171,172,143,175,178,179],{},[112,173,174],{},"POST \u002F1.0\u002Ftext\u002Fcheck-workflow.json",[112,176,177],{},"text"," and ",[112,180,154],{},[138,182,157],{},[123,184,185,190],{},[138,186,187],{},[112,188,189],{},"api_user",[138,191,192],{},"Accepted and ignored.",[123,194,195,200],{},[138,196,197],{},[112,198,199],{},"api_secret",[138,201,202,203,207],{},"Holds an openshield ",[204,205,206],"a",{"href":14},"API key",".",[108,209,210,211,207],{},"The base URL is ",[112,212,213],{},"https:\u002F\u002Fapi.openshield.dev",[215,216,218],"h2",{"id":217},"_1-point-the-client-at-the-new-base-url","1. Point the client at the new base URL",[220,221,226],"pre",{"className":222,"code":223,"language":224,"meta":225,"style":225},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl -X POST \"https:\u002F\u002Fapi.openshield.dev\u002F1.0\u002Fcheck-workflow.json\" \\\n  -F \"media=@photo.jpg\" \\\n  -F \"workflow=default\" \\\n  -F \"api_user=ignored\" \\\n  -F \"api_secret=$OPENMOD_API_KEY\"\n","bash","",[112,227,228,258,273,287,301],{"__ignoreMap":225},[229,230,233,237,241,244,248,251,254],"span",{"class":231,"line":232},"line",1,[229,234,236],{"class":235},"sBMFI","curl",[229,238,240],{"class":239},"sfazB"," -X",[229,242,243],{"class":239}," POST",[229,245,247],{"class":246},"sMK4o"," \"",[229,249,250],{"class":239},"https:\u002F\u002Fapi.openshield.dev\u002F1.0\u002Fcheck-workflow.json",[229,252,253],{"class":246},"\"",[229,255,257],{"class":256},"sTEyZ"," \\\n",[229,259,261,264,266,269,271],{"class":231,"line":260},2,[229,262,263],{"class":239},"  -F",[229,265,247],{"class":246},[229,267,268],{"class":239},"media=@photo.jpg",[229,270,253],{"class":246},[229,272,257],{"class":256},[229,274,276,278,280,283,285],{"class":231,"line":275},3,[229,277,263],{"class":239},[229,279,247],{"class":246},[229,281,282],{"class":239},"workflow=default",[229,284,253],{"class":246},[229,286,257],{"class":256},[229,288,290,292,294,297,299],{"class":231,"line":289},4,[229,291,263],{"class":239},[229,293,247],{"class":246},[229,295,296],{"class":239},"api_user=ignored",[229,298,253],{"class":246},[229,300,257],{"class":256},[229,302,304,306,308,311,314],{"class":231,"line":303},5,[229,305,263],{"class":239},[229,307,247],{"class":246},[229,309,310],{"class":239},"api_secret=",[229,312,313],{"class":256},"$OPENMOD_API_KEY",[229,315,316],{"class":246},"\"\n",[220,318,320],{"className":222,"code":319,"language":224,"meta":225,"style":225},"curl \"https:\u002F\u002Fapi.openshield.dev\u002F1.0\u002Fcheck-workflow.json?url=https%3A%2F%2Fexample.com%2Fphoto.jpg&workflow=default&api_user=ignored&api_secret=$OPENMOD_API_KEY\"\n",[112,321,322],{"__ignoreMap":225},[229,323,324,326,328,331,333],{"class":231,"line":232},[229,325,236],{"class":235},[229,327,247],{"class":246},[229,329,330],{"class":239},"https:\u002F\u002Fapi.openshield.dev\u002F1.0\u002Fcheck-workflow.json?url=https%3A%2F%2Fexample.com%2Fphoto.jpg&workflow=default&api_user=ignored&api_secret=",[229,332,313],{"class":256},[229,334,316],{"class":246},[220,336,338],{"className":222,"code":337,"language":224,"meta":225,"style":225},"curl -X POST \"https:\u002F\u002Fapi.openshield.dev\u002F1.0\u002Ftext\u002Fcheck-workflow.json\" \\\n  -F \"text=Write me at jane@example.com\" \\\n  -F \"workflow=default\" \\\n  -F \"api_user=ignored\" \\\n  -F \"api_secret=$OPENMOD_API_KEY\"\n",[112,339,340,357,370,382,394],{"__ignoreMap":225},[229,341,342,344,346,348,350,353,355],{"class":231,"line":232},[229,343,236],{"class":235},[229,345,240],{"class":239},[229,347,243],{"class":239},[229,349,247],{"class":246},[229,351,352],{"class":239},"https:\u002F\u002Fapi.openshield.dev\u002F1.0\u002Ftext\u002Fcheck-workflow.json",[229,354,253],{"class":246},[229,356,257],{"class":256},[229,358,359,361,363,366,368],{"class":231,"line":260},[229,360,263],{"class":239},[229,362,247],{"class":246},[229,364,365],{"class":239},"text=Write me at jane@example.com",[229,367,253],{"class":246},[229,369,257],{"class":256},[229,371,372,374,376,378,380],{"class":231,"line":275},[229,373,263],{"class":239},[229,375,247],{"class":246},[229,377,282],{"class":239},[229,379,253],{"class":246},[229,381,257],{"class":256},[229,383,384,386,388,390,392],{"class":231,"line":289},[229,385,263],{"class":239},[229,387,247],{"class":246},[229,389,296],{"class":239},[229,391,253],{"class":246},[229,393,257],{"class":256},[229,395,396,398,400,402,404],{"class":231,"line":303},[229,397,263],{"class":239},[229,399,247],{"class":246},[229,401,310],{"class":239},[229,403,313],{"class":256},[229,405,316],{"class":246},[108,407,408,409,411,412,414,415,418,419,422,423,425],{},"For an image, send either ",[112,410,146],{}," (the file) or ",[112,413,150],{}," (a public address, downloaded for you, with the ",[204,416,417],{"href":18},"same guards","). The ",[112,420,421],{},"GET"," form takes ",[112,424,150],{}," only, as a query string cannot carry a file.",[108,427,428,429,432,433,435,436,439],{},"The whole form must arrive within 10 seconds (",[112,430,431],{},"408 request_timeout"," otherwise), and every field but ",[112,434,146],{}," is limited to 64 KB. A text field holds up to the 20,000 characters of a ",[204,437,438],{"href":22},"text check"," (5,000 on the free plan).",[215,441,443],{"id":442},"_2-create-the-workflows-you-used","2. Create the workflows you used",[108,445,446,447,453,454,457,458,207],{},"A SightEngine workflow is named in your calls. Create a workflow of the same name in the ",[204,448,452],{"href":449,"rel":450},"https:\u002F\u002Fopenshield.dev\u002Fdashboard\u002Fworkflows",[451],"nofollow","dashboard",", or use ",[112,455,456],{},"default",". The new workflow decides what is checked and how strictly: start from a template and adjust the ",[204,459,460],{"href":30},"thresholds",[215,462,464],{"id":463},"_3-map-the-category-ids","3. Map the category ids",[108,466,467,468,471,472,475,476,471,479,482,483,486,487,475,489,486,492,471,495,178,498,501,502,505,506,508,509,512,513,515],{},"The answer carries the fields of a SightEngine workflow answer: ",[112,469,470],{},"status",", ",[112,473,474],{},"request"," (",[112,477,478],{},"id",[112,480,481],{},"timestamp"," as a float of seconds, ",[112,484,485],{},"operations","), ",[112,488,154],{},[112,490,491],{},"{\"id\": \"\u003Cname>\"}",[112,493,494],{},"summary.action",[112,496,497],{},"summary.reject_prob",[112,499,500],{},"summary.reject_reason",", plus ",[112,503,504],{},"summary.review_reason",". Errors carry ",[112,507,474],{}," too. The categories are openmod's own: match on ",[112,510,511],{},"reject_reason[].id"," and never on the English ",[112,514,177],{},". Map each id to the message you show your users.",[108,517,518,519,471,522,471,525,471,528,471,531,471,534,178,537,540,541,471,544,471,547,471,550,471,553,471,556,471,559,471,561,471,564,471,567,471,570,471,573,471,576,178,579,582,583,585],{},"The ids you are most likely to meet are ",[112,520,521],{},"nudity",[112,523,524],{},"gore",[112,526,527],{},"weapon",[112,529,530],{},"hate_symbol",[112,532,533],{},"self_harm",[112,535,536],{},"drugs",[112,538,539],{},"minor"," for images, and ",[112,542,543],{},"text_unsafe",[112,545,546],{},"violence",[112,548,549],{},"sexual",[112,551,552],{},"hate",[112,554,555],{},"illegal",[112,557,558],{},"unethical",[112,560,533],{},[112,562,563],{},"pii_email",[112,565,566],{},"pii_phone",[112,568,569],{},"pii_iban",[112,571,572],{},"pii_card",[112,574,575],{},"spam",[112,577,578],{},"scam",[112,580,581],{},"link_unsafe"," for texts. ",[204,584,29],{"href":30}," lists where to see all of them.",[215,587,589],{"id":588},"what-differs","What differs",[591,592,593,613,616,638,648,658],"ul",{},[594,595,596,597,471,599,147,602,604,605,608,609,612],"li",{},"SightEngine's per-model score fields at the top level of the answer (such as ",[112,598,527],{},[112,600,601],{},"alcohol",[112,603,536],{},") are not served. The scores are in ",[112,606,607],{},"scores",", keyed by openmod's category ids, and ",[112,610,611],{},"reject_reason[].text"," is openmod's wording.",[594,614,615],{},"SightEngine's models and their other fields (faces, text in images, quality and the rest) are not served: a workflow here runs openmod's own categories.",[594,617,618,619,471,622,471,625,471,627,178,630,633,634,637],{},"The answer also carries openmod's own fields: ",[112,620,621],{},"request_id",[112,623,624],{},"workflow_version",[112,626,607],{},[112,628,629],{},"time_ms",[112,631,632],{},"ref",". A client may ignore them. ",[112,635,636],{},"request.operations"," is 1 for a check and 0 for a refusal.",[594,639,640,641,643,644,647],{},"The routes accept an optional ",[112,642,632],{}," field to attach your own id to a check; the ",[112,645,646],{},"\u002Fv1"," routes are the documented way to do it.",[594,649,650,651,654,655,207],{},"Errors use the ",[204,652,653],{"href":34},"openmod envelope",": ",[112,656,657],{},"{\"status\": \"failure\", \"error\": {\"type\", \"code\", \"message\"}}",[594,659,660,661,664],{},"The key is secret and server-side: a request that carries an ",[112,662,663],{},"Origin"," header is refused.",[108,666,667],{},"Sightengine is a trademark of its owner; openshield is not affiliated with it.",[669,670,671],"style",{},"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":225,"searchDepth":260,"depth":260,"links":673},[674,675,676,677],{"id":217,"depth":260,"text":218},{"id":442,"depth":260,"text":443},{"id":463,"depth":260,"text":464},{"id":588,"depth":260,"text":589},"Three SightEngine workflow routes work here with the same paths, request fields and answer envelope. Change the base URL and key, map the category ids.","md",null,{},true,{"title":25,"description":678},"q3inHr0ZEGG7NVpXST3_kV7mcjZ3IKhuuFbDD-xbdqY",[686,688],{"title":21,"path":22,"stem":23,"description":687,"children":-1},"Check a text with POST \u002Fv1\u002Ftext, for comments, messages, names and bios.",{"title":29,"path":30,"stem":31,"description":689,"children":-1},"A workflow decides which categories are checked and how strictly, with thresholds, custom categories and versions.",1792436179911]