Metric - TypeScript SDK
Metric - TypeScript SDK
Metric type definition
Metric - TypeScript SDK
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
1 import { Metric } from "@openrouter/sdk/models/operations"; 2 3 let value: Metric = { 4 displayFormat: "number", 5 displayLabel: "Request Count", 6 isRate: false, 7 name: "request_count", 8 };
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
displayFormat | operations.DisplayFormat | ✔️ | How this metric value should be formatted for display (e.g. percent → multiply by 100 and append %, currency → prefix with $) | number |
displayLabel | string | ✔️ | Human-readable label | Request Count |
isRate | boolean | ✔️ | Whether this metric is a rate/ratio (averaged, not summed) | |
name | string | ✔️ | Metric identifier used in query requests | request_count |