From 492ead0bf56410d89960dd97d6281d045b3e3253 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 20 Nov 2026 21:29:48 +0000 Subject: [PATCH 1/2] ## Python SDK Changes: * `open_router.workspaces.list()`: `response.data[]` **Changed** * `open_router.workspaces.create()`: `response.data` **Changed** * `open_router.workspaces.get()`: `response.data` **Changed** * `open_router.workspaces.update()`: `response.data` **Changed** --- .speakeasy/gen.lock | 58 +++++++------- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 23 ++---- .speakeasy/workflow.lock | 10 +-- RELEASES.md | 12 ++- docs/components/workspace.mdx | 43 ++++++----- docs/sdks/analytics/README.mdx | 6 +- docs/sdks/observability/README.mdx | 4 +- pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- src/openrouter/analytics.py | 12 +-- src/openrouter/components/workspace.py | 103 ++++++++++++++----------- src/openrouter/observability.py | 8 +- uv.lock | 2 +- 14 files changed, 159 insertions(+), 130 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index fac619863..0b69dc2b8 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: c48cf606-fb42-4a45-9c23-8f0555307828 management: - docChecksum: c7980db041cd6cc99585fd8fa6966f0f + docChecksum: b8c8a75d05ef165f66db34adf0d2c51d docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.200 - configChecksum: 3b2c9a89cc06e5668402f2fad7f67b13 + releaseVersion: 1.3.201 + configChecksum: 1f2949c19cbea84b7386403957f03d8c repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 7e0a78f3-eb3b-4eee-889d-ceb82110a8f8 - pristine_commit_hash: bbf0320d2fe378cdb5ebd230404ceacf92300bc1 - pristine_tree_hash: 3678c7bbe359d009c90b9b182b06bb42ba8a0c78 + generation_id: c7a4cd8a-0a29-4a0f-954f-c69001f99e9a + pristine_commit_hash: cf09882af9ee31c2791d8bf353a8f1ebf426e591 + pristine_tree_hash: 2b61dc5db96d20655d6d41c8aa0ae0c259164b25 features: python: acceptHeaders: 3.0.0 @@ -9512,8 +9512,8 @@ trackedFiles: pristine_git_object: e8a689098106c445424b89fe5baa348824f3a36c docs/components/workspace.mdx: id: eea9c32d09c4 - last_write_checksum: sha1:f8518fa23ec7a3b2936d113271ba96a1fa7988ec - pristine_git_object: adcd22757b7f1aba9c11c22b1e83d58eb627238f + last_write_checksum: sha1:af7e7116a1e70ccce93248879cbe5f029123eed1 + pristine_git_object: d38ee1f9e4e3ce3ff2ed0ec18130a44990885b1b docs/components/workspacebudget.mdx: id: e941741a8d84 last_write_checksum: sha1:c56f3e4d84597ef60ffb3ba9448a9ef3ddd98000 @@ -11668,8 +11668,8 @@ trackedFiles: pristine_git_object: f265978fdb338b412232349476bf1e874833c9f8 docs/sdks/analytics/README.mdx: id: 281aa5320be1 - last_write_checksum: sha1:2ea65c7e61be83a351492690003bdd34889a5640 - pristine_git_object: ccdae17cd63930fb0d65fe1171735373c233e38b + last_write_checksum: sha1:8c7fb2c41e1f4b0b2362093993c2b34d3591af9f + pristine_git_object: 9ceefae52e37d6cb260a03a930bfd3b39806e8b3 docs/sdks/apikeys/README.mdx: id: 27fcaae1c346 last_write_checksum: sha1:a27e7a3f00c9e51019301f4c67099aa8dd1cf397 @@ -11760,8 +11760,8 @@ trackedFiles: pristine_git_object: 4c98afd747c56ba3e179a1edc6ffb057e15c5e86 docs/sdks/observability/README.mdx: id: 75811527e651 - last_write_checksum: sha1:b01bb09b9ef3543335bc1da6078de84ceaba3c14 - pristine_git_object: 608b9a7a848c876af4705eab18e1e84a4a34af68 + last_write_checksum: sha1:20706006ff02d67e840cd1355b1dc50436d750c1 + pristine_git_object: cecaa8a895d60adfa2d97f9a78efe76825c82b92 docs/sdks/organization/README.mdx: id: f41b85542db0 last_write_checksum: sha1:d725f284dbc94679015993513869cee9b25fc379 @@ -11828,8 +11828,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:8dfa9faf6ebd894e5829f9c61cb2dbebb4da4da1 - pristine_git_object: c2e02240172b00acaa3b1e13a586d801263d4b65 + last_write_checksum: sha1:576cb4920986226e3cfbd4c6ab7967cde4f70c53 + pristine_git_object: 92812803a2ed544137b749cfd92056867facb7e3 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -11856,16 +11856,16 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:7112e66a38288302ad0afb0ed30f257706596e42 - pristine_git_object: a73f913bf586d8898d2b4ac547decb6e38bbeb7a + last_write_checksum: sha1:bec638bd53d093932603eb1da5477e152b36beb9 + pristine_git_object: 162c544f558433deb5f9496be513ef19608a9da1 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766 pristine_git_object: f512ec0a9dab3feb43c9add635c0a926b7728b2d src/openrouter/analytics.py: id: cb406b5aaabb - last_write_checksum: sha1:283a50def426154cefd2d55de78c83f5e7073569 - pristine_git_object: 6dc3ecedfec396bd5a0f46c89178563f84c72dd7 + last_write_checksum: sha1:3cd5d09e2d15f1e79c249d4964d056fb85bbf612 + pristine_git_object: 6a8e172e48aa655bd57615b4110f285ab02a7368 src/openrouter/api_keys.py: id: 876fac88fff6 last_write_checksum: sha1:4956d622986029e5f89f8a47b6b1980ff34b28d7 @@ -15780,8 +15780,8 @@ trackedFiles: pristine_git_object: fda00ebca117e6d3accc21c5252351f77cf34692 src/openrouter/components/workspace.py: id: 682282304bd8 - last_write_checksum: sha1:947e861015caddaf1dec255e9facd1f9860a2d3f - pristine_git_object: 874f99775f6348b5ad8ec15c928476f4ab88c762 + last_write_checksum: sha1:12e5dcd165a034a312ef7b0db75ff5a387db3db0 + pristine_git_object: fef9bdf20652a4e838d784566b2750d90728b03e src/openrouter/components/workspacebudget.py: id: f80c6983502a last_write_checksum: sha1:ca8d505bdf65833e83455a175052e86fd89b3a2c @@ -15992,8 +15992,8 @@ trackedFiles: pristine_git_object: 0699194f7951fb1f4b3dbb79f1935b5a7e44c388 src/openrouter/observability.py: id: 6a17f32d3f33 - last_write_checksum: sha1:9d7a47a0ac91ad487db2e304adf0f5b55bfded69 - pristine_git_object: dd8a6eccda3fb29e478c0edef674bd491a1dad24 + last_write_checksum: sha1:fc64b05526b496abab87831f3dd90e110c7abb94 + pristine_git_object: 039fd484b407d7ca13177a892db5939b312ee50d src/openrouter/operations/__init__.py: id: 9afcea1e7161 last_write_checksum: sha1:7c25d7304f0298876943ea893583c17e1ae537d1 @@ -18196,7 +18196,7 @@ examples: limit: 50 responses: "200": - application/json: {"data": [{"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_guardrail_id": "595d5849-7e86-51fd-a7c0-705c34e4afff", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "io_logging_api_key_ids": null, "io_logging_sampling_rate": 1, "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": "2025-08-24T15:45:00Z"}], "total_count": 1} + application/json: {"data": [{"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_guardrail_id": "595d5849-7e86-51fd-a7c0-705c34e4afff", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Production", "slug": "production", "updated_at": "2025-08-24T15:45:00Z"}], "total_count": 1} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "500": @@ -18209,7 +18209,7 @@ examples: application/json: {"name": "Production", "slug": "production"} responses: "201": - application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_guardrail_id": "595d5849-7e86-51fd-a7c0-705c34e4afff", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "io_logging_api_key_ids": null, "io_logging_sampling_rate": 1, "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": null}} + application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_guardrail_id": "595d5849-7e86-51fd-a7c0-705c34e4afff", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Production", "slug": "production", "updated_at": null}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -18243,7 +18243,7 @@ examples: id: "production" responses: "200": - application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_guardrail_id": "595d5849-7e86-51fd-a7c0-705c34e4afff", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "io_logging_api_key_ids": null, "io_logging_sampling_rate": 1, "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": "2025-08-24T15:45:00Z"}} + application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_guardrail_id": "595d5849-7e86-51fd-a7c0-705c34e4afff", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Production", "slug": "production", "updated_at": "2025-08-24T15:45:00Z"}} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "404": @@ -18261,7 +18261,7 @@ examples: application/json: {} responses: "200": - application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_guardrail_id": "595d5849-7e86-51fd-a7c0-705c34e4afff", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "io_logging_api_key_ids": null, "io_logging_sampling_rate": 1, "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Updated Workspace", "slug": "updated-workspace", "updated_at": "2025-08-25T10:00:00Z"}} + application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_guardrail_id": "595d5849-7e86-51fd-a7c0-705c34e4afff", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Updated Workspace", "slug": "updated-workspace", "updated_at": "2025-08-25T10:00:00Z"}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -21959,3 +21959,9 @@ examples: "503": application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} examplesVersion: 1.0.2 +releaseNotes: | + ## Python SDK Changes: + * `open_router.workspaces.list()`: `response.data[]` **Changed** + * `open_router.workspaces.create()`: `response.data` **Changed** + * `open_router.workspaces.get()`: `response.data` **Changed** + * `open_router.workspaces.update()`: `response.data` **Changed** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index f3f5149dc..3626f2536 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.200 + version: 1.3.201 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index e7155a5ef..b6cbc1b9f 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -40216,6 +40216,7 @@ components: type: 'string' type: 'object' Workspace: + description: 'Workspace metadata. Configuration fields are omitted without permission to view workspace settings.' example: created_at: '2025-08-24T10:30:00Z' created_by: 'user_abc123' @@ -40289,11 +40290,11 @@ components: format: 'uuid' type: 'string' include_byok_in_budgets: - description: 'Whether BYOK (bring-your-own-key) spend counts toward this workspace''s budgets. Set it via the workspace budget endpoints.' + description: 'Whether BYOK (bring-your-own-key) spend counts toward this workspace''s budgets. Omitted without settings and budget visibility. Set it via the workspace budget endpoints.' example: false type: 'boolean' io_logging_api_key_ids: - description: 'Optional array of API key IDs to filter I/O logging. Null means all keys are logged.' + description: 'API key IDs used to filter I/O logging. Null means all keys are logged. Omitted without access to workspace settings and API key identifiers.' example: null items: type: 'integer' @@ -40337,14 +40338,6 @@ components: - 'name' - 'slug' - 'description' - - 'default_text_model' - - 'default_image_model' - - 'default_provider_sort' - - 'is_observability_io_logging_enabled' - - 'is_observability_broadcast_enabled' - - 'is_data_discount_logging_enabled' - - 'io_logging_sampling_rate' - - 'io_logging_api_key_ids' - 'created_at' - 'updated_at' - 'created_by' @@ -40522,7 +40515,7 @@ openapi: '3.1.0' paths: /activity: get: - description: 'Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). [Management key](/docs/guides/overview/auth/management-api-keys) required.' + description: 'Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). For Custom keys, `api_key_hash` also requires `api_keys:view_all` and does not resolve deleted keys. `user_id` also requires `workspace_members:view` on an explicit non-default workspace; organization and default-workspace member filtering requires `org_members:view`, which is not available as a Custom grant. [Management key](/docs/guides/overview/auth/management-api-keys) required.' operationId: 'getUserActivity' parameters: - description: 'Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).' @@ -40648,7 +40641,7 @@ paths: - $ref: "#/components/parameters/AppCategories" /analytics/meta: get: - description: 'Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Workspace-scoped management keys are accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + description: 'Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Custom access requires an organization-scoped key with `analytics:view`. Workspace-scoped keys with base Read Only or Read Write access are also accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required.' operationId: 'getAnalyticsMeta' responses: '200': @@ -40798,7 +40791,7 @@ paths: - $ref: "#/components/parameters/AppCategories" /analytics/query: post: - description: 'Execute an analytics query with specified metrics, dimensions, filters, and time range. A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: it is refused a `workspace` filter naming another workspace, it excludes legacy rows with no workspace (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + description: 'Execute an analytics query with specified metrics, dimensions, filters, and time range. Custom access requires an organization-scoped key with `analytics:view`; grouping or filtering by `api_key_id` or `api_key_tag` also requires `api_keys:view_all`, and by `user` requires `org_members:view`. Key hash filters resolve only non-deleted ordinary keys. Workspace-scoped keys with base Read Only or Read Write access can query only their own workspace: a `workspace` filter naming another workspace is refused, legacy rows with no workspace are excluded (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required.' operationId: 'queryAnalytics' requestBody: content: @@ -54946,7 +54939,7 @@ paths: results: '$.data' type: 'offsetLimit' post: - description: 'Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity''s default workspace, or a workspace-scoped management key''s own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + description: 'Create a new observability destination. A maximum of 5 enabled destinations per workspace, across all types, is allowed; disabled destinations do not count. A workspace already above the cap keeps its enabled destinations but cannot create or enable more until fewer than 5 are enabled. Defaults to the authenticated entity''s default workspace, or a workspace-scoped management key''s own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required.' operationId: 'createObservabilityDestination' requestBody: content: @@ -55204,7 +55197,7 @@ paths: - 'Observability' x-speakeasy-name-override: 'get' patch: - description: 'Update an existing observability destination. Only the fields provided in the request body are updated. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + description: 'Update an existing observability destination. Only the fields provided in the request body are updated. Enabling a disabled destination returns 400 while the workspace already has 5 enabled destinations. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.' operationId: 'updateObservabilityDestination' parameters: - description: 'The destination ID (UUID).' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 0e55b91e6..73423671c 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.803.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:b448ae218aee05868613af094e9aa5c0649c2ef3265746362e5531ecd09f6595 - sourceBlobDigest: sha256:1f307085d3e3530b6c87f57cd95a1c93909c51449973b346d7dc35655c454fce + sourceRevisionDigest: sha256:5a22507656dbea6f0a9d26cf5f47e6481b036e2cdd1bb07e2b7faaed44ef63e6 + sourceBlobDigest: sha256:9639101991c3a5379daa7473f3e0b28c36e1844e591c5e2f4341e8c08c2f21cb tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:b448ae218aee05868613af094e9aa5c0649c2ef3265746362e5531ecd09f6595 - sourceBlobDigest: sha256:1f307085d3e3530b6c87f57cd95a1c93909c51449973b346d7dc35655c454fce + sourceRevisionDigest: sha256:5a22507656dbea6f0a9d26cf5f47e6481b036e2cdd1bb07e2b7faaed44ef63e6 + sourceBlobDigest: sha256:9639101991c3a5379daa7473f3e0b28c36e1844e591c5e2f4341e8c08c2f21cb codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:fe1532b08a50e2a6cbe7207d7947539f4ae11e6f589f067b4436882b4809d7b5 + codeSamplesRevisionDigest: sha256:887616a04efb67899de4513809245d0af3c3c2c634c4b559e2ac272052ee8f98 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index 09a85ca71..327e7c4c6 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4769,4 +4769,14 @@ Based on: ### Generated - [python v1.3.200] . ### Releases -- [PyPI v1.3.200] https://pypi.org/project/openrouter/1.3.200 - . \ No newline at end of file +- [PyPI v1.3.200] https://pypi.org/project/openrouter/1.3.200 - . + +## 2026-11-20 21:26:29 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.201] . +### Releases +- [PyPI v1.3.201] https://pypi.org/project/openrouter/1.3.201 - . \ No newline at end of file diff --git a/docs/components/workspace.mdx b/docs/components/workspace.mdx index adcd22757..d38ee1f9e 100644 --- a/docs/components/workspace.mdx +++ b/docs/components/workspace.mdx @@ -2,25 +2,28 @@ title: "Workspace" --- +Workspace metadata. Configuration fields are omitted without permission to view workspace settings. + + ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| `created_at` | *str* | ✔️ | ISO 8601 timestamp of when the workspace was created | 2025-08-24T10:30:00Z | -| `created_by` | *Nullable[str]* | ✔️ | User ID of the workspace creator | user_abc123 | -| `default_guardrail_id` | *str* | ✔️ | Deterministic ID derived from the workspace ID. The default guardrail is materialized when its configuration is first written. | 595d5849-7e86-51fd-a7c0-705c34e4afff | -| `default_image_model` | *Nullable[str]* | ✔️ | Default image model for this workspace | openai/dall-e-3 | -| `default_provider_sort` | *Nullable[str]* | ✔️ | Default provider sort preference (price, throughput, latency, exacto) | price | -| `default_text_model` | *Nullable[str]* | ✔️ | Default text model for this workspace | openai/gpt-4o | -| `description` | *Nullable[str]* | ✔️ | Description of the workspace | Production environment workspace | -| `disabled_server_tools` | List[*str*] | ➖ | OpenRouter server tools (e.g. openrouter:web_search) that requests in this workspace may not invoke. Null means no tools are disabled. | null | -| `id` | *str* | ✔️ | Unique identifier for the workspace | 550e8400-e29b-41d4-a716-446655440000 | -| `include_byok_in_budgets` | *Optional[bool]* | ➖ | Whether BYOK (bring-your-own-key) spend counts toward this workspace's budgets. Set it via the workspace budget endpoints. | false | -| `io_logging_api_key_ids` | List[*int*] | ✔️ | Optional array of API key IDs to filter I/O logging. Null means all keys are logged. | null | -| `io_logging_sampling_rate` | *float* | ✔️ | Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged. | 1 | -| `is_data_discount_logging_enabled` | *bool* | ✔️ | Whether data discount logging is enabled for this workspace | true | -| `is_observability_broadcast_enabled` | *bool* | ✔️ | Whether broadcast is enabled for this workspace | false | -| `is_observability_io_logging_enabled` | *bool* | ✔️ | Whether private logging is enabled for this workspace | false | -| `name` | *str* | ✔️ | Name of the workspace | Production | -| `slug` | *str* | ✔️ | URL-friendly slug for the workspace | production | -| `updated_at` | *Nullable[str]* | ✔️ | ISO 8601 timestamp of when the workspace was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_at` | *str* | ✔️ | ISO 8601 timestamp of when the workspace was created | 2025-08-24T10:30:00Z | +| `created_by` | *Nullable[str]* | ✔️ | User ID of the workspace creator | user_abc123 | +| `default_guardrail_id` | *str* | ✔️ | Deterministic ID derived from the workspace ID. The default guardrail is materialized when its configuration is first written. | 595d5849-7e86-51fd-a7c0-705c34e4afff | +| `default_image_model` | *OptionalNullable[str]* | ➖ | Default image model for this workspace | openai/dall-e-3 | +| `default_provider_sort` | *OptionalNullable[str]* | ➖ | Default provider sort preference (price, throughput, latency, exacto) | price | +| `default_text_model` | *OptionalNullable[str]* | ➖ | Default text model for this workspace | openai/gpt-4o | +| `description` | *Nullable[str]* | ✔️ | Description of the workspace | Production environment workspace | +| `disabled_server_tools` | List[*str*] | ➖ | OpenRouter server tools (e.g. openrouter:web_search) that requests in this workspace may not invoke. Null means no tools are disabled. | null | +| `id` | *str* | ✔️ | Unique identifier for the workspace | 550e8400-e29b-41d4-a716-446655440000 | +| `include_byok_in_budgets` | *Optional[bool]* | ➖ | Whether BYOK (bring-your-own-key) spend counts toward this workspace's budgets. Omitted without settings and budget visibility. Set it via the workspace budget endpoints. | false | +| `io_logging_api_key_ids` | List[*int*] | ➖ | API key IDs used to filter I/O logging. Null means all keys are logged. Omitted without access to workspace settings and API key identifiers. | null | +| `io_logging_sampling_rate` | *Optional[float]* | ➖ | Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged. | 1 | +| `is_data_discount_logging_enabled` | *Optional[bool]* | ➖ | Whether data discount logging is enabled for this workspace | true | +| `is_observability_broadcast_enabled` | *Optional[bool]* | ➖ | Whether broadcast is enabled for this workspace | false | +| `is_observability_io_logging_enabled` | *Optional[bool]* | ➖ | Whether private logging is enabled for this workspace | false | +| `name` | *str* | ✔️ | Name of the workspace | Production | +| `slug` | *str* | ✔️ | URL-friendly slug for the workspace | production | +| `updated_at` | *Nullable[str]* | ✔️ | ISO 8601 timestamp of when the workspace was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file diff --git a/docs/sdks/analytics/README.mdx b/docs/sdks/analytics/README.mdx index ccdae17cd..9ceefae52 100644 --- a/docs/sdks/analytics/README.mdx +++ b/docs/sdks/analytics/README.mdx @@ -15,7 +15,7 @@ Analytics and usage endpoints ## get_user_activity -Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). [Management key](/docs/guides/overview/auth/management-api-keys) required. +Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). For Custom keys, `api_key_hash` also requires `api_keys:view_all` and does not resolve deleted keys. `user_id` also requires `workspace_members:view` on an explicit non-default workspace; organization and default-workspace member filtering requires `org_members:view`, which is not available as a Custom grant. [Management key](/docs/guides/overview/auth/management-api-keys) required. ### Example Usage @@ -62,7 +62,7 @@ with OpenRouter( ## get_analytics_meta -Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Workspace-scoped management keys are accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required. +Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Custom access requires an organization-scoped key with `analytics:view`. Workspace-scoped keys with base Read Only or Read Write access are also accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required. ### Example Usage @@ -109,7 +109,7 @@ with OpenRouter( ## query_analytics -Execute an analytics query with specified metrics, dimensions, filters, and time range. A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: it is refused a `workspace` filter naming another workspace, it excludes legacy rows with no workspace (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required. +Execute an analytics query with specified metrics, dimensions, filters, and time range. Custom access requires an organization-scoped key with `analytics:view`; grouping or filtering by `api_key_id` or `api_key_tag` also requires `api_keys:view_all`, and by `user` requires `org_members:view`. Key hash filters resolve only non-deleted ordinary keys. Workspace-scoped keys with base Read Only or Read Write access can query only their own workspace: a `workspace` filter naming another workspace is refused, legacy rows with no workspace are excluded (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required. ### Example Usage diff --git a/docs/sdks/observability/README.mdx b/docs/sdks/observability/README.mdx index 608b9a7a8..cecaa8a89 100644 --- a/docs/sdks/observability/README.mdx +++ b/docs/sdks/observability/README.mdx @@ -70,7 +70,7 @@ with OpenRouter( ## create -Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required. +Create a new observability destination. A maximum of 5 enabled destinations per workspace, across all types, is allowed; disabled destinations do not count. A workspace already above the cap keeps its enabled destinations but cannot create or enable more until fewer than 5 are enabled. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required. ### Example Usage @@ -235,7 +235,7 @@ with OpenRouter( ## update -Update an existing observability destination. Only the fields provided in the request body are updated. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required. +Update an existing observability destination. Only the fields provided in the request body are updated. Enabling a disabled destination returns 400 while the workspace already has 5 enabled destinations. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required. ### Example Usage diff --git a/pyproject.toml b/pyproject.toml index c2e022401..92812803a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.200" +version = "1.3.201" description = "Official Python Client SDK for OpenRouter." authors = [{ name = "OpenRouter" },] readme = "README-PYPI.md" diff --git a/src/openrouter/_version.py b/src/openrouter/_version.py index a73f913bf..162c544f5 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.3.200" +__version__: str = "1.3.201" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.200 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.201 2.950.13 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/analytics.py b/src/openrouter/analytics.py index 6dc3ecedf..6a8e172e4 100644 --- a/src/openrouter/analytics.py +++ b/src/openrouter/analytics.py @@ -26,7 +26,7 @@ def get_user_activity( ) -> components.ActivityResponse: r"""Get user activity grouped by endpoint - Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). [Management key](/docs/guides/overview/auth/management-api-keys) required. + Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). For Custom keys, `api_key_hash` also requires `api_keys:view_all` and does not resolve deleted keys. `user_id` also requires `workspace_members:view` on an explicit non-default workspace; organization and default-workspace member filtering requires `org_members:view`, which is not available as a Custom grant. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -154,7 +154,7 @@ async def get_user_activity_async( ) -> components.ActivityResponse: r"""Get user activity grouped by endpoint - Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). [Management key](/docs/guides/overview/auth/management-api-keys) required. + Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). For Custom keys, `api_key_hash` also requires `api_keys:view_all` and does not resolve deleted keys. `user_id` also requires `workspace_members:view` on an explicit non-default workspace; organization and default-workspace member filtering requires `org_members:view`, which is not available as a Custom grant. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -281,7 +281,7 @@ def get_analytics_meta( ) -> operations.GetAnalyticsMetaResponse: r"""Get available analytics metrics and dimensions - Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Workspace-scoped management keys are accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Custom access requires an organization-scoped key with `analytics:view`. Workspace-scoped keys with base Read Only or Read Write access are also accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. @@ -408,7 +408,7 @@ async def get_analytics_meta_async( ) -> operations.GetAnalyticsMetaResponse: r"""Get available analytics metrics and dimensions - Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Workspace-scoped management keys are accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Custom access requires an organization-scoped key with `analytics:view`. Workspace-scoped keys with base Read Only or Read Write access are also accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. @@ -558,7 +558,7 @@ def query_analytics( ) -> operations.QueryAnalyticsResponse: r"""Query analytics data - Execute an analytics query with specified metrics, dimensions, filters, and time range. A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: it is refused a `workspace` filter naming another workspace, it excludes legacy rows with no workspace (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Execute an analytics query with specified metrics, dimensions, filters, and time range. Custom access requires an organization-scoped key with `analytics:view`; grouping or filtering by `api_key_id` or `api_key_tag` also requires `api_keys:view_all`, and by `user` requires `org_members:view`. Key hash filters resolve only non-deleted ordinary keys. Workspace-scoped keys with base Read Only or Read Write access can query only their own workspace: a `workspace` filter naming another workspace is refused, legacy rows with no workspace are excluded (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param metrics: :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. @@ -755,7 +755,7 @@ async def query_analytics_async( ) -> operations.QueryAnalyticsResponse: r"""Query analytics data - Execute an analytics query with specified metrics, dimensions, filters, and time range. A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: it is refused a `workspace` filter naming another workspace, it excludes legacy rows with no workspace (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Execute an analytics query with specified metrics, dimensions, filters, and time range. Custom access requires an organization-scoped key with `analytics:view`; grouping or filtering by `api_key_id` or `api_key_tag` also requires `api_keys:view_all`, and by `user` requires `org_members:view`. Key hash filters resolve only non-deleted ordinary keys. Workspace-scoped keys with base Read Only or Read Write access can query only their own workspace: a `workspace` filter naming another workspace is refused, legacy rows with no workspace are excluded (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param metrics: :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. diff --git a/src/openrouter/components/workspace.py b/src/openrouter/components/workspace.py index 874f99775..fef9bdf20 100644 --- a/src/openrouter/components/workspace.py +++ b/src/openrouter/components/workspace.py @@ -14,45 +14,49 @@ class WorkspaceTypedDict(TypedDict): + r"""Workspace metadata. Configuration fields are omitted without permission to view workspace settings.""" + created_at: str r"""ISO 8601 timestamp of when the workspace was created""" created_by: Nullable[str] r"""User ID of the workspace creator""" default_guardrail_id: str r"""Deterministic ID derived from the workspace ID. The default guardrail is materialized when its configuration is first written.""" - default_image_model: Nullable[str] - r"""Default image model for this workspace""" - default_provider_sort: Nullable[str] - r"""Default provider sort preference (price, throughput, latency, exacto)""" - default_text_model: Nullable[str] - r"""Default text model for this workspace""" description: Nullable[str] r"""Description of the workspace""" id: str r"""Unique identifier for the workspace""" - io_logging_api_key_ids: Nullable[List[int]] - r"""Optional array of API key IDs to filter I/O logging. Null means all keys are logged.""" - io_logging_sampling_rate: float - r"""Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged.""" - is_data_discount_logging_enabled: bool - r"""Whether data discount logging is enabled for this workspace""" - is_observability_broadcast_enabled: bool - r"""Whether broadcast is enabled for this workspace""" - is_observability_io_logging_enabled: bool - r"""Whether private logging is enabled for this workspace""" name: str r"""Name of the workspace""" slug: str r"""URL-friendly slug for the workspace""" updated_at: Nullable[str] r"""ISO 8601 timestamp of when the workspace was last updated""" + default_image_model: NotRequired[Nullable[str]] + r"""Default image model for this workspace""" + default_provider_sort: NotRequired[Nullable[str]] + r"""Default provider sort preference (price, throughput, latency, exacto)""" + default_text_model: NotRequired[Nullable[str]] + r"""Default text model for this workspace""" disabled_server_tools: NotRequired[Nullable[List[str]]] r"""OpenRouter server tools (e.g. openrouter:web_search) that requests in this workspace may not invoke. Null means no tools are disabled.""" include_byok_in_budgets: NotRequired[bool] - r"""Whether BYOK (bring-your-own-key) spend counts toward this workspace's budgets. Set it via the workspace budget endpoints.""" + r"""Whether BYOK (bring-your-own-key) spend counts toward this workspace's budgets. Omitted without settings and budget visibility. Set it via the workspace budget endpoints.""" + io_logging_api_key_ids: NotRequired[Nullable[List[int]]] + r"""API key IDs used to filter I/O logging. Null means all keys are logged. Omitted without access to workspace settings and API key identifiers.""" + io_logging_sampling_rate: NotRequired[float] + r"""Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged.""" + is_data_discount_logging_enabled: NotRequired[bool] + r"""Whether data discount logging is enabled for this workspace""" + is_observability_broadcast_enabled: NotRequired[bool] + r"""Whether broadcast is enabled for this workspace""" + is_observability_io_logging_enabled: NotRequired[bool] + r"""Whether private logging is enabled for this workspace""" class Workspace(BaseModel): + r"""Workspace metadata. Configuration fields are omitted without permission to view workspace settings.""" + created_at: str r"""ISO 8601 timestamp of when the workspace was created""" @@ -62,36 +66,12 @@ class Workspace(BaseModel): default_guardrail_id: str r"""Deterministic ID derived from the workspace ID. The default guardrail is materialized when its configuration is first written.""" - default_image_model: Nullable[str] - r"""Default image model for this workspace""" - - default_provider_sort: Nullable[str] - r"""Default provider sort preference (price, throughput, latency, exacto)""" - - default_text_model: Nullable[str] - r"""Default text model for this workspace""" - description: Nullable[str] r"""Description of the workspace""" id: str r"""Unique identifier for the workspace""" - io_logging_api_key_ids: Nullable[List[int]] - r"""Optional array of API key IDs to filter I/O logging. Null means all keys are logged.""" - - io_logging_sampling_rate: float - r"""Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged.""" - - is_data_discount_logging_enabled: bool - r"""Whether data discount logging is enabled for this workspace""" - - is_observability_broadcast_enabled: bool - r"""Whether broadcast is enabled for this workspace""" - - is_observability_io_logging_enabled: bool - r"""Whether private logging is enabled for this workspace""" - name: str r"""Name of the workspace""" @@ -101,15 +81,52 @@ class Workspace(BaseModel): updated_at: Nullable[str] r"""ISO 8601 timestamp of when the workspace was last updated""" + default_image_model: OptionalNullable[str] = UNSET + r"""Default image model for this workspace""" + + default_provider_sort: OptionalNullable[str] = UNSET + r"""Default provider sort preference (price, throughput, latency, exacto)""" + + default_text_model: OptionalNullable[str] = UNSET + r"""Default text model for this workspace""" + disabled_server_tools: OptionalNullable[List[str]] = UNSET r"""OpenRouter server tools (e.g. openrouter:web_search) that requests in this workspace may not invoke. Null means no tools are disabled.""" include_byok_in_budgets: Optional[bool] = None - r"""Whether BYOK (bring-your-own-key) spend counts toward this workspace's budgets. Set it via the workspace budget endpoints.""" + r"""Whether BYOK (bring-your-own-key) spend counts toward this workspace's budgets. Omitted without settings and budget visibility. Set it via the workspace budget endpoints.""" + + io_logging_api_key_ids: OptionalNullable[List[int]] = UNSET + r"""API key IDs used to filter I/O logging. Null means all keys are logged. Omitted without access to workspace settings and API key identifiers.""" + + io_logging_sampling_rate: Optional[float] = None + r"""Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged.""" + + is_data_discount_logging_enabled: Optional[bool] = None + r"""Whether data discount logging is enabled for this workspace""" + + is_observability_broadcast_enabled: Optional[bool] = None + r"""Whether broadcast is enabled for this workspace""" + + is_observability_io_logging_enabled: Optional[bool] = None + r"""Whether private logging is enabled for this workspace""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["disabled_server_tools", "include_byok_in_budgets"]) + optional_fields = set( + [ + "default_image_model", + "default_provider_sort", + "default_text_model", + "disabled_server_tools", + "include_byok_in_budgets", + "io_logging_api_key_ids", + "io_logging_sampling_rate", + "is_data_discount_logging_enabled", + "is_observability_broadcast_enabled", + "is_observability_io_logging_enabled", + ] + ) nullable_fields = set( [ "created_by", diff --git a/src/openrouter/observability.py b/src/openrouter/observability.py index dd8a6eccd..039fd484b 100644 --- a/src/openrouter/observability.py +++ b/src/openrouter/observability.py @@ -394,7 +394,7 @@ def create( ) -> components.CreateObservabilityDestinationResponse: r"""Create an observability destination - Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Create a new observability destination. A maximum of 5 enabled destinations per workspace, across all types, is allowed; disabled destinations do not count. A workspace already above the cap keeps its enabled destinations but cannot create or enable more until fewer than 5 are enabled. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param config: Provider-specific configuration. The shape depends on `type` and is validated server-side. :param name: Human-readable name for the destination. @@ -594,7 +594,7 @@ async def create_async( ) -> components.CreateObservabilityDestinationResponse: r"""Create an observability destination - Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Create a new observability destination. A maximum of 5 enabled destinations per workspace, across all types, is allowed; disabled destinations do not count. A workspace already above the cap keeps its enabled destinations but cannot create or enable more until fewer than 5 are enabled. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param config: Provider-specific configuration. The shape depends on `type` and is validated server-side. :param name: Human-readable name for the destination. @@ -1333,7 +1333,7 @@ def update( ) -> components.UpdateObservabilityDestinationResponse: r"""Update an observability destination - Update an existing observability destination. Only the fields provided in the request body are updated. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Update an existing observability destination. Only the fields provided in the request body are updated. Enabling a disabled destination returns 400 while the workspace already has 5 enabled destinations. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: The destination ID (UUID). :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. @@ -1535,7 +1535,7 @@ async def update_async( ) -> components.UpdateObservabilityDestinationResponse: r"""Update an observability destination - Update an existing observability destination. Only the fields provided in the request body are updated. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Update an existing observability destination. Only the fields provided in the request body are updated. Enabling a disabled destination returns 400 while the workspace already has 5 enabled destinations. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: The destination ID (UUID). :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. diff --git a/uv.lock b/uv.lock index 6d2e41972..1485dc4c2 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.200" +version = "1.3.201" source = { editable = "." } dependencies = [ { name = "httpcore" }, From 079b664d7a8b4ea58bef9d551b9bbdef9a92c554 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Fri, 20 Nov 2026 21:29:56 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow