From a5393215bf6939ca4368303b94cf993091f296d9 Mon Sep 17 00:00:00 2001 From: talos <415831+talos@users.noreply.github.com> Date: Tue, 11 Nov 2025 16:35:40 +0000 Subject: [PATCH 1/2] chore: update OpenAPI specification from openrouter-web --- .speakeasy/in.openapi.yaml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index 42ed4b8..9b4f784 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -7058,6 +7058,12 @@ paths: nullable: true description: ISO 8601 timestamp of when the API key was last updated example: '2025-08-24T15:45:00Z' + expires_at: + type: string + nullable: true + format: date-time + description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration + example: '2027-12-31T23:59:59Z' required: - hash - name @@ -7096,6 +7102,7 @@ paths: byok_usage_monthly: 17.38 created_at: '2025-08-24T10:30:00Z' updated_at: '2025-08-24T15:45:00Z' + expires_at: '2027-12-31T23:59:59Z' description: List of API keys required: - data @@ -7119,6 +7126,7 @@ paths: byok_usage_monthly: 17.38 created_at: '2025-08-24T10:30:00Z' updated_at: '2025-08-24T15:45:00Z' + expires_at: '2027-12-31T23:59:59Z' '401': description: Unauthorized - Missing or invalid authentication content: @@ -7173,6 +7181,12 @@ paths: type: boolean description: Whether to include BYOK usage in the limit example: true + expires_at: + type: string + nullable: true + format: date-time + description: Optional ISO 8601 timestamp with timezone when the API key should expire + example: '2027-12-31T23:59:59Z' required: - name example: @@ -7180,6 +7194,7 @@ paths: limit: 50 limit_reset: monthly include_byok_in_limit: true + expires_at: '2027-12-31T23:59:59Z' required: true responses: '201': @@ -7268,6 +7283,12 @@ paths: nullable: true description: ISO 8601 timestamp of when the API key was last updated example: '2025-08-24T15:45:00Z' + expires_at: + type: string + nullable: true + format: date-time + description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration + example: '2027-12-31T23:59:59Z' required: - hash - name @@ -7306,6 +7327,7 @@ paths: byok_usage_monthly: 17.38 created_at: '2025-08-24T10:30:00Z' updated_at: '2025-08-24T15:45:00Z' + expires_at: '2027-12-31T23:59:59Z' description: The created API key information key: type: string @@ -7334,6 +7356,7 @@ paths: byok_usage_monthly: 0 created_at: '2025-08-24T10:30:00Z' updated_at: null + expires_at: '2027-12-31T23:59:59Z' key: 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 '400': description: Bad Request - Invalid request parameters @@ -7503,6 +7526,12 @@ paths: nullable: true description: ISO 8601 timestamp of when the API key was last updated example: '2025-08-24T15:45:00Z' + expires_at: + type: string + nullable: true + format: date-time + description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration + example: '2027-12-31T23:59:59Z' required: - hash - name @@ -7541,6 +7570,7 @@ paths: byok_usage_monthly: 17.38 created_at: '2025-08-24T10:30:00Z' updated_at: '2025-08-24T15:45:00Z' + expires_at: '2027-12-31T23:59:59Z' description: The updated API key information required: - data @@ -7564,6 +7594,7 @@ paths: byok_usage_monthly: 17.38 created_at: '2025-08-24T10:30:00Z' updated_at: '2025-08-24T16:00:00Z' + expires_at: null '400': description: Bad Request - Invalid request parameters content: @@ -7753,6 +7784,12 @@ paths: nullable: true description: ISO 8601 timestamp of when the API key was last updated example: '2025-08-24T15:45:00Z' + expires_at: + type: string + nullable: true + format: date-time + description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration + example: '2027-12-31T23:59:59Z' required: - hash - name @@ -7791,6 +7828,7 @@ paths: byok_usage_monthly: 17.38 created_at: '2025-08-24T10:30:00Z' updated_at: '2025-08-24T15:45:00Z' + expires_at: '2027-12-31T23:59:59Z' description: The API key information required: - data @@ -7814,6 +7852,7 @@ paths: byok_usage_monthly: 17.38 created_at: '2025-08-24T10:30:00Z' updated_at: '2025-08-24T15:45:00Z' + expires_at: '2027-12-31T23:59:59Z' '401': description: Unauthorized - Missing or invalid authentication content: From f520cdc02f18d83a5b9ed3f0d8f14592aae68f9b Mon Sep 17 00:00:00 2001 From: update-generated-files-action <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 16:37:15 +0000 Subject: [PATCH 2/2] Chore: auto-generate SDK and API documentation https://github.com/OpenRouterTeam/typescript-sdk/actions/runs/19272232953 --- .speakeasy/gen.lock | 8 ++-- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 39 +++++++++++++++++++ .speakeasy/workflow.lock | 12 +++--- docs/models/operations/createkeysdata.md | 41 ++++++++++---------- docs/models/operations/createkeysrequest.md | 3 +- docs/models/operations/createkeysresponse.md | 8 ++-- docs/models/operations/getkeydata.md | 41 ++++++++++---------- docs/models/operations/getkeyresponse.md | 6 +-- docs/models/operations/listdata.md | 41 ++++++++++---------- docs/models/operations/updatekeysdata.md | 41 ++++++++++---------- docs/models/operations/updatekeysresponse.md | 6 +-- examples/nextjs-example/package-lock.json | 2 +- jsr.json | 2 +- package-lock.json | 4 +- package.json | 2 +- src/lib/config.ts | 4 +- src/models/operations/createkeys.ts | 15 +++++++ src/models/operations/getkey.ts | 8 ++++ src/models/operations/list.ts | 8 ++++ src/models/operations/updatekeys.ts | 8 ++++ 21 files changed, 192 insertions(+), 109 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index a1ec72d..0689fd9 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 8b6cd71c-ea04-44da-af45-e43968b5928d management: - docChecksum: d991e451fa3b40458d9a8e2e16068801 + docChecksum: f377d4ed11037a871b8c253c1d75f132 docVersion: 1.0.0 - speakeasyVersion: 1.653.0 + speakeasyVersion: 1.653.1 generationVersion: 2.748.0 - releaseVersion: 0.1.8 - configChecksum: c8eca5e6a16c0adf24b477cd8360e674 + releaseVersion: 0.1.9 + configChecksum: 7a9a57baedc1855f3964d13bf5247b93 repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 290fe78..7c58d6a 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -30,7 +30,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: false typescript: - version: 0.1.8 + version: 0.1.9 acceptHeaderEnum: false additionalDependencies: dependencies: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 95b21b0..04e9b08 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -7065,6 +7065,12 @@ paths: nullable: true description: ISO 8601 timestamp of when the API key was last updated example: '2025-08-24T15:45:00Z' + expires_at: + type: string + nullable: true + format: date-time + description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration + example: '2027-12-31T23:59:59Z' required: - hash - name @@ -7103,6 +7109,7 @@ paths: byok_usage_monthly: 17.38 created_at: '2025-08-24T10:30:00Z' updated_at: '2025-08-24T15:45:00Z' + expires_at: '2027-12-31T23:59:59Z' description: List of API keys required: - data @@ -7126,6 +7133,7 @@ paths: byok_usage_monthly: 17.38 created_at: '2025-08-24T10:30:00Z' updated_at: '2025-08-24T15:45:00Z' + expires_at: '2027-12-31T23:59:59Z' '401': description: Unauthorized - Missing or invalid authentication content: @@ -7180,6 +7188,12 @@ paths: type: boolean description: Whether to include BYOK usage in the limit example: true + expires_at: + type: string + nullable: true + format: date-time + description: Optional ISO 8601 timestamp with timezone when the API key should expire + example: '2027-12-31T23:59:59Z' required: - name example: @@ -7187,6 +7201,7 @@ paths: limit: 50 limit_reset: monthly include_byok_in_limit: true + expires_at: '2027-12-31T23:59:59Z' required: true responses: '201': @@ -7275,6 +7290,12 @@ paths: nullable: true description: ISO 8601 timestamp of when the API key was last updated example: '2025-08-24T15:45:00Z' + expires_at: + type: string + nullable: true + format: date-time + description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration + example: '2027-12-31T23:59:59Z' required: - hash - name @@ -7313,6 +7334,7 @@ paths: byok_usage_monthly: 17.38 created_at: '2025-08-24T10:30:00Z' updated_at: '2025-08-24T15:45:00Z' + expires_at: '2027-12-31T23:59:59Z' description: The created API key information key: type: string @@ -7341,6 +7363,7 @@ paths: byok_usage_monthly: 0 created_at: '2025-08-24T10:30:00Z' updated_at: null + expires_at: '2027-12-31T23:59:59Z' key: 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 '400': description: Bad Request - Invalid request parameters @@ -7510,6 +7533,12 @@ paths: nullable: true description: ISO 8601 timestamp of when the API key was last updated example: '2025-08-24T15:45:00Z' + expires_at: + type: string + nullable: true + format: date-time + description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration + example: '2027-12-31T23:59:59Z' required: - hash - name @@ -7548,6 +7577,7 @@ paths: byok_usage_monthly: 17.38 created_at: '2025-08-24T10:30:00Z' updated_at: '2025-08-24T15:45:00Z' + expires_at: '2027-12-31T23:59:59Z' description: The updated API key information required: - data @@ -7571,6 +7601,7 @@ paths: byok_usage_monthly: 17.38 created_at: '2025-08-24T10:30:00Z' updated_at: '2025-08-24T16:00:00Z' + expires_at: null '400': description: Bad Request - Invalid request parameters content: @@ -7760,6 +7791,12 @@ paths: nullable: true description: ISO 8601 timestamp of when the API key was last updated example: '2025-08-24T15:45:00Z' + expires_at: + type: string + nullable: true + format: date-time + description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration + example: '2027-12-31T23:59:59Z' required: - hash - name @@ -7798,6 +7835,7 @@ paths: byok_usage_monthly: 17.38 created_at: '2025-08-24T10:30:00Z' updated_at: '2025-08-24T15:45:00Z' + expires_at: '2027-12-31T23:59:59Z' description: The API key information required: - data @@ -7821,6 +7859,7 @@ paths: byok_usage_monthly: 17.38 created_at: '2025-08-24T10:30:00Z' updated_at: '2025-08-24T15:45:00Z' + expires_at: '2027-12-31T23:59:59Z' '401': description: Unauthorized - Missing or invalid authentication content: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 660b907..f504a5b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.653.0 +speakeasyVersion: 1.653.1 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:684c9a95109635b087cc5ce05ce1dd1b63e55c85612ee25560c99cc85a6a1215 - sourceBlobDigest: sha256:988834ac43d414bf263bc54e3474c11047540738ef32056269620d834f7ffac7 + sourceRevisionDigest: sha256:505db4e808f899250c7fa8a9021fef1356f2e50b85cdd1bb0c9c8fb0c18ee70a + sourceBlobDigest: sha256:e9dacfcb19b3a3b855457d17b2fd129d604190b556d6510d103bcacd1da7010c tags: - latest - staging @@ -12,10 +12,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:684c9a95109635b087cc5ce05ce1dd1b63e55c85612ee25560c99cc85a6a1215 - sourceBlobDigest: sha256:988834ac43d414bf263bc54e3474c11047540738ef32056269620d834f7ffac7 + sourceRevisionDigest: sha256:505db4e808f899250c7fa8a9021fef1356f2e50b85cdd1bb0c9c8fb0c18ee70a + sourceBlobDigest: sha256:e9dacfcb19b3a3b855457d17b2fd129d604190b556d6510d103bcacd1da7010c codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:eec8ccd940cfc9e5072acaaee9380b17a8d7e35a75adf7da46a9727156f439c8 + codeSamplesRevisionDigest: sha256:a742a45e54f5e7d04f4128327c7558221fc95b7e012710a526ed8ec76b45f5ef workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/docs/models/operations/createkeysdata.md b/docs/models/operations/createkeysdata.md index 5922cbb..eaace6a 100644 --- a/docs/models/operations/createkeysdata.md +++ b/docs/models/operations/createkeysdata.md @@ -32,23 +32,24 @@ let value: CreateKeysData = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | -| `name` | *string* | :heavy_check_mark: | Name of the API key | My Production Key | -| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | -| `disabled` | *boolean* | :heavy_check_mark: | Whether the API key is disabled | false | -| `limit` | *number* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | -| `limitRemaining` | *number* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | -| `limitReset` | *string* | :heavy_check_mark: | Type of limit reset for the API key | monthly | -| `includeByokInLimit` | *boolean* | :heavy_check_mark: | Whether to include external BYOK usage in the credit limit | false | -| `usage` | *number* | :heavy_check_mark: | Total OpenRouter credit usage (in USD) for the API key | 25.5 | -| `usageDaily` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC day | 25.5 | -| `usageWeekly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) | 25.5 | -| `usageMonthly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC month | 25.5 | -| `byokUsage` | *number* | :heavy_check_mark: | Total external BYOK usage (in USD) for the API key | 17.38 | -| `byokUsageDaily` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC day | 17.38 | -| `byokUsageWeekly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC week (Monday-Sunday) | 17.38 | -| `byokUsageMonthly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for current UTC month | 17.38 | -| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was created | 2025-08-24T10:30:00Z | -| `updatedAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | +| `name` | *string* | :heavy_check_mark: | Name of the API key | My Production Key | +| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | +| `disabled` | *boolean* | :heavy_check_mark: | Whether the API key is disabled | false | +| `limit` | *number* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | +| `limitRemaining` | *number* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | +| `limitReset` | *string* | :heavy_check_mark: | Type of limit reset for the API key | monthly | +| `includeByokInLimit` | *boolean* | :heavy_check_mark: | Whether to include external BYOK usage in the credit limit | false | +| `usage` | *number* | :heavy_check_mark: | Total OpenRouter credit usage (in USD) for the API key | 25.5 | +| `usageDaily` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC day | 25.5 | +| `usageWeekly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) | 25.5 | +| `usageMonthly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC month | 25.5 | +| `byokUsage` | *number* | :heavy_check_mark: | Total external BYOK usage (in USD) for the API key | 17.38 | +| `byokUsageDaily` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC day | 17.38 | +| `byokUsageWeekly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC week (Monday-Sunday) | 17.38 | +| `byokUsageMonthly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for current UTC month | 17.38 | +| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was created | 2025-08-24T10:30:00Z | +| `updatedAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was last updated | 2025-08-24T15:45:00Z | +| `expiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | ISO 8601 UTC timestamp when the API key expires, or null if no expiration | 2027-12-31T23:59:59Z | \ No newline at end of file diff --git a/docs/models/operations/createkeysrequest.md b/docs/models/operations/createkeysrequest.md index f297a13..a1ce00f 100644 --- a/docs/models/operations/createkeysrequest.md +++ b/docs/models/operations/createkeysrequest.md @@ -17,4 +17,5 @@ let value: CreateKeysRequest = { | `name` | *string* | :heavy_check_mark: | Name for the new API key | My New API Key | | `limit` | *number* | :heavy_minus_sign: | Optional spending limit for the API key in USD | 50 | | `limitReset` | [operations.CreateKeysLimitReset](../../models/operations/createkeyslimitreset.md) | :heavy_minus_sign: | Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | monthly | -| `includeByokInLimit` | *boolean* | :heavy_minus_sign: | Whether to include BYOK usage in the limit | true | \ No newline at end of file +| `includeByokInLimit` | *boolean* | :heavy_minus_sign: | Whether to include BYOK usage in the limit | true | +| `expiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Optional ISO 8601 timestamp with timezone when the API key should expire | 2027-12-31T23:59:59Z | \ No newline at end of file diff --git a/docs/models/operations/createkeysresponse.md b/docs/models/operations/createkeysresponse.md index c2a23c4..af927c6 100644 --- a/docs/models/operations/createkeysresponse.md +++ b/docs/models/operations/createkeysresponse.md @@ -36,7 +36,7 @@ let value: CreateKeysResponse = { ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [operations.CreateKeysData](../../models/operations/createkeysdata.md) | :heavy_check_mark: | The created API key information | {
"hash": "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",
"name": "My Production Key",
"label": "Production API Key",
"disabled": false,
"limit": 100,
"limit_remaining": 74.5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"usage": 25.5,
"usage_daily": 25.5,
"usage_weekly": 25.5,
"usage_monthly": 25.5,
"byok_usage": 17.38,
"byok_usage_daily": 17.38,
"byok_usage_weekly": 17.38,
"byok_usage_monthly": 17.38,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | -| `key` | *string* | :heavy_check_mark: | The actual API key string (only shown once) | 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 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.CreateKeysData](../../models/operations/createkeysdata.md) | :heavy_check_mark: | The created API key information | {
"hash": "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",
"name": "My Production Key",
"label": "Production API Key",
"disabled": false,
"limit": 100,
"limit_remaining": 74.5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"usage": 25.5,
"usage_daily": 25.5,
"usage_weekly": 25.5,
"usage_monthly": 25.5,
"byok_usage": 17.38,
"byok_usage_daily": 17.38,
"byok_usage_weekly": 17.38,
"byok_usage_monthly": 17.38,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z",
"expires_at": "2027-12-31T23:59:59Z"
} | +| `key` | *string* | :heavy_check_mark: | The actual API key string (only shown once) | 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 | \ No newline at end of file diff --git a/docs/models/operations/getkeydata.md b/docs/models/operations/getkeydata.md index 42072b3..438836b 100644 --- a/docs/models/operations/getkeydata.md +++ b/docs/models/operations/getkeydata.md @@ -32,23 +32,24 @@ let value: GetKeyData = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | -| `name` | *string* | :heavy_check_mark: | Name of the API key | My Production Key | -| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | -| `disabled` | *boolean* | :heavy_check_mark: | Whether the API key is disabled | false | -| `limit` | *number* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | -| `limitRemaining` | *number* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | -| `limitReset` | *string* | :heavy_check_mark: | Type of limit reset for the API key | monthly | -| `includeByokInLimit` | *boolean* | :heavy_check_mark: | Whether to include external BYOK usage in the credit limit | false | -| `usage` | *number* | :heavy_check_mark: | Total OpenRouter credit usage (in USD) for the API key | 25.5 | -| `usageDaily` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC day | 25.5 | -| `usageWeekly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) | 25.5 | -| `usageMonthly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC month | 25.5 | -| `byokUsage` | *number* | :heavy_check_mark: | Total external BYOK usage (in USD) for the API key | 17.38 | -| `byokUsageDaily` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC day | 17.38 | -| `byokUsageWeekly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC week (Monday-Sunday) | 17.38 | -| `byokUsageMonthly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for current UTC month | 17.38 | -| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was created | 2025-08-24T10:30:00Z | -| `updatedAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | +| `name` | *string* | :heavy_check_mark: | Name of the API key | My Production Key | +| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | +| `disabled` | *boolean* | :heavy_check_mark: | Whether the API key is disabled | false | +| `limit` | *number* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | +| `limitRemaining` | *number* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | +| `limitReset` | *string* | :heavy_check_mark: | Type of limit reset for the API key | monthly | +| `includeByokInLimit` | *boolean* | :heavy_check_mark: | Whether to include external BYOK usage in the credit limit | false | +| `usage` | *number* | :heavy_check_mark: | Total OpenRouter credit usage (in USD) for the API key | 25.5 | +| `usageDaily` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC day | 25.5 | +| `usageWeekly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) | 25.5 | +| `usageMonthly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC month | 25.5 | +| `byokUsage` | *number* | :heavy_check_mark: | Total external BYOK usage (in USD) for the API key | 17.38 | +| `byokUsageDaily` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC day | 17.38 | +| `byokUsageWeekly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC week (Monday-Sunday) | 17.38 | +| `byokUsageMonthly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for current UTC month | 17.38 | +| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was created | 2025-08-24T10:30:00Z | +| `updatedAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was last updated | 2025-08-24T15:45:00Z | +| `expiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | ISO 8601 UTC timestamp when the API key expires, or null if no expiration | 2027-12-31T23:59:59Z | \ No newline at end of file diff --git a/docs/models/operations/getkeyresponse.md b/docs/models/operations/getkeyresponse.md index 13d18f5..b61a3fc 100644 --- a/docs/models/operations/getkeyresponse.md +++ b/docs/models/operations/getkeyresponse.md @@ -34,6 +34,6 @@ let value: GetKeyResponse = { ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [operations.GetKeyData](../../models/operations/getkeydata.md) | :heavy_check_mark: | The API key information | {
"hash": "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",
"name": "My Production Key",
"label": "Production API Key",
"disabled": false,
"limit": 100,
"limit_remaining": 74.5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"usage": 25.5,
"usage_daily": 25.5,
"usage_weekly": 25.5,
"usage_monthly": 25.5,
"byok_usage": 17.38,
"byok_usage_daily": 17.38,
"byok_usage_weekly": 17.38,
"byok_usage_monthly": 17.38,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.GetKeyData](../../models/operations/getkeydata.md) | :heavy_check_mark: | The API key information | {
"hash": "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",
"name": "My Production Key",
"label": "Production API Key",
"disabled": false,
"limit": 100,
"limit_remaining": 74.5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"usage": 25.5,
"usage_daily": 25.5,
"usage_weekly": 25.5,
"usage_monthly": 25.5,
"byok_usage": 17.38,
"byok_usage_daily": 17.38,
"byok_usage_weekly": 17.38,
"byok_usage_monthly": 17.38,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z",
"expires_at": "2027-12-31T23:59:59Z"
} | \ No newline at end of file diff --git a/docs/models/operations/listdata.md b/docs/models/operations/listdata.md index 1275720..82696b4 100644 --- a/docs/models/operations/listdata.md +++ b/docs/models/operations/listdata.md @@ -30,23 +30,24 @@ let value: ListData = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | -| `name` | *string* | :heavy_check_mark: | Name of the API key | My Production Key | -| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | -| `disabled` | *boolean* | :heavy_check_mark: | Whether the API key is disabled | false | -| `limit` | *number* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | -| `limitRemaining` | *number* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | -| `limitReset` | *string* | :heavy_check_mark: | Type of limit reset for the API key | monthly | -| `includeByokInLimit` | *boolean* | :heavy_check_mark: | Whether to include external BYOK usage in the credit limit | false | -| `usage` | *number* | :heavy_check_mark: | Total OpenRouter credit usage (in USD) for the API key | 25.5 | -| `usageDaily` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC day | 25.5 | -| `usageWeekly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) | 25.5 | -| `usageMonthly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC month | 25.5 | -| `byokUsage` | *number* | :heavy_check_mark: | Total external BYOK usage (in USD) for the API key | 17.38 | -| `byokUsageDaily` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC day | 17.38 | -| `byokUsageWeekly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC week (Monday-Sunday) | 17.38 | -| `byokUsageMonthly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for current UTC month | 17.38 | -| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was created | 2025-08-24T10:30:00Z | -| `updatedAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | +| `name` | *string* | :heavy_check_mark: | Name of the API key | My Production Key | +| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | +| `disabled` | *boolean* | :heavy_check_mark: | Whether the API key is disabled | false | +| `limit` | *number* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | +| `limitRemaining` | *number* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | +| `limitReset` | *string* | :heavy_check_mark: | Type of limit reset for the API key | monthly | +| `includeByokInLimit` | *boolean* | :heavy_check_mark: | Whether to include external BYOK usage in the credit limit | false | +| `usage` | *number* | :heavy_check_mark: | Total OpenRouter credit usage (in USD) for the API key | 25.5 | +| `usageDaily` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC day | 25.5 | +| `usageWeekly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) | 25.5 | +| `usageMonthly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC month | 25.5 | +| `byokUsage` | *number* | :heavy_check_mark: | Total external BYOK usage (in USD) for the API key | 17.38 | +| `byokUsageDaily` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC day | 17.38 | +| `byokUsageWeekly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC week (Monday-Sunday) | 17.38 | +| `byokUsageMonthly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for current UTC month | 17.38 | +| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was created | 2025-08-24T10:30:00Z | +| `updatedAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was last updated | 2025-08-24T15:45:00Z | +| `expiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | ISO 8601 UTC timestamp when the API key expires, or null if no expiration | 2027-12-31T23:59:59Z | \ No newline at end of file diff --git a/docs/models/operations/updatekeysdata.md b/docs/models/operations/updatekeysdata.md index 4460c3f..e7eb14f 100644 --- a/docs/models/operations/updatekeysdata.md +++ b/docs/models/operations/updatekeysdata.md @@ -32,23 +32,24 @@ let value: UpdateKeysData = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | -| `name` | *string* | :heavy_check_mark: | Name of the API key | My Production Key | -| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | -| `disabled` | *boolean* | :heavy_check_mark: | Whether the API key is disabled | false | -| `limit` | *number* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | -| `limitRemaining` | *number* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | -| `limitReset` | *string* | :heavy_check_mark: | Type of limit reset for the API key | monthly | -| `includeByokInLimit` | *boolean* | :heavy_check_mark: | Whether to include external BYOK usage in the credit limit | false | -| `usage` | *number* | :heavy_check_mark: | Total OpenRouter credit usage (in USD) for the API key | 25.5 | -| `usageDaily` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC day | 25.5 | -| `usageWeekly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) | 25.5 | -| `usageMonthly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC month | 25.5 | -| `byokUsage` | *number* | :heavy_check_mark: | Total external BYOK usage (in USD) for the API key | 17.38 | -| `byokUsageDaily` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC day | 17.38 | -| `byokUsageWeekly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC week (Monday-Sunday) | 17.38 | -| `byokUsageMonthly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for current UTC month | 17.38 | -| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was created | 2025-08-24T10:30:00Z | -| `updatedAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | +| `name` | *string* | :heavy_check_mark: | Name of the API key | My Production Key | +| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | +| `disabled` | *boolean* | :heavy_check_mark: | Whether the API key is disabled | false | +| `limit` | *number* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | +| `limitRemaining` | *number* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | +| `limitReset` | *string* | :heavy_check_mark: | Type of limit reset for the API key | monthly | +| `includeByokInLimit` | *boolean* | :heavy_check_mark: | Whether to include external BYOK usage in the credit limit | false | +| `usage` | *number* | :heavy_check_mark: | Total OpenRouter credit usage (in USD) for the API key | 25.5 | +| `usageDaily` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC day | 25.5 | +| `usageWeekly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) | 25.5 | +| `usageMonthly` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC month | 25.5 | +| `byokUsage` | *number* | :heavy_check_mark: | Total external BYOK usage (in USD) for the API key | 17.38 | +| `byokUsageDaily` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC day | 17.38 | +| `byokUsageWeekly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC week (Monday-Sunday) | 17.38 | +| `byokUsageMonthly` | *number* | :heavy_check_mark: | External BYOK usage (in USD) for current UTC month | 17.38 | +| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was created | 2025-08-24T10:30:00Z | +| `updatedAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was last updated | 2025-08-24T15:45:00Z | +| `expiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | ISO 8601 UTC timestamp when the API key expires, or null if no expiration | 2027-12-31T23:59:59Z | \ No newline at end of file diff --git a/docs/models/operations/updatekeysresponse.md b/docs/models/operations/updatekeysresponse.md index 97bcb47..b807076 100644 --- a/docs/models/operations/updatekeysresponse.md +++ b/docs/models/operations/updatekeysresponse.md @@ -34,6 +34,6 @@ let value: UpdateKeysResponse = { ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [operations.UpdateKeysData](../../models/operations/updatekeysdata.md) | :heavy_check_mark: | The updated API key information | {
"hash": "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",
"name": "My Production Key",
"label": "Production API Key",
"disabled": false,
"limit": 100,
"limit_remaining": 74.5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"usage": 25.5,
"usage_daily": 25.5,
"usage_weekly": 25.5,
"usage_monthly": 25.5,
"byok_usage": 17.38,
"byok_usage_daily": 17.38,
"byok_usage_weekly": 17.38,
"byok_usage_monthly": 17.38,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.UpdateKeysData](../../models/operations/updatekeysdata.md) | :heavy_check_mark: | The updated API key information | {
"hash": "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",
"name": "My Production Key",
"label": "Production API Key",
"disabled": false,
"limit": 100,
"limit_remaining": 74.5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"usage": 25.5,
"usage_daily": 25.5,
"usage_weekly": 25.5,
"usage_monthly": 25.5,
"byok_usage": 17.38,
"byok_usage_daily": 17.38,
"byok_usage_weekly": 17.38,
"byok_usage_monthly": 17.38,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z",
"expires_at": "2027-12-31T23:59:59Z"
} | \ No newline at end of file diff --git a/examples/nextjs-example/package-lock.json b/examples/nextjs-example/package-lock.json index b1ab05f..496c447 100644 --- a/examples/nextjs-example/package-lock.json +++ b/examples/nextjs-example/package-lock.json @@ -36,7 +36,7 @@ }, "../..": { "name": "@openrouter/sdk", - "version": "0.1.8", + "version": "0.1.9", "license": "Apache-2.0", "dependencies": { "zod": "^3.25.0 || ^4.0.0" diff --git a/jsr.json b/jsr.json index df88df2..4392f76 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "0.1.8", + "version": "0.1.9", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index b9f9378..75004de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openrouter/sdk", - "version": "0.1.8", + "version": "0.1.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@openrouter/sdk", - "version": "0.1.8", + "version": "0.1.9", "license": "Apache-2.0", "dependencies": { "zod": "^3.25.0 || ^4.0.0" diff --git a/package.json b/package.json index 022fc3a..7ad3ada 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "0.1.8", + "version": "0.1.9", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.", "keywords": [ diff --git a/src/lib/config.ts b/src/lib/config.ts index dd1bb94..036a192 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -59,7 +59,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "0.1.8", + sdkVersion: "0.1.9", genVersion: "2.748.0", - userAgent: "speakeasy-sdk/typescript 0.1.8 2.748.0 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 0.1.9 2.748.0 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/operations/createkeys.ts b/src/models/operations/createkeys.ts index e0073d0..991e857 100644 --- a/src/models/operations/createkeys.ts +++ b/src/models/operations/createkeys.ts @@ -39,6 +39,10 @@ export type CreateKeysRequest = { * Whether to include BYOK usage in the limit */ includeByokInLimit?: boolean | undefined; + /** + * Optional ISO 8601 timestamp with timezone when the API key should expire + */ + expiresAt?: Date | null | undefined; }; /** @@ -117,6 +121,10 @@ export type CreateKeysData = { * ISO 8601 timestamp of when the API key was last updated */ updatedAt: string | null; + /** + * ISO 8601 UTC timestamp when the API key expires, or null if no expiration + */ + expiresAt?: Date | null | undefined; }; /** @@ -148,6 +156,7 @@ export type CreateKeysRequest$Outbound = { limit?: number | null | undefined; limit_reset?: string | null | undefined; include_byok_in_limit?: boolean | undefined; + expires_at?: string | null | undefined; }; /** @internal */ @@ -159,10 +168,12 @@ export const CreateKeysRequest$outboundSchema: z.ZodType< limit: z.nullable(z.number()).optional(), limitReset: z.nullable(CreateKeysLimitReset$outboundSchema).optional(), includeByokInLimit: z.boolean().optional(), + expiresAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), }).transform((v) => { return remap$(v, { limitReset: "limit_reset", includeByokInLimit: "include_byok_in_limit", + expiresAt: "expires_at", }); }); @@ -195,6 +206,9 @@ export const CreateKeysData$inboundSchema: z.ZodType = byok_usage_monthly: z.number(), created_at: z.string(), updated_at: z.nullable(z.string()), + expires_at: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), }).transform((v) => { return remap$(v, { "limit_remaining": "limitRemaining", @@ -209,6 +223,7 @@ export const CreateKeysData$inboundSchema: z.ZodType = "byok_usage_monthly": "byokUsageMonthly", "created_at": "createdAt", "updated_at": "updatedAt", + "expires_at": "expiresAt", }); }); diff --git a/src/models/operations/getkey.ts b/src/models/operations/getkey.ts index a336dae..3cd4487 100644 --- a/src/models/operations/getkey.ts +++ b/src/models/operations/getkey.ts @@ -91,6 +91,10 @@ export type GetKeyData = { * ISO 8601 timestamp of when the API key was last updated */ updatedAt: string | null; + /** + * ISO 8601 UTC timestamp when the API key expires, or null if no expiration + */ + expiresAt?: Date | null | undefined; }; /** @@ -141,6 +145,9 @@ export const GetKeyData$inboundSchema: z.ZodType = z byok_usage_monthly: z.number(), created_at: z.string(), updated_at: z.nullable(z.string()), + expires_at: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), }).transform((v) => { return remap$(v, { "limit_remaining": "limitRemaining", @@ -155,6 +162,7 @@ export const GetKeyData$inboundSchema: z.ZodType = z "byok_usage_monthly": "byokUsageMonthly", "created_at": "createdAt", "updated_at": "updatedAt", + "expires_at": "expiresAt", }); }); diff --git a/src/models/operations/list.ts b/src/models/operations/list.ts index a453c58..80a97b4 100644 --- a/src/models/operations/list.ts +++ b/src/models/operations/list.ts @@ -92,6 +92,10 @@ export type ListData = { * ISO 8601 timestamp of when the API key was last updated */ updatedAt: string | null; + /** + * ISO 8601 UTC timestamp when the API key expires, or null if no expiration + */ + expiresAt?: Date | null | undefined; }; /** @@ -147,6 +151,9 @@ export const ListData$inboundSchema: z.ZodType = z.object({ byok_usage_monthly: z.number(), created_at: z.string(), updated_at: z.nullable(z.string()), + expires_at: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), }).transform((v) => { return remap$(v, { "limit_remaining": "limitRemaining", @@ -161,6 +168,7 @@ export const ListData$inboundSchema: z.ZodType = z.object({ "byok_usage_monthly": "byokUsageMonthly", "created_at": "createdAt", "updated_at": "updatedAt", + "expires_at": "expiresAt", }); }); diff --git a/src/models/operations/updatekeys.ts b/src/models/operations/updatekeys.ts index a8f12b9..1a935c0 100644 --- a/src/models/operations/updatekeys.ts +++ b/src/models/operations/updatekeys.ts @@ -129,6 +129,10 @@ export type UpdateKeysData = { * ISO 8601 timestamp of when the API key was last updated */ updatedAt: string | null; + /** + * ISO 8601 UTC timestamp when the API key expires, or null if no expiration + */ + expiresAt?: Date | null | undefined; }; /** @@ -232,6 +236,9 @@ export const UpdateKeysData$inboundSchema: z.ZodType = byok_usage_monthly: z.number(), created_at: z.string(), updated_at: z.nullable(z.string()), + expires_at: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), }).transform((v) => { return remap$(v, { "limit_remaining": "limitRemaining", @@ -246,6 +253,7 @@ export const UpdateKeysData$inboundSchema: z.ZodType = "byok_usage_monthly": "byokUsageMonthly", "created_at": "createdAt", "updated_at": "updatedAt", + "expires_at": "expiresAt", }); });