MCPcopy Create free account
hub / github.com/cucoleadan/opencode-cowork-proxy / tokenCount

Function tokenCount

src/cache.ts:35–40  ·  view source on GitHub ↗
(...values: any[])

Source from the content-addressed store, hash-verified

33}
34
35function tokenCount(...values: any[]): number {
36 for (const value of values) {
37 if (typeof value === 'number' && Number.isFinite(value)) return value;
38 }
39 return 0;
40}
41
42/** Extract cached token count from common OpenAI-compatible usage shapes. */
43export function extractCachedTokens(usage: any): number {

Callers 3

extractCachedTokensFunction · 0.85
extractInputTokensFunction · 0.85
extractOutputTokensFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected