Skip to content

Commit 92a5663

Browse files
committed
Make doc and web search free
1 parent 997f00e commit 92a5663

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

web/src/app/api/v1/docs-search/_post.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { AnalyticsEvent } from '@codebuff/common/constants/analytics-events'
2-
import { PROFIT_MARGIN } from '@codebuff/common/old-constants'
32
import { NextResponse } from 'next/server'
43
import { z } from 'zod'
54

@@ -81,9 +80,8 @@ export async function postDocsSearch(params: {
8180
logger,
8281
})
8382

84-
// Credit cost: flat 1 credit (+profit margin)
85-
const baseCost = 1
86-
const creditsToCharge = Math.round(baseCost * (1 + PROFIT_MARGIN))
83+
// Temporarily free - charge 0 credits
84+
const creditsToCharge = 0
8785

8886
const credits = await checkCreditsAndCharge({
8987
userId,

web/src/app/api/v1/web-search/_post.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { AnalyticsEvent } from '@codebuff/common/constants/analytics-events'
2-
import { PROFIT_MARGIN } from '@codebuff/common/old-constants'
32
import { NextResponse } from 'next/server'
43
import { z } from 'zod'
54

@@ -85,8 +84,8 @@ export async function postWebSearch(params: {
8584
logger,
8685
})
8786

88-
const baseCost = depth === 'deep' ? 5 : 1
89-
const creditsToCharge = Math.round(baseCost * (1 + PROFIT_MARGIN))
87+
// Temporarily free - charge 0 credits
88+
const creditsToCharge = 0
9089

9190
// Retry credits charge up to 3 times (flaky)
9291
let credits: Awaited<ReturnType<typeof checkCreditsAndCharge>> | undefined

0 commit comments

Comments
 (0)