MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / creditsToFakeCost

Function creditsToFakeCost

web/src/llm-api/openrouter.ts:922–924  ·  view source on GitHub ↗

* Convert credits (integer cents) back to a cost value that will result in the same * credits when the SDK applies its formula: credits = Math.round(cost * (1 + PROFIT_MARGIN) * 100)

(credits: number)

Source from the content-addressed store, hash-verified

920 * credits when the SDK applies its formula: credits = Math.round(cost * (1 + PROFIT_MARGIN) * 100)
921 */
922function creditsToFakeCost(credits: number): number {
923 return credits / ((1 + PROFIT_MARGIN) * 100)
924}
925
926/**
927 * Bill a stream that exited before a usage-bearing chunk arrived by looking up

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected