SDK Reference (BETA)TypeScript SDKOperations
GetCurrentKeyData - TypeScript SDK
GetCurrentKeyData type definition
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Current API key information
Example Usage
1 import { GetCurrentKeyData } from "@openrouter/sdk/models/operations"; 2 3 let value: GetCurrentKeyData = { 4 label: "sk-or-v1-au78b3456789012345678901234567890", 5 limit: 100, 6 usage: 25.5, 7 usageDaily: 25.5, 8 usageWeekly: 25.5, 9 usageMonthly: 25.5, 10 byokUsage: 17.38, 11 byokUsageDaily: 17.38, 12 byokUsageWeekly: 17.38, 13 byokUsageMonthly: 17.38, 14 isFreeTier: false, 15 isProvisioningKey: false, 16 limitRemaining: 74.5, 17 limitReset: "monthly", 18 includeByokInLimit: false, 19 rateLimit: { 20 requests: 1000, 21 interval: "1h", 22 note: "This field is deprecated and safe to ignore.", 23 }, 24 };
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
label | string | ✔️ | Human-readable label for the API key | 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 |
limit | number | ✔️ | Spending limit for the API key in USD | 100 |
usage | number | ✔️ | Total OpenRouter credit usage (in USD) for the API key | 25.5 |
usageDaily | number | ✔️ | OpenRouter credit usage (in USD) for the current UTC day | 25.5 |
usageWeekly | number | ✔️ | OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) | 25.5 |
usageMonthly | number | ✔️ | OpenRouter credit usage (in USD) for the current UTC month | 25.5 |
byokUsage | number | ✔️ | Total external BYOK usage (in USD) for the API key | 17.38 |
byokUsageDaily | number | ✔️ | External BYOK usage (in USD) for the current UTC day | 17.38 |
byokUsageWeekly | number | ✔️ | External BYOK usage (in USD) for the current UTC week (Monday-Sunday) | 17.38 |
byokUsageMonthly | number | ✔️ | External BYOK usage (in USD) for current UTC month | 17.38 |
isFreeTier | boolean | ✔️ | Whether this is a free tier API key | false |
isProvisioningKey | boolean | ✔️ | Whether this is a provisioning key | false |
limitRemaining | number | ✔️ | Remaining spending limit in USD | 74.5 |
limitReset | string | ✔️ | Type of limit reset for the API key | monthly |
includeByokInLimit | boolean | ✔️ | Whether to include external BYOK usage in the credit limit | false |
rateLimit | operations.RateLimit | ✔️ | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. Legacy rate limit information about a key. Will always return -1. | {"requests": 1000,"interval": "1h","note": "This field is deprecated and safe to ignore."} |