For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
ModelsChatRankingsDocs
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
    • Overview
    • Usage for Agents
  • TypeScript SDK
    • Overview
      • Analytics
      • APIKeys
      • Byok
      • Chat
      • Credits
      • Embeddings
      • Endpoints
      • Generations
      • Guardrails
      • OAuth
      • Observability
        • GetCurrentKeyData
      • Organization
      • Presets
      • Providers
      • Rerank
      • Beta.Responses
      • Transcriptions
      • Speech
      • VideoGeneration
      • Workspaces
  • Python SDK
    • Overview
  • Go SDK
  • DevTools
    • Overview
    • Migrating to @openrouter/agent
LogoLogo
ModelsChatRankingsDocs
On this page
  • Example Usage
  • Fields
TypeScript SDKAPI ReferenceOperations

GetCurrentKeyData - TypeScript SDK

GetCurrentKeyData type definition
Was this page helpful?
Previous

Organization - TypeScript SDK

Organization method reference
Next
Built with

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 byokUsage: 17.38,
5 byokUsageDaily: 17.38,
6 byokUsageMonthly: 17.38,
7 byokUsageWeekly: 17.38,
8 creatorUserId: "user_2dHFtVWx2n56w6HkM0000000000",
9 includeByokInLimit: false,
10 isFreeTier: false,
11 isManagementKey: false,
12 isProvisioningKey: false,
13 label: "sk-or-v1-au7...890",
14 limit: 100,
15 limitRemaining: 74.5,
16 limitReset: "monthly",
17 rateLimit: {
18 interval: "1h",
19 note: "This field is deprecated and safe to ignore.",
20 requests: 1000,
21 },
22 usage: 25.5,
23 usageDaily: 25.5,
24 usageMonthly: 25.5,
25 usageWeekly: 25.5,
26};

Fields

FieldTypeRequiredDescriptionExample
byokUsagenumber✔️Total external BYOK usage (in USD) for the API key17.38
byokUsageDailynumber✔️External BYOK usage (in USD) for the current UTC day17.38
byokUsageMonthlynumber✔️External BYOK usage (in USD) for current UTC month17.38
byokUsageWeeklynumber✔️External BYOK usage (in USD) for the current UTC week (Monday-Sunday)17.38
creatorUserIdstring✔️The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user’s own ID.user_2dHFtVWx2n56w6HkM0000000000
expiresAtDate➖ISO 8601 UTC timestamp when the API key expires, or null if no expiration2027-12-31T23:59:59Z
includeByokInLimitboolean✔️Whether to include external BYOK usage in the credit limitfalse
isFreeTierboolean✔️Whether this is a free tier API keyfalse
isManagementKeyboolean✔️Whether this is a management keyfalse
isProvisioningKeyboolean✔️: warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Whether this is a management key
false
labelstring✔️Human-readable label for the API keysk-or-v1-0e6…1c96
limitnumber✔️Spending limit for the API key in USD100
limitRemainingnumber✔️Remaining spending limit in USD74.5
limitResetstring✔️Type of limit reset for the API keymonthly
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.
{"interval": "1h","note": "This field is deprecated and safe to ignore.","requests": 1000}
usagenumber✔️Total OpenRouter credit usage (in USD) for the API key25.5
usageDailynumber✔️OpenRouter credit usage (in USD) for the current UTC day25.5
usageMonthlynumber✔️OpenRouter credit usage (in USD) for the current UTC month25.5
usageWeeklynumber✔️OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)25.5