Skip to content

Allow zero-credit API calls without balance#718

Merged
jahooma merged 1 commit into
mainfrom
jahooma/free-researcher-web
May 21, 2026
Merged

Allow zero-credit API calls without balance#718
jahooma merged 1 commit into
mainfrom
jahooma/free-researcher-web

Conversation

@jahooma
Copy link
Copy Markdown
Contributor

@jahooma jahooma commented May 21, 2026

Summary

Zero-credit API operations now bypass balance lookup and credit consumption, so free web/docs search calls work for users with no remaining credits.
This fixes researcher-web failing with insufficient credits, because it calls the web-search endpoint with creditsToCharge = 0.
The web-search and docs-search route tests now assert that zero-credit calls return creditsUsed: 0 and do not call billing helpers.

Validation

  • bun test web/src/app/api/v1/web-search/__tests__/web-search.test.ts
  • bun test web/src/app/api/v1/docs-search/__tests__/docs-search.test.ts
  • bun --cwd web typecheck

@jahooma jahooma merged commit 0b22c48 into main May 21, 2026
35 checks passed
@jahooma jahooma deleted the jahooma/free-researcher-web branch May 21, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant