Q66: usage counts instructions, tool definitions and tool calls

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-08 11:29:10 -04:00
1 parent c2f8e656f6
commit d184e82e2a
5 files changed
+64 -15

No files matched your search

+5
View File
@@ -50,6 +50,11 @@ export function providerPrices(db: DatabaseSync, providerId: string): TokenPrice
return { inputCentsPerMtok: row.input_cents_per_mtok, cachedInputCentsPerMtok: row.cached_input_cents_per_mtok, outputCentsPerMtok: row.output_cents_per_mtok };
}
/** Characters a call sends: the instructions count as much as the prompt. */
export function promptChars(prompt: string, instructions: string | null): number {
return prompt.length + (instructions?.length ?? 0);
}
export function monthStartIso(now: Date): string {
return new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString();
}