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

1import { GetCurrentKeyData } from "@openrouter/sdk/models/operations";
2
3let 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

FieldTypeRequiredDescriptionExample
labelstring✔️Human-readable label for the API keysk-or-v1-0e6f44a47a05f1dad2ad7e88c4c1d6b77688157716fb1a5271146f7464951c96
limitnumber✔️Spending limit for the API key in USD100
usagenumber✔️Total OpenRouter credit usage (in USD) for the API key25.5
usageDailynumber✔️OpenRouter credit usage (in USD) for the current UTC day25.5
usageWeeklynumber✔️OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)25.5
usageMonthlynumber✔️OpenRouter credit usage (in USD) for the current UTC month25.5
byokUsagenumber✔️Total external BYOK usage (in USD) for the API key17.38
byokUsageDailynumber✔️External BYOK usage (in USD) for the current UTC day17.38
byokUsageWeeklynumber✔️External BYOK usage (in USD) for the current UTC week (Monday-Sunday)17.38
byokUsageMonthlynumber✔️External BYOK usage (in USD) for current UTC month17.38
isFreeTierboolean✔️Whether this is a free tier API keyfalse
isProvisioningKeyboolean✔️Whether this is a provisioning keyfalse
limitRemainingnumber✔️Remaining spending limit in USD74.5
limitResetstring✔️Type of limit reset for the API keymonthly
includeByokInLimitboolean✔️Whether to include external BYOK usage in the credit limitfalse
rateLimitoperations.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."}