MCPcopy Index your code
hub / github.com/MatterAIOrg/OrbCode / getTotalCost

Method getTotalCost

src/api/client.ts:208–215  ·  view source on GitHub ↗
(lastUsage: CompletionUsage)

Source from the content-addressed store, hash-verified

206 }
207
208 private getTotalCost(lastUsage: CompletionUsage): number {
209 const model = getModel(this.options.modelId);
210 if (model.free) return 0;
211 if (lastUsage.is_byok) {
212 return lastUsage.cost_details?.upstream_inference_cost || 0;
213 }
214 return lastUsage.cost || 0;
215 }
216}

Callers 1

createMessageMethod · 0.95

Calls 1

getModelFunction · 0.85

Tested by

no test coverage detected