Repository navigation
fix(billing): reserve Sim's hosted model and tool keys for paid plans - #10313
Conversation
Free-plan payers without prepaid credits no longer run on Sim's hosted provider keys. One gate, mayUseHostedKey, now guards both hosted model keys (getApiKeyWithBYOK) and hosted tool keys (executeTool), replacing the per-tool requiresPaidPlan opt-in. BYOK keys and keys passed on the block keep working; a caller's own key on a hosted model is reported as BYOK so its usage is not billed.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The reviewed changes appear safe to merge. SummaryThe PR reserves Sim-hosted model and tool keys for payers with paid access, while keeping customer-owned keys usable.
|
There was a problem hiding this comment.
All reported issues were addressed across 13 files
This PR changes payment, billing, or quota logic. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
mayUseHostedKey(lib/billing/core/hosted-key-access.ts), guards both:getApiKeyWithBYOK, which covers agent, router, evaluator, Pi and the Fireworks pool.executeTool.requiresPaidPlanopt-in is removed, so the tool check now applies to every hosted tool. Image and video already had it.isBYOK, so it is never billed as Sim's key. This also applies to the existing fallback when no hosted key is configured.resolveHostedModelKeyhelper.Type of Change
Testing
byok.test.ts: new cases for a payer without paid access.tools/index.test.ts: the paid-access suite now covers hosted tools without a per-tool flag.Checklist
test-auditauthoring gate)