Server route for your website
// app/api/yieldboost/integrity-auditor/route.ts
import { NextRequest, NextResponse } from "next/server";
export async function POST(req: NextRequest) {
const payload = await req.json();
const response = await fetch(
"https://dev.yieldboostai.xyz/api/dev/store/layers/integrity-auditor",
{
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.YIELDBOOST_API_KEY}`,
},
body: JSON.stringify(payload),
},
);
const data = await response.json();
return NextResponse.json(data, { status: response.status });
}Browser calls your own backend
// Browser code in your web app
const response = await fetch("/api/yieldboost/integrity-auditor", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"payload": {
"requestId": "dev-layer-001",
"service": "partner-web-app",
"input": {
"strategy": "low-risk 0G route",
"amount": "1.0"
}
}
}),
});
const verified = await response.json();Node or edge runtime
const response = await fetch("https://dev.yieldboostai.xyz/api/dev/store/layers/integrity-auditor", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.YIELDBOOST_API_KEY}`,
},
body: JSON.stringify({
"payload": {
"requestId": "dev-layer-001",
"service": "partner-web-app",
"input": {
"strategy": "low-risk 0G route",
"amount": "1.0"
}
}
}),
});
const verified = await response.json();cURL smoke test
curl -X POST https://dev.yieldboostai.xyz/api/dev/store/layers/integrity-auditor \
-H "Authorization: Bearer $YIELDBOOST_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "payload": { "requestId": "dev-layer-001", "service": "partner-web-app", "input": { "strategy": "low-risk 0G route", "amount": "1.0" } }}'Response shape
{
"status": "success",
"security": "Single Layer Verified",
"data": {
"accepted": true,
"payload": { "...": "your request" }
},
"zk_proof": "0x...",
"0g_storage_url": "0g://..."
}