diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 431262378..ba0f4da1f 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: "" id: "" management: - docChecksum: 13fef909a413112f86b8503fe1937398 + docChecksum: ee1ea001311376b07ab80289a73b464f docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.4.22 - configChecksum: d276b0158740a9efc1aede35885fd6a2 + releaseVersion: 1.4.23 + configChecksum: 607d61760c4129efc88607030c0eb271 repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true persistentEdits: - generation_id: 073694a2-8d88-41ae-8e24-ea226e4aa43b - pristine_commit_hash: 2f457a23c1fde8045766b8ff8a2f2ad321080d7d - pristine_tree_hash: 6f42ad2628aaef421490af9466cb70179c561208 + generation_id: 88a955ec-41ee-4991-add7-f9dcaf757aa6 + pristine_commit_hash: 3ea7f69182c26049d4dca113525eb129c29f0ca4 + pristine_tree_hash: fbe0c29058032ba1c547008df58ae2129743cd07 features: typescript: acceptHeaders: 2.81.2 @@ -2248,8 +2248,12 @@ trackedFiles: deleted: true docs/models/byokkey.mdx: id: ed17b6e522dd - last_write_checksum: sha1:a2f33339597371210521ae5aee36777e257876dd - pristine_git_object: 92ada1c528a2de336fe2b52ea0f68be3b48c29d4 + last_write_checksum: sha1:055e29eb03dae9ca6c9ced4123fd28fa684715b8 + pristine_git_object: 91d707e11c73c73c4e7ebe564a568d6708b991b5 + docs/models/byokkeydeclaredregion.mdx: + id: 9e8c56f948b1 + last_write_checksum: sha1:43d6ff652300500fb0d28ac3e28624fe4aee43f6 + pristine_git_object: 9b4013200e8351d5d619a6f0c2ea5fa47c70a7ec docs/models/byokproviderslug.md: id: 0db8d46d0539 last_write_checksum: sha1:8d8078726e04614de614dc0691114302053ed3c9 @@ -3843,8 +3847,12 @@ trackedFiles: deleted: true docs/models/createbyokkeyrequest.mdx: id: 6a466b641b37 - last_write_checksum: sha1:92b49b08c789dc1f977b493353003d806bd20674 - pristine_git_object: 4dbe35c5e621815cdedf6c06db979e45f3fceab1 + last_write_checksum: sha1:d239db141bd1344e9116fe72182ba78180c0d872 + pristine_git_object: 41c765f378224ca460ffbed6a7ebc5c7d61aab48 + docs/models/createbyokkeyrequestdeclaredregion.mdx: + id: e5e544d9f8d8 + last_write_checksum: sha1:13d93ccf0a15534648c5fe4b7cfafe0ea0d4934f + pristine_git_object: f899bc70f0c3e8e4fe3fa652e3b1b2c6db4e3e8f docs/models/createbyokkeyresponse.md: id: 589ec05e9aa8 last_write_checksum: sha1:c02336d61d8daee5fe0ea5238cbc0625a0225943 @@ -3852,8 +3860,8 @@ trackedFiles: deleted: true docs/models/createbyokkeyresponse.mdx: id: 8548d8738625 - last_write_checksum: sha1:7a74f590306690b268ef7ea8cb597ee890a43755 - pristine_git_object: b9f409dc4ad48f30507eaae346661769e545f404 + last_write_checksum: sha1:ea5adf79bbe13131249bc6623149c6f19b2031c9 + pristine_git_object: 85ff57c5c85f1811f93d299c0a65eb76e3677d53 docs/models/createenduserrequest.mdx: id: 2913e82c6df3 last_write_checksum: sha1:d01cc263feb2d7c252529c1f4e7675098298add1 @@ -5292,8 +5300,8 @@ trackedFiles: deleted: true docs/models/getbyokkeyresponse.mdx: id: 3909af43065e - last_write_checksum: sha1:7fbc0588b79d8c011cb559ceba91e1b89bca62ae - pristine_git_object: 89c8121fd1508b05c80417abda0da2252a5e20b5 + last_write_checksum: sha1:cd856080e8b1278372b95352833808744e2c5f7a + pristine_git_object: 4d8ee1a6d79ef540c1ed0efc78b64918162f5bbb docs/models/getguardrailresponse.md: id: 3590ce9e2938 last_write_checksum: sha1:3aa1d48ad5792df4a6fd96248d6c5a6e7fc93686 @@ -6527,8 +6535,8 @@ trackedFiles: deleted: true docs/models/listbyokkeysresponse.mdx: id: 3e4531beaf95 - last_write_checksum: sha1:5be92e883be9f98ce9aaa54cdf9501feb68010b8 - pristine_git_object: 72a5a4e7e71c490b3d76b0620af3e90f1bbe0024 + last_write_checksum: sha1:e219d84653c000ca97e8abf2794caedb34a2bb4e + pristine_git_object: 20c6333d21d0fad1b5da177345e144078f28ec66 docs/models/listendpointsresponse.mdx: id: 67f685fdc519 last_write_checksum: sha1:79c69820f9ad6a9f6ec66e3c37fb9453522567b0 @@ -9738,8 +9746,8 @@ trackedFiles: deleted: true docs/models/operations/listbyokkeysresponse.mdx: id: 23158c88a16c - last_write_checksum: sha1:116f8ec241b61cfff0f8e5148de934b833865aea - pristine_git_object: 500b32dcd41d1c3fedbc550f167a5dfc92e71ab1 + last_write_checksum: sha1:e6e059a7da0a750af86af196976ffa4e3fab96bd + pristine_git_object: e080c0fc59e74e1a520efc847f4afa01da563f05 docs/models/operations/listcontainerfilesglobals.mdx: id: b92d7b513ebf last_write_checksum: sha1:ca63671e4566741780689db055e7f47540060705 @@ -14447,8 +14455,12 @@ trackedFiles: deleted: true docs/models/updatebyokkeyrequest.mdx: id: 0be70e8f01d0 - last_write_checksum: sha1:d933f736867c9acb2943f8de77d7c559cb83a799 - pristine_git_object: 3c9a427290eac9b5c764d4d854218bfdb736f622 + last_write_checksum: sha1:ed666a582cc56b514c1d94d9106ba59822e6fe48 + pristine_git_object: aef70f642f97e85b09f3533b310dad441695e9b3 + docs/models/updatebyokkeyrequestdeclaredregion.mdx: + id: 41c4b5fab972 + last_write_checksum: sha1:cd6dfd3bab46dacadde9bd8d3efac0a9c560c952 + pristine_git_object: 42914163ba6a882466a3f371296b750c226cc8a6 docs/models/updatebyokkeyresponse.md: id: 7a0c1a810e5a last_write_checksum: sha1:09d665fd17a7f34e50470c4143bde682823784a6 @@ -14456,8 +14468,8 @@ trackedFiles: deleted: true docs/models/updatebyokkeyresponse.mdx: id: 3ad646ddc662 - last_write_checksum: sha1:3b05974a66941923ac497223876df22ff0d15fc3 - pristine_git_object: df6661a26fafa22e8ec88d7eee320e9fcce2e595 + last_write_checksum: sha1:864ed8bc9fbcbaac796ff10a3fd7b3c466bc2dcb + pristine_git_object: f64cea097509a597c2f134d21d45136fd9573578 docs/models/updateenduserrequest.mdx: id: 693677e5c064 last_write_checksum: sha1:dd42746d34194975bb1c6a76e42f246d9e18947d @@ -15111,8 +15123,8 @@ trackedFiles: deleted: true docs/sdks/byok/README.mdx: id: 17792f3b180d - last_write_checksum: sha1:f73aadf34bb48dbedff208d4f9f7203362550c48 - pristine_git_object: 528c0f07107423aa378563193a5791162f073ec2 + last_write_checksum: sha1:1761f97be58b39d843a3cf7442b3fc3a50931eff + pristine_git_object: 92595fd27bd8c9a4eb932b3add27e18fd02d2edf docs/sdks/chat/README.mdx: id: 1dd859c23fe1 last_write_checksum: sha1:b01aa24bc49b080a9d99ca0f7303d1afd546b6ac @@ -15323,12 +15335,12 @@ trackedFiles: pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:480ce523df3d3a90ca77158276e1e86deb43f733 - pristine_git_object: 8179d16f8f9b896acb6688a4780d2c66350b663a + last_write_checksum: sha1:3ba337f180f574b226dd452270cd3278f69fc0d0 + pristine_git_object: 1c0232dad45bbc3e775ac6f94fd1d2f4f7b546a1 package.json: id: 7030d0b2f71b - last_write_checksum: sha1:51b716308bdccd1c9442689f733fd431a2c34d01 - pristine_git_object: 327c3e678c753f2b8275e609c87af00e68b7d40a + last_write_checksum: sha1:a2cae7fbe13dd8dd0ebe77d8734ac236a9c2b3a6 + pristine_git_object: ee656b968d57e2c83296012f042fa3664aa4a766 src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131 @@ -15411,8 +15423,8 @@ trackedFiles: pristine_git_object: dfb9d43d49aad7afddefd364a0b072818f2e494e src/funcs/byokUpdate.ts: id: af96a7f06850 - last_write_checksum: sha1:44bd81277a3e11b6705dbb755e793366a8ba093b - pristine_git_object: 3741c42bacd78363dd09188953df70ccf74264d8 + last_write_checksum: sha1:31dc0ea3b6283ff54055e81b2c7ccd094cbc02b5 + pristine_git_object: afeb01b71aaed17f4b8c05823fe8d1763247c2d1 src/funcs/chatSend.ts: id: 8c3aa3c963bf last_write_checksum: sha1:71e76ceebcad45d6f42ef0aefdfb0b3847e6d87d @@ -15947,8 +15959,8 @@ trackedFiles: pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:4c29fe4c9ccf7dc6a7d54063359998428d2c3894 - pristine_git_object: bda79338bea69fc16f129aed5796b2ae9a1e7dbb + last_write_checksum: sha1:c35f91c854a466f5fbb4413deeb900802fdd09cf + pristine_git_object: 48c7f6904838f30a85264d1dc4ac2cb85fc7f45d src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711 @@ -16709,8 +16721,8 @@ trackedFiles: pristine_git_object: fbf53dfb6f2bc1aba4ed0b9a600e560824ea7bb2 src/models/byokkey.ts: id: 7f8b3abf1e77 - last_write_checksum: sha1:aae7b1bf4eae72e8ce15935f1fe4059a4cd5de68 - pristine_git_object: d5f3e94c87517ea178dd62f9388d9b873cb94603 + last_write_checksum: sha1:a30bf2175d660aedf8bc3a613f5f1aa446f206f6 + pristine_git_object: 2dbfeedaee4a2dfc8af5a28ddbdfe478ad26e24b src/models/byokproviderslug.ts: id: f8e7a5a4b0a2 last_write_checksum: sha1:ed049eefcc4157e9ce230342d5c3d9372b35761f @@ -17057,8 +17069,8 @@ trackedFiles: pristine_git_object: 183bdefa780fa52bd2753634f508ea70be2ccbe6 src/models/createbyokkeyrequest.ts: id: 5adb6ef47627 - last_write_checksum: sha1:474ec04be6ea77c9e86e5789a97a98528c014f39 - pristine_git_object: 4d5c3297dbcf4cbbf93f26fd5cdd3e27577eef1d + last_write_checksum: sha1:71df0666783374a6b19740da536c2815a057c75b + pristine_git_object: c292d8fe2c726e3f3bff3153dc4ac45ca78ed876 src/models/createbyokkeyresponse.ts: id: 93fb8363303b last_write_checksum: sha1:5a3ee4e5d8f90bd181f9ac81e06af4f5295cf255 @@ -19861,8 +19873,8 @@ trackedFiles: pristine_git_object: 8db22a6950c3dd45bf8316b459256ff6c7b0142b src/models/updatebyokkeyrequest.ts: id: e86268c7b05c - last_write_checksum: sha1:986e5ab454797d6d0c38e17051139fb83adb2040 - pristine_git_object: 3fb21e92a9d0622f287b9fd71a33635ba58b63da + last_write_checksum: sha1:af5ec732d4b8bc1b66845a569797e5718a71bd6c + pristine_git_object: 913b2035077a2664b537cb36924e36aec68dbde9 src/models/updatebyokkeyresponse.ts: id: 016842b2461b last_write_checksum: sha1:eb08a44de913f4b9779fa375aa41e15154216e16 @@ -21336,7 +21348,7 @@ examples: limit: 50 responses: "200": - application/json: {"data": [{"allowed_api_key_hashes": null, "allowed_models": null, "allowed_user_ids": null, "created_at": "2025-08-24T10:30:00Z", "declared_zdr": null, "disabled": false, "id": "11111111-2222-3333-4444-555555555555", "is_byok_only": false, "is_fallback": false, "is_required": false, "label": "sk-...AbCd", "provider": "openai", "sort_order": 0, "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}], "total_count": 1} + application/json: {"data": [{"allowed_api_key_hashes": null, "allowed_models": null, "allowed_user_ids": null, "created_at": "2025-08-24T10:30:00Z", "declared_region": null, "declared_zdr": null, "disabled": false, "id": "11111111-2222-3333-4444-555555555555", "is_byok_only": false, "is_fallback": false, "is_required": false, "label": "sk-...AbCd", "provider": "openai", "sort_order": 0, "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}], "total_count": 1} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "500": @@ -21350,7 +21362,7 @@ examples: id: "11111111-2222-3333-4444-555555555555" responses: "200": - application/json: {"data": {"allowed_api_key_hashes": null, "allowed_models": null, "allowed_user_ids": null, "created_at": "2025-08-24T10:30:00Z", "declared_zdr": null, "disabled": false, "id": "11111111-2222-3333-4444-555555555555", "is_byok_only": false, "is_fallback": false, "is_required": false, "label": "sk-...AbCd", "provider": "openai", "sort_order": 0, "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}} + application/json: {"data": {"allowed_api_key_hashes": null, "allowed_models": null, "allowed_user_ids": null, "created_at": "2025-08-24T10:30:00Z", "declared_region": null, "declared_zdr": null, "disabled": false, "id": "11111111-2222-3333-4444-555555555555", "is_byok_only": false, "is_fallback": false, "is_required": false, "label": "sk-...AbCd", "provider": "openai", "sort_order": 0, "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "404": @@ -21392,7 +21404,7 @@ examples: application/json: {"key": "sk-proj-abc123...", "provider": "openai"} responses: "201": - application/json: {"data": {"allowed_api_key_hashes": null, "allowed_models": null, "allowed_user_ids": null, "created_at": "2025-08-24T10:30:00Z", "declared_zdr": null, "disabled": false, "id": "11111111-2222-3333-4444-555555555555", "is_byok_only": false, "is_fallback": false, "is_required": false, "label": "sk-...AbCd", "provider": "openai", "sort_order": 0, "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}} + application/json: {"data": {"allowed_api_key_hashes": null, "allowed_models": null, "allowed_user_ids": null, "created_at": "2025-08-24T10:30:00Z", "declared_region": null, "declared_zdr": null, "disabled": false, "id": "11111111-2222-3333-4444-555555555555", "is_byok_only": false, "is_fallback": false, "is_required": false, "label": "sk-...AbCd", "provider": "openai", "sort_order": 0, "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -21424,7 +21436,7 @@ examples: application/json: {} responses: "200": - application/json: {"data": {"allowed_api_key_hashes": null, "allowed_models": null, "allowed_user_ids": null, "created_at": "2025-08-24T10:30:00Z", "declared_zdr": null, "disabled": false, "id": "11111111-2222-3333-4444-555555555555", "is_byok_only": false, "is_fallback": false, "is_required": false, "label": "sk-...AbCd", "provider": "openai", "sort_order": 0, "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}} + application/json: {"data": {"allowed_api_key_hashes": null, "allowed_models": null, "allowed_user_ids": null, "created_at": "2025-08-24T10:30:00Z", "declared_region": null, "declared_zdr": null, "disabled": false, "id": "11111111-2222-3333-4444-555555555555", "is_byok_only": false, "is_fallback": false, "is_required": false, "label": "sk-...AbCd", "provider": "openai", "sort_order": 0, "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -21435,6 +21447,8 @@ examples: application/json: {"error": {"code": 500, "message": "Internal Server Error"}} "403": application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "409": + application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} createObservabilityDestination: speakeasy-default-create-observability-destination: requestBody: @@ -24250,4 +24264,4 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Typescript SDK Changes:\n* `openrouter.batch.createBatches()`: \n * `request.batchSubmitBody.provider.allowFallbacks` **Added**\n" +releaseNotes: "## Typescript SDK Changes:\n* `openrouter.byok.list()`: `response.data[].declaredRegion` **Added**\n* `openrouter.byok.create()`: \n * `request.createByokKeyRequest.declaredRegion` **Added**\n * `response.data.declaredRegion` **Added**\n* `openrouter.byok.get()`: `response.data.declaredRegion` **Added**\n* `openrouter.byok.update()`: \n * `request.updateByokKeyRequest.declaredRegion` **Added**\n * `response.data.declaredRegion` **Added**\n * `error.status[409]` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index ee4945398..49370ad3a 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true typescript: - version: 1.4.22 + version: 1.4.23 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index dec12cfa8..532f736d0 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -6422,6 +6422,7 @@ components: allowed_models: null allowed_user_ids: null created_at: '2025-08-24T10:30:00Z' + declared_region: null declared_zdr: null disabled: false id: '11111111-2222-3333-4444-555555555555' @@ -6466,6 +6467,18 @@ components: description: 'ISO timestamp of when the credential was created.' example: '2025-08-24T10:30:00Z' type: 'string' + declared_region: + description: 'Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter''s regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key''s region. Among other providers, only Azure accepts `europe` or `us`.' + enum: + - 'global' + - 'europe' + - 'us' + - null + example: null + type: + - 'string' + - 'null' + x-speakeasy-unknown-values: allow declared_zdr: description: 'Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter''s data policy for the provider''s endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter.' example: null @@ -6526,6 +6539,7 @@ components: - 'is_required' - 'is_byok_only' - 'declared_zdr' + - 'declared_region' - 'allowed_models' - 'allowed_api_key_hashes' - 'allowed_user_ids' @@ -9268,6 +9282,18 @@ components: type: - 'array' - 'null' + declared_region: + description: 'Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter''s regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key''s region. Among other providers, only Azure accepts `europe` or `us`. Defaults to the key''s region for OpenAI and Fireworks, otherwise `null`.' + enum: + - 'global' + - 'europe' + - 'us' + - null + example: null + type: + - 'string' + - 'null' + x-speakeasy-unknown-values: allow declared_zdr: description: 'Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter''s data policy for the provider''s endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. Defaults to `null`.' example: null @@ -9320,6 +9346,7 @@ components: allowed_models: null allowed_user_ids: null created_at: '2025-08-24T10:30:00Z' + declared_region: null declared_zdr: null disabled: false id: '11111111-2222-3333-4444-555555555555' @@ -12697,6 +12724,7 @@ components: allowed_models: null allowed_user_ids: null created_at: '2025-08-24T10:30:00Z' + declared_region: null declared_zdr: null disabled: false id: '11111111-2222-3333-4444-555555555555' @@ -15563,6 +15591,7 @@ components: allowed_models: null allowed_user_ids: null created_at: '2025-08-24T10:30:00Z' + declared_region: null declared_zdr: null disabled: false id: '11111111-2222-3333-4444-555555555555' @@ -31126,6 +31155,18 @@ components: type: - 'array' - 'null' + declared_region: + description: 'Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter''s regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key''s region. Among other providers, only Azure accepts `europe` or `us`. Omit to leave the stored value unchanged (rotating an OpenAI or Fireworks `key` re-derives it from the new key); `null` clears the declaration.' + enum: + - 'global' + - 'europe' + - 'us' + - null + example: null + type: + - 'string' + - 'null' + x-speakeasy-unknown-values: allow declared_zdr: description: 'Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter''s data policy for the provider''s endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. Omit to leave the stored value unchanged; `null` clears the declaration.' example: null @@ -31168,6 +31209,7 @@ components: allowed_models: null allowed_user_ids: null created_at: '2025-08-24T10:30:00Z' + declared_region: null declared_zdr: null disabled: false id: '11111111-2222-3333-4444-555555555555' @@ -35607,6 +35649,7 @@ paths: allowed_models: null allowed_user_ids: null created_at: '2025-08-24T10:30:00Z' + declared_region: null declared_zdr: null disabled: false id: '11111111-2222-3333-4444-555555555555' @@ -35690,6 +35733,7 @@ paths: allowed_models: null allowed_user_ids: null created_at: '2025-08-24T10:30:00Z' + declared_region: null declared_zdr: null disabled: false id: '11111111-2222-3333-4444-555555555555' @@ -35832,6 +35876,7 @@ paths: allowed_models: null allowed_user_ids: null created_at: '2025-08-24T10:30:00Z' + declared_region: null declared_zdr: null disabled: false id: '11111111-2222-3333-4444-555555555555' @@ -35912,6 +35957,7 @@ paths: allowed_models: null allowed_user_ids: null created_at: '2025-08-24T10:30:00Z' + declared_region: null declared_zdr: null disabled: false id: '11111111-2222-3333-4444-555555555555' @@ -35966,6 +36012,16 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' '500': content: application/json: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 87cd8b45c..238f9e890 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:4ae5429a9664f64a0a2f23b6b028623d255527cc1543848c3fa3211f0888ed5f - sourceBlobDigest: sha256:d94da8a9477157059bf60d1adb55ebd89d28729eacd14a86d4a6176a9adc35ce + sourceRevisionDigest: sha256:08b893c89a42e05d6e0734ba9d74dcf486a0555f39bb9726af255e4c5387cd82 + sourceBlobDigest: sha256:e35daa2d9a7a366ec9f6360a6d6643fe3aa7d2990b39d66d44531c1332adf160 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:4ae5429a9664f64a0a2f23b6b028623d255527cc1543848c3fa3211f0888ed5f - sourceBlobDigest: sha256:d94da8a9477157059bf60d1adb55ebd89d28729eacd14a86d4a6176a9adc35ce + sourceRevisionDigest: sha256:08b893c89a42e05d6e0734ba9d74dcf486a0555f39bb9726af255e4c5387cd82 + sourceBlobDigest: sha256:e35daa2d9a7a366ec9f6360a6d6643fe3aa7d2990b39d66d44531c1332adf160 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:2d2af1d9cf560bc72109e553588de902b7e8833103da2a52f6e8bc556a574331 + codeSamplesRevisionDigest: sha256:a498710f57f87bbeead57a1c4399e8f114e75377785c6eba900a33f6a24174a2 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index f425915f7..4d365778d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4356,4 +4356,14 @@ Based on: ### Generated - [typescript v1.4.22] . ### Releases -- [NPM v1.4.22] https://www.npmjs.com/package/@openrouter/sdk/v/1.4.22 - . \ No newline at end of file +- [NPM v1.4.22] https://www.npmjs.com/package/@openrouter/sdk/v/1.4.22 - . + +## 2026-10-06 13:44:28 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.4.23] . +### Releases +- [NPM v1.4.23] https://www.npmjs.com/package/@openrouter/sdk/v/1.4.23 - . \ No newline at end of file diff --git a/docs/models/byokkey.mdx b/docs/models/byokkey.mdx index 92ada1c52..91d707e11 100644 --- a/docs/models/byokkey.mdx +++ b/docs/models/byokkey.mdx @@ -12,6 +12,7 @@ let value: BYOKKey = { allowedModels: null, allowedUserIds: null, createdAt: "2025-08-24T10:30:00Z", + declaredRegion: null, declaredZdr: null, disabled: false, id: "11111111-2222-3333-4444-555555555555", @@ -27,20 +28,21 @@ let value: BYOKKey = { ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `allowedApiKeyHashes` | *string*[] | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. | [
"f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943"
] | -| `allowedModels` | *string*[] | :heavy_check_mark: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | null | -| `allowedUserIds` | *string*[] | :heavy_check_mark: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | null | -| `createdAt` | *string* | :heavy_check_mark: | ISO timestamp of when the credential was created. | 2025-08-24T10:30:00Z | -| `declaredZdr` | *boolean* | :heavy_check_mark: | Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter's data policy for the provider's endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. | null | -| `disabled` | *boolean* | :heavy_check_mark: | Whether this credential is currently disabled. | false | -| `id` | *string* | :heavy_check_mark: | Stable public identifier for this BYOK credential. | 11111111-2222-3333-4444-555555555555 | -| `isByokOnly` | *boolean* | :heavy_check_mark: | Whether OpenRouter's shared endpoints on this provider are removed for every model, including models outside `allowed_models` and after all of your keys for the provider fail. The provider is skipped instead of spending OpenRouter credits. Only valid on non-fallback credentials. | false | -| `isFallback` | *boolean* | :heavy_check_mark: | Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. Cannot be combined with `is_byok_only`. | false | -| `isRequired` | *boolean* | :heavy_check_mark: | Whether OpenRouter's shared endpoints on this provider are removed for the models this credential applies to (its `allowed_models`, or every model when `null`). Requests for those models run only on your keys; models outside the allowlist may still fall back to shared capacity on this provider. | false | -| `label` | *string* | :heavy_check_mark: | Short masked snippet of the key (e.g. the first/last few characters) used to identify it in the UI. | sk-...AbCd | -| `name` | *string* | :heavy_minus_sign: | Optional human-readable name for the credential. | Production OpenAI Key | -| `provider` | [models.BYOKProviderSlug](../models/byokproviderslug.mdx) | :heavy_check_mark: | The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`). | openai | -| `sortOrder` | *number* | :heavy_check_mark: | Position within the provider — credentials are tried in ascending sort order. | 0 | -| `workspaceId` | *string* | :heavy_check_mark: | The workspace this credential is scoped to, or `null` when it is global — usable across every workspace in the account. A `null` value does not mean the default workspace. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allowedApiKeyHashes` | *string*[] | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. | [
"f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943"
] | +| `allowedModels` | *string*[] | :heavy_check_mark: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | null | +| `allowedUserIds` | *string*[] | :heavy_check_mark: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | null | +| `createdAt` | *string* | :heavy_check_mark: | ISO timestamp of when the credential was created. | 2025-08-24T10:30:00Z | +| `declaredRegion` | [models.BYOKKeyDeclaredRegion](../models/byokkeydeclaredregion.mdx) | :heavy_check_mark: | Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. | null | +| `declaredZdr` | *boolean* | :heavy_check_mark: | Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter's data policy for the provider's endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. | null | +| `disabled` | *boolean* | :heavy_check_mark: | Whether this credential is currently disabled. | false | +| `id` | *string* | :heavy_check_mark: | Stable public identifier for this BYOK credential. | 11111111-2222-3333-4444-555555555555 | +| `isByokOnly` | *boolean* | :heavy_check_mark: | Whether OpenRouter's shared endpoints on this provider are removed for every model, including models outside `allowed_models` and after all of your keys for the provider fail. The provider is skipped instead of spending OpenRouter credits. Only valid on non-fallback credentials. | false | +| `isFallback` | *boolean* | :heavy_check_mark: | Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. Cannot be combined with `is_byok_only`. | false | +| `isRequired` | *boolean* | :heavy_check_mark: | Whether OpenRouter's shared endpoints on this provider are removed for the models this credential applies to (its `allowed_models`, or every model when `null`). Requests for those models run only on your keys; models outside the allowlist may still fall back to shared capacity on this provider. | false | +| `label` | *string* | :heavy_check_mark: | Short masked snippet of the key (e.g. the first/last few characters) used to identify it in the UI. | sk-...AbCd | +| `name` | *string* | :heavy_minus_sign: | Optional human-readable name for the credential. | Production OpenAI Key | +| `provider` | [models.BYOKProviderSlug](../models/byokproviderslug.mdx) | :heavy_check_mark: | The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`). | openai | +| `sortOrder` | *number* | :heavy_check_mark: | Position within the provider — credentials are tried in ascending sort order. | 0 | +| `workspaceId` | *string* | :heavy_check_mark: | The workspace this credential is scoped to, or `null` when it is global — usable across every workspace in the account. A `null` value does not mean the default workspace. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/byokkeydeclaredregion.mdx b/docs/models/byokkeydeclaredregion.mdx new file mode 100644 index 000000000..9b4013200 --- /dev/null +++ b/docs/models/byokkeydeclaredregion.mdx @@ -0,0 +1,21 @@ +--- +title: "BYOKKeyDeclaredRegion" +--- + +Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. + +## Example Usage + +```typescript +import { BYOKKeyDeclaredRegion } from "@openrouter/sdk/models"; + +let value: BYOKKeyDeclaredRegion = "global"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"global" | "europe" | "us" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/createbyokkeyrequest.mdx b/docs/models/createbyokkeyrequest.mdx index 4dbe35c5e..41c765f37 100644 --- a/docs/models/createbyokkeyrequest.mdx +++ b/docs/models/createbyokkeyrequest.mdx @@ -15,17 +15,18 @@ let value: CreateBYOKKeyRequest = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `allowedApiKeyHashes` | *string*[] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. Must contain at least one hash if provided. Hashes that do not belong to your account return a 400. | [
"f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943"
] | -| `allowedModels` | *string*[] | :heavy_minus_sign: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | null | -| `allowedUserIds` | *string*[] | :heavy_minus_sign: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | null | -| `declaredZdr` | *boolean* | :heavy_minus_sign: | Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter's data policy for the provider's endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. Defaults to `null`. | null | -| `disabled` | *boolean* | :heavy_minus_sign: | Whether this credential should be created in a disabled state. | false | -| `isByokOnly` | *boolean* | :heavy_minus_sign: | Whether OpenRouter's shared endpoints on this provider are removed for every model, including models outside `allowed_models` and after all of your keys for the provider fail. The provider is skipped instead of spending OpenRouter credits. Only valid on non-fallback credentials. Defaults to `false`. | false | -| `isFallback` | *boolean* | :heavy_minus_sign: | Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. Cannot be combined with `is_byok_only`. | false | -| `isRequired` | *boolean* | :heavy_minus_sign: | Whether OpenRouter's shared endpoints on this provider are removed for the models this credential applies to (its `allowed_models`, or every model when `null`). Requests for those models run only on your keys; models outside the allowlist may still fall back to shared capacity on this provider. Defaults to `false`. | false | -| `key` | *string* | :heavy_check_mark: | The raw provider API key or credential. This value is encrypted at rest and never returned in API responses. | sk-proj-abc123... | -| `name` | *string* | :heavy_minus_sign: | Optional human-readable name for the credential. | Production OpenAI Key | -| `provider` | [models.BYOKProviderSlug](../models/byokproviderslug.mdx) | :heavy_check_mark: | The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`). | openai | -| `workspaceId` | *string* | :heavy_minus_sign: | Optional workspace ID to scope the credential to. When omitted, the credential is created in the account's default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allowedApiKeyHashes` | *string*[] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. Must contain at least one hash if provided. Hashes that do not belong to your account return a 400. | [
"f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943"
] | +| `allowedModels` | *string*[] | :heavy_minus_sign: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | null | +| `allowedUserIds` | *string*[] | :heavy_minus_sign: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | null | +| `declaredRegion` | [models.CreateBYOKKeyRequestDeclaredRegion](../models/createbyokkeyrequestdeclaredregion.mdx) | :heavy_minus_sign: | Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. Defaults to the key's region for OpenAI and Fireworks, otherwise `null`. | null | +| `declaredZdr` | *boolean* | :heavy_minus_sign: | Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter's data policy for the provider's endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. Defaults to `null`. | null | +| `disabled` | *boolean* | :heavy_minus_sign: | Whether this credential should be created in a disabled state. | false | +| `isByokOnly` | *boolean* | :heavy_minus_sign: | Whether OpenRouter's shared endpoints on this provider are removed for every model, including models outside `allowed_models` and after all of your keys for the provider fail. The provider is skipped instead of spending OpenRouter credits. Only valid on non-fallback credentials. Defaults to `false`. | false | +| `isFallback` | *boolean* | :heavy_minus_sign: | Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. Cannot be combined with `is_byok_only`. | false | +| `isRequired` | *boolean* | :heavy_minus_sign: | Whether OpenRouter's shared endpoints on this provider are removed for the models this credential applies to (its `allowed_models`, or every model when `null`). Requests for those models run only on your keys; models outside the allowlist may still fall back to shared capacity on this provider. Defaults to `false`. | false | +| `key` | *string* | :heavy_check_mark: | The raw provider API key or credential. This value is encrypted at rest and never returned in API responses. | sk-proj-abc123... | +| `name` | *string* | :heavy_minus_sign: | Optional human-readable name for the credential. | Production OpenAI Key | +| `provider` | [models.BYOKProviderSlug](../models/byokproviderslug.mdx) | :heavy_check_mark: | The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`). | openai | +| `workspaceId` | *string* | :heavy_minus_sign: | Optional workspace ID to scope the credential to. When omitted, the credential is created in the account's default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/createbyokkeyrequestdeclaredregion.mdx b/docs/models/createbyokkeyrequestdeclaredregion.mdx new file mode 100644 index 000000000..f899bc70f --- /dev/null +++ b/docs/models/createbyokkeyrequestdeclaredregion.mdx @@ -0,0 +1,21 @@ +--- +title: "CreateBYOKKeyRequestDeclaredRegion" +--- + +Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. Defaults to the key's region for OpenAI and Fireworks, otherwise `null`. + +## Example Usage + +```typescript +import { CreateBYOKKeyRequestDeclaredRegion } from "@openrouter/sdk/models"; + +let value: CreateBYOKKeyRequestDeclaredRegion = "europe"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"global" | "europe" | "us" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/createbyokkeyresponse.mdx b/docs/models/createbyokkeyresponse.mdx index b9f409dc4..85ff57c5c 100644 --- a/docs/models/createbyokkeyresponse.mdx +++ b/docs/models/createbyokkeyresponse.mdx @@ -13,6 +13,7 @@ let value: CreateBYOKKeyResponse = { allowedModels: null, allowedUserIds: null, createdAt: "2025-08-24T10:30:00Z", + declaredRegion: null, declaredZdr: null, disabled: false, id: "11111111-2222-3333-4444-555555555555", @@ -29,6 +30,6 @@ let value: CreateBYOKKeyResponse = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [models.BYOKKey](../models/byokkey.mdx) | :heavy_check_mark: | N/A | \{
"allowed_api_key_hashes": null,
"allowed_models": null,
"allowed_user_ids": null,
"created_at": "2025-08-24T10:30:00Z",
"declared_zdr": null,
"disabled": false,
"id": "11111111-2222-3333-4444-555555555555",
"is_byok_only": false,
"is_fallback": false,
"is_required": false,
"label": "sk-...AbCd",
"name": "Production OpenAI Key",
"provider": "openai",
"sort_order": 0,
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [models.BYOKKey](../models/byokkey.mdx) | :heavy_check_mark: | N/A | \{
"allowed_api_key_hashes": null,
"allowed_models": null,
"allowed_user_ids": null,
"created_at": "2025-08-24T10:30:00Z",
"declared_region": null,
"declared_zdr": null,
"disabled": false,
"id": "11111111-2222-3333-4444-555555555555",
"is_byok_only": false,
"is_fallback": false,
"is_required": false,
"label": "sk-...AbCd",
"name": "Production OpenAI Key",
"provider": "openai",
"sort_order": 0,
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file diff --git a/docs/models/getbyokkeyresponse.mdx b/docs/models/getbyokkeyresponse.mdx index 89c8121fd..4d8ee1a6d 100644 --- a/docs/models/getbyokkeyresponse.mdx +++ b/docs/models/getbyokkeyresponse.mdx @@ -13,6 +13,7 @@ let value: GetBYOKKeyResponse = { allowedModels: null, allowedUserIds: null, createdAt: "2025-08-24T10:30:00Z", + declaredRegion: null, declaredZdr: null, disabled: false, id: "11111111-2222-3333-4444-555555555555", @@ -29,6 +30,6 @@ let value: GetBYOKKeyResponse = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [models.BYOKKey](../models/byokkey.mdx) | :heavy_check_mark: | N/A | \{
"allowed_api_key_hashes": null,
"allowed_models": null,
"allowed_user_ids": null,
"created_at": "2025-08-24T10:30:00Z",
"declared_zdr": null,
"disabled": false,
"id": "11111111-2222-3333-4444-555555555555",
"is_byok_only": false,
"is_fallback": false,
"is_required": false,
"label": "sk-...AbCd",
"name": "Production OpenAI Key",
"provider": "openai",
"sort_order": 0,
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [models.BYOKKey](../models/byokkey.mdx) | :heavy_check_mark: | N/A | \{
"allowed_api_key_hashes": null,
"allowed_models": null,
"allowed_user_ids": null,
"created_at": "2025-08-24T10:30:00Z",
"declared_region": null,
"declared_zdr": null,
"disabled": false,
"id": "11111111-2222-3333-4444-555555555555",
"is_byok_only": false,
"is_fallback": false,
"is_required": false,
"label": "sk-...AbCd",
"name": "Production OpenAI Key",
"provider": "openai",
"sort_order": 0,
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file diff --git a/docs/models/listbyokkeysresponse.mdx b/docs/models/listbyokkeysresponse.mdx index 72a5a4e7e..20c6333d2 100644 --- a/docs/models/listbyokkeysresponse.mdx +++ b/docs/models/listbyokkeysresponse.mdx @@ -14,6 +14,7 @@ let value: ListBYOKKeysResponse = { allowedModels: null, allowedUserIds: null, createdAt: "2025-08-24T10:30:00Z", + declaredRegion: null, declaredZdr: null, disabled: false, id: "11111111-2222-3333-4444-555555555555", diff --git a/docs/models/operations/listbyokkeysresponse.mdx b/docs/models/operations/listbyokkeysresponse.mdx index 500b32dcd..e080c0fc5 100644 --- a/docs/models/operations/listbyokkeysresponse.mdx +++ b/docs/models/operations/listbyokkeysresponse.mdx @@ -15,6 +15,7 @@ let value: ListBYOKKeysResponse = { allowedModels: null, allowedUserIds: null, createdAt: "2025-08-24T10:30:00Z", + declaredRegion: null, declaredZdr: null, disabled: false, id: "11111111-2222-3333-4444-555555555555", @@ -34,6 +35,6 @@ let value: ListBYOKKeysResponse = { ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `result` | [models.ListBYOKKeysResponse](../../models/listbyokkeysresponse.mdx) | :heavy_check_mark: | N/A | \{
"data": [
\{
"allowed_api_key_hashes": null,
"allowed_models": null,
"allowed_user_ids": null,
"created_at": "2025-08-24T10:30:00Z",
"declared_zdr": null,
"disabled": false,
"id": "11111111-2222-3333-4444-555555555555",
"is_byok_only": false,
"is_fallback": false,
"is_required": false,
"label": "sk-...AbCd",
"name": "Production OpenAI Key",
"provider": "openai",
"sort_order": 0,
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"total_count": 1
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `result` | [models.ListBYOKKeysResponse](../../models/listbyokkeysresponse.mdx) | :heavy_check_mark: | N/A | \{
"data": [
\{
"allowed_api_key_hashes": null,
"allowed_models": null,
"allowed_user_ids": null,
"created_at": "2025-08-24T10:30:00Z",
"declared_region": null,
"declared_zdr": null,
"disabled": false,
"id": "11111111-2222-3333-4444-555555555555",
"is_byok_only": false,
"is_fallback": false,
"is_required": false,
"label": "sk-...AbCd",
"name": "Production OpenAI Key",
"provider": "openai",
"sort_order": 0,
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"total_count": 1
} | \ No newline at end of file diff --git a/docs/models/updatebyokkeyrequest.mdx b/docs/models/updatebyokkeyrequest.mdx index 3c9a42729..aef70f642 100644 --- a/docs/models/updatebyokkeyrequest.mdx +++ b/docs/models/updatebyokkeyrequest.mdx @@ -12,15 +12,16 @@ let value: UpdateBYOKKeyRequest = {}; ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `allowedApiKeyHashes` | *string*[] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` clears the restriction. Must contain at least one hash if provided. Hashes that do not belong to your account return a 400. | [
"f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943"
] | -| `allowedModels` | *string*[] | :heavy_minus_sign: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | null | -| `allowedUserIds` | *string*[] | :heavy_minus_sign: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | null | -| `declaredZdr` | *boolean* | :heavy_minus_sign: | Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter's data policy for the provider's endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. Omit to leave the stored value unchanged; `null` clears the declaration. | null | -| `disabled` | *boolean* | :heavy_minus_sign: | Whether this credential is disabled. | false | -| `isByokOnly` | *boolean* | :heavy_minus_sign: | Whether OpenRouter's shared endpoints on this provider are removed for every model, including models outside `allowed_models` and after all of your keys for the provider fail. The provider is skipped instead of spending OpenRouter credits. Only valid on non-fallback credentials. Omit to leave the stored value unchanged. | false | -| `isFallback` | *boolean* | :heavy_minus_sign: | Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. Cannot be combined with `is_byok_only`. Omit to leave the stored value unchanged. | false | -| `isRequired` | *boolean* | :heavy_minus_sign: | Whether OpenRouter's shared endpoints on this provider are removed for the models this credential applies to (its `allowed_models`, or every model when `null`). Requests for those models run only on your keys; models outside the allowlist may still fall back to shared capacity on this provider. Omit to leave the stored value unchanged. | false | -| `key` | *string* | :heavy_minus_sign: | A new raw provider API key to rotate the credential in-place. The previous key material is overwritten and the masked label is regenerated. Encrypted at rest and never returned in API responses. | sk-proj-newkey456... | -| `name` | *string* | :heavy_minus_sign: | Optional human-readable name for the credential. | Updated OpenAI Key | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allowedApiKeyHashes` | *string*[] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` clears the restriction. Must contain at least one hash if provided. Hashes that do not belong to your account return a 400. | [
"f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943"
] | +| `allowedModels` | *string*[] | :heavy_minus_sign: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | null | +| `allowedUserIds` | *string*[] | :heavy_minus_sign: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | null | +| `declaredRegion` | [models.UpdateBYOKKeyRequestDeclaredRegion](../models/updatebyokkeyrequestdeclaredregion.mdx) | :heavy_minus_sign: | Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. Omit to leave the stored value unchanged (rotating an OpenAI or Fireworks `key` re-derives it from the new key); `null` clears the declaration. | null | +| `declaredZdr` | *boolean* | :heavy_minus_sign: | Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter's data policy for the provider's endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. Omit to leave the stored value unchanged; `null` clears the declaration. | null | +| `disabled` | *boolean* | :heavy_minus_sign: | Whether this credential is disabled. | false | +| `isByokOnly` | *boolean* | :heavy_minus_sign: | Whether OpenRouter's shared endpoints on this provider are removed for every model, including models outside `allowed_models` and after all of your keys for the provider fail. The provider is skipped instead of spending OpenRouter credits. Only valid on non-fallback credentials. Omit to leave the stored value unchanged. | false | +| `isFallback` | *boolean* | :heavy_minus_sign: | Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. Cannot be combined with `is_byok_only`. Omit to leave the stored value unchanged. | false | +| `isRequired` | *boolean* | :heavy_minus_sign: | Whether OpenRouter's shared endpoints on this provider are removed for the models this credential applies to (its `allowed_models`, or every model when `null`). Requests for those models run only on your keys; models outside the allowlist may still fall back to shared capacity on this provider. Omit to leave the stored value unchanged. | false | +| `key` | *string* | :heavy_minus_sign: | A new raw provider API key to rotate the credential in-place. The previous key material is overwritten and the masked label is regenerated. Encrypted at rest and never returned in API responses. | sk-proj-newkey456... | +| `name` | *string* | :heavy_minus_sign: | Optional human-readable name for the credential. | Updated OpenAI Key | \ No newline at end of file diff --git a/docs/models/updatebyokkeyrequestdeclaredregion.mdx b/docs/models/updatebyokkeyrequestdeclaredregion.mdx new file mode 100644 index 000000000..42914163b --- /dev/null +++ b/docs/models/updatebyokkeyrequestdeclaredregion.mdx @@ -0,0 +1,21 @@ +--- +title: "UpdateBYOKKeyRequestDeclaredRegion" +--- + +Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. Omit to leave the stored value unchanged (rotating an OpenAI or Fireworks `key` re-derives it from the new key); `null` clears the declaration. + +## Example Usage + +```typescript +import { UpdateBYOKKeyRequestDeclaredRegion } from "@openrouter/sdk/models"; + +let value: UpdateBYOKKeyRequestDeclaredRegion = "global"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"global" | "europe" | "us" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/updatebyokkeyresponse.mdx b/docs/models/updatebyokkeyresponse.mdx index df6661a26..f64cea097 100644 --- a/docs/models/updatebyokkeyresponse.mdx +++ b/docs/models/updatebyokkeyresponse.mdx @@ -13,6 +13,7 @@ let value: UpdateBYOKKeyResponse = { allowedModels: null, allowedUserIds: null, createdAt: "2025-08-24T10:30:00Z", + declaredRegion: null, declaredZdr: null, disabled: false, id: "11111111-2222-3333-4444-555555555555", @@ -29,6 +30,6 @@ let value: UpdateBYOKKeyResponse = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [models.BYOKKey](../models/byokkey.mdx) | :heavy_check_mark: | N/A | \{
"allowed_api_key_hashes": null,
"allowed_models": null,
"allowed_user_ids": null,
"created_at": "2025-08-24T10:30:00Z",
"declared_zdr": null,
"disabled": false,
"id": "11111111-2222-3333-4444-555555555555",
"is_byok_only": false,
"is_fallback": false,
"is_required": false,
"label": "sk-...AbCd",
"name": "Production OpenAI Key",
"provider": "openai",
"sort_order": 0,
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [models.BYOKKey](../models/byokkey.mdx) | :heavy_check_mark: | N/A | \{
"allowed_api_key_hashes": null,
"allowed_models": null,
"allowed_user_ids": null,
"created_at": "2025-08-24T10:30:00Z",
"declared_region": null,
"declared_zdr": null,
"disabled": false,
"id": "11111111-2222-3333-4444-555555555555",
"is_byok_only": false,
"is_fallback": false,
"is_required": false,
"label": "sk-...AbCd",
"name": "Production OpenAI Key",
"provider": "openai",
"sort_order": 0,
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file diff --git a/docs/sdks/byok/README.mdx b/docs/sdks/byok/README.mdx index 528c0f071..92595fd27 100644 --- a/docs/sdks/byok/README.mdx +++ b/docs/sdks/byok/README.mdx @@ -436,5 +436,6 @@ run(); | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | +| errors.ConflictResponseError | 409 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/jsr.json b/jsr.json index 8179d16f8..1c0232dad 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "1.4.22", + "version": "1.4.23", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 327c3e678..ee656b968 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "1.4.22", + "version": "1.4.23", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.", "keywords": [ @@ -73,14 +73,14 @@ "lint": "eslint --cache --max-warnings=0 src", "build": "tsc && node scripts/unbarrel-imports.js", "prepublishOnly": "npm run build", + "test:e2e": "vitest --run --project e2e", + "typecheck:transit": "exit 0", + "postinstall": "node scripts/check-types.js || true", "test": "vitest --run --project unit", "test:transit": "exit 0", + "test:watch": "vitest --watch --project unit", "typecheck": "tsc --noEmit", - "typecheck:transit": "exit 0", "compile": "tsc && node scripts/unbarrel-imports.js", - "test:e2e": "vitest --run --project e2e", - "test:watch": "vitest --watch --project unit", - "postinstall": "node scripts/check-types.js || true", "prepare": "npm run build" }, "peerDependencies": { diff --git a/src/funcs/byokUpdate.ts b/src/funcs/byokUpdate.ts index 3741c42ba..afeb01b71 100644 --- a/src/funcs/byokUpdate.ts +++ b/src/funcs/byokUpdate.ts @@ -45,6 +45,7 @@ export function byokUpdate( | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError + | errors.ConflictResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError @@ -75,6 +76,7 @@ async function $do( | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError + | errors.ConflictResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError @@ -195,6 +197,7 @@ async function $do( | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError + | errors.ConflictResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError @@ -210,6 +213,7 @@ async function $do( M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(409, errors.ConflictResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"), diff --git a/src/lib/config.ts b/src/lib/config.ts index 76512647c..3cae91aca 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -79,7 +79,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "1.4.22", + sdkVersion: "1.4.23", genVersion: "2.914.0", - userAgent: "speakeasy-sdk/typescript 1.4.22 2.914.0 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 1.4.23 2.914.0 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/byokkey.ts b/src/models/byokkey.ts index d5f3e94c8..2dbfeedae 100644 --- a/src/models/byokkey.ts +++ b/src/models/byokkey.ts @@ -6,6 +6,8 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../lib/primitives.js"; import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { BYOKProviderSlug, @@ -13,6 +15,19 @@ import { } from "./byokproviderslug.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +/** + * Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. + */ +export const BYOKKeyDeclaredRegion = { + Global: "global", + Europe: "europe", + Us: "us", +} as const; +/** + * Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. + */ +export type BYOKKeyDeclaredRegion = OpenEnum; + export type BYOKKey = { /** * Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. @@ -30,6 +45,10 @@ export type BYOKKey = { * ISO timestamp of when the credential was created. */ createdAt: string; + /** + * Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. + */ + declaredRegion: BYOKKeyDeclaredRegion | null; /** * Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter's data policy for the provider's endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. */ @@ -76,12 +95,19 @@ export type BYOKKey = { workspaceId: string | null; }; +/** @internal */ +export const BYOKKeyDeclaredRegion$inboundSchema: z.ZodType< + BYOKKeyDeclaredRegion, + unknown +> = openEnums.inboundSchema(BYOKKeyDeclaredRegion); + /** @internal */ export const BYOKKey$inboundSchema: z.ZodType = z.object({ allowed_api_key_hashes: z.nullable(z.array(z.string())), allowed_models: z.nullable(z.array(z.string())), allowed_user_ids: z.nullable(z.array(z.string())), created_at: z.string(), + declared_region: z.nullable(BYOKKeyDeclaredRegion$inboundSchema), declared_zdr: z.nullable(z.boolean()), disabled: z.boolean(), id: z.string(), @@ -99,6 +125,7 @@ export const BYOKKey$inboundSchema: z.ZodType = z.object({ "allowed_models": "allowedModels", "allowed_user_ids": "allowedUserIds", "created_at": "createdAt", + "declared_region": "declaredRegion", "declared_zdr": "declaredZdr", "is_byok_only": "isByokOnly", "is_fallback": "isFallback", diff --git a/src/models/createbyokkeyrequest.ts b/src/models/createbyokkeyrequest.ts index 4d5c3297d..c292d8fe2 100644 --- a/src/models/createbyokkeyrequest.ts +++ b/src/models/createbyokkeyrequest.ts @@ -5,11 +5,28 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../lib/primitives.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; import { BYOKProviderSlug, BYOKProviderSlug$outboundSchema, } from "./byokproviderslug.js"; +/** + * Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. Defaults to the key's region for OpenAI and Fireworks, otherwise `null`. + */ +export const CreateBYOKKeyRequestDeclaredRegion = { + Global: "global", + Europe: "europe", + Us: "us", +} as const; +/** + * Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. Defaults to the key's region for OpenAI and Fireworks, otherwise `null`. + */ +export type CreateBYOKKeyRequestDeclaredRegion = OpenEnum< + typeof CreateBYOKKeyRequestDeclaredRegion +>; + export type CreateBYOKKeyRequest = { /** * Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. Must contain at least one hash if provided. Hashes that do not belong to your account return a 400. @@ -23,6 +40,10 @@ export type CreateBYOKKeyRequest = { * Optional allowlist of user IDs that may use this credential. `null` means no restriction. */ allowedUserIds?: Array | null | undefined; + /** + * Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. Defaults to the key's region for OpenAI and Fireworks, otherwise `null`. + */ + declaredRegion?: CreateBYOKKeyRequestDeclaredRegion | null | undefined; /** * Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter's data policy for the provider's endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. Defaults to `null`. */ @@ -61,11 +82,18 @@ export type CreateBYOKKeyRequest = { workspaceId?: string | undefined; }; +/** @internal */ +export const CreateBYOKKeyRequestDeclaredRegion$outboundSchema: z.ZodType< + string, + CreateBYOKKeyRequestDeclaredRegion +> = openEnums.outboundSchema(CreateBYOKKeyRequestDeclaredRegion); + /** @internal */ export type CreateBYOKKeyRequest$Outbound = { allowed_api_key_hashes?: Array | null | undefined; allowed_models?: Array | null | undefined; allowed_user_ids?: Array | null | undefined; + declared_region?: string | null | undefined; declared_zdr?: boolean | null | undefined; disabled?: boolean | undefined; is_byok_only?: boolean | undefined; @@ -85,6 +113,8 @@ export const CreateBYOKKeyRequest$outboundSchema: z.ZodType< allowedApiKeyHashes: z.nullable(z.array(z.string())).optional(), allowedModels: z.nullable(z.array(z.string())).optional(), allowedUserIds: z.nullable(z.array(z.string())).optional(), + declaredRegion: z.nullable(CreateBYOKKeyRequestDeclaredRegion$outboundSchema) + .optional(), declaredZdr: z.nullable(z.boolean()).optional(), disabled: z.boolean().optional(), isByokOnly: z.boolean().optional(), @@ -99,6 +129,7 @@ export const CreateBYOKKeyRequest$outboundSchema: z.ZodType< allowedApiKeyHashes: "allowed_api_key_hashes", allowedModels: "allowed_models", allowedUserIds: "allowed_user_ids", + declaredRegion: "declared_region", declaredZdr: "declared_zdr", isByokOnly: "is_byok_only", isFallback: "is_fallback", diff --git a/src/models/updatebyokkeyrequest.ts b/src/models/updatebyokkeyrequest.ts index 3fb21e92a..913b20350 100644 --- a/src/models/updatebyokkeyrequest.ts +++ b/src/models/updatebyokkeyrequest.ts @@ -5,6 +5,23 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../lib/primitives.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; + +/** + * Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. Omit to leave the stored value unchanged (rotating an OpenAI or Fireworks `key` re-derives it from the new key); `null` clears the declaration. + */ +export const UpdateBYOKKeyRequestDeclaredRegion = { + Global: "global", + Europe: "europe", + Us: "us", +} as const; +/** + * Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. Omit to leave the stored value unchanged (rotating an OpenAI or Fireworks `key` re-derives it from the new key); `null` clears the declaration. + */ +export type UpdateBYOKKeyRequestDeclaredRegion = OpenEnum< + typeof UpdateBYOKKeyRequestDeclaredRegion +>; export type UpdateBYOKKeyRequest = { /** @@ -19,6 +36,10 @@ export type UpdateBYOKKeyRequest = { * Optional allowlist of user IDs that may use this credential. `null` means no restriction. */ allowedUserIds?: Array | null | undefined; + /** + * Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. Omit to leave the stored value unchanged (rotating an OpenAI or Fireworks `key` re-derives it from the new key); `null` clears the declaration. + */ + declaredRegion?: UpdateBYOKKeyRequestDeclaredRegion | null | undefined; /** * Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter's data policy for the provider's endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. Omit to leave the stored value unchanged; `null` clears the declaration. */ @@ -49,11 +70,18 @@ export type UpdateBYOKKeyRequest = { name?: string | null | undefined; }; +/** @internal */ +export const UpdateBYOKKeyRequestDeclaredRegion$outboundSchema: z.ZodType< + string, + UpdateBYOKKeyRequestDeclaredRegion +> = openEnums.outboundSchema(UpdateBYOKKeyRequestDeclaredRegion); + /** @internal */ export type UpdateBYOKKeyRequest$Outbound = { allowed_api_key_hashes?: Array | null | undefined; allowed_models?: Array | null | undefined; allowed_user_ids?: Array | null | undefined; + declared_region?: string | null | undefined; declared_zdr?: boolean | null | undefined; disabled?: boolean | undefined; is_byok_only?: boolean | undefined; @@ -71,6 +99,8 @@ export const UpdateBYOKKeyRequest$outboundSchema: z.ZodType< allowedApiKeyHashes: z.nullable(z.array(z.string())).optional(), allowedModels: z.nullable(z.array(z.string())).optional(), allowedUserIds: z.nullable(z.array(z.string())).optional(), + declaredRegion: z.nullable(UpdateBYOKKeyRequestDeclaredRegion$outboundSchema) + .optional(), declaredZdr: z.nullable(z.boolean()).optional(), disabled: z.boolean().optional(), isByokOnly: z.boolean().optional(), @@ -83,6 +113,7 @@ export const UpdateBYOKKeyRequest$outboundSchema: z.ZodType< allowedApiKeyHashes: "allowed_api_key_hashes", allowedModels: "allowed_models", allowedUserIds: "allowed_user_ids", + declaredRegion: "declared_region", declaredZdr: "declared_zdr", isByokOnly: "is_byok_only", isFallback: "is_fallback",