Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(api): honor forced ZDR in standalone search proxies

Karan Lokchandanid1c15e2a0fb7
diff --git a/apps/api/src/controllers/v2/research-proxy.ts b/apps/api/src/controllers/v2/research-proxy.ts
index fb0f33892..764925e97 100644
--- a/apps/api/src/controllers/v2/research-proxy.ts
+++ b/apps/api/src/controllers/v2/research-proxy.ts
@@ -284,6 +284,8 @@ function createResearchController(
): ResearchController {
return async (req, res: Response) => {
const authedReq = req as RequestWithAuth<any, any, any>;
+ const zeroDataRetention =
+ getSearchForcedKind(authedReq.acuc?.flags) !== null;
const started = Date.now();
const jobId = uuidv7();
@@ -321,7 +323,7 @@ function createResearchController(
origin: requestOrigin(params, req),
integration: params.integration ?? null,
target_hint: targetHint,
- zeroDataRetention: false,
+ zeroDataRetention,
api_key_id: authedReq.acuc?.api_key_id ?? null,
});
@@ -428,7 +430,7 @@ function createResearchController(
credits_cost: statusCode >= 200 && statusCode < 300 ? credits : 0,
is_successful: statusCode >= 200 && statusCode < 300,
error,
- zeroDataRetention: false,
+ zeroDataRetention,
}).catch(logError => {
logger.warn("Research endpoint log failed", { error: logError });
});