diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 25dba32a..fa33017f 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: 04bbc41078a88cc87386c416fa055e46 + docChecksum: 3ebd1783ba3cfc3a0c50703a0e68b47c docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.23 - configChecksum: e308e072d38ab25dfa082923cfcb6c37 + releaseVersion: 1.1.24 + configChecksum: 84d0cb0f6d7787cc8b9d87434368c723 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: dfa4101d-8e6c-4dc0-982d-8c873b25d753 - pristine_commit_hash: 1a341267d787005b16c00ddb69db3ef06f07f0ba - pristine_tree_hash: 0a622c78755ce17894cd25e65a2450b671dc2602 + generation_id: 55f5a43c-95e5-444d-b73b-1fd3a19b2bb6 + pristine_commit_hash: becb0f2b63d97e0e0f7b2d1ed163272993bc07b8 + pristine_tree_hash: a25dac1fe5f7f9cb37a90f28bb6bf1a1b6abcea3 features: python: acceptHeaders: 3.0.0 @@ -5538,8 +5538,8 @@ trackedFiles: pristine_git_object: e8a689098106c445424b89fe5baa348824f3a36c docs/components/workspace.mdx: id: eea9c32d09c4 - last_write_checksum: sha1:bb84ad37162aa942f69e5addf96d91e5fc5a57ed - pristine_git_object: e70b0743406c319ef2d86c2db4323021c5aecdc8 + last_write_checksum: sha1:7c46c2883ef1097c719aedc1f7e685e64f5e8f10 + pristine_git_object: bfb57ad4dd097359b10a1081120300ea9f9348d8 docs/components/workspacebudget.mdx: id: e941741a8d84 last_write_checksum: sha1:c94db9e8e6518f8da147deddd13cdb76a34609fc @@ -6982,8 +6982,8 @@ trackedFiles: pristine_git_object: f262b34982a18293f5ae22bfbbf385010bfcdc9c docs/sdks/guardrails/README.mdx: id: a0cd4218b8fa - last_write_checksum: sha1:f752bcf18aac6db2d7ec566b1aee76460285b4c8 - pristine_git_object: 9f05abe72cf98fffcff80179fab86d92358d7a9a + last_write_checksum: sha1:816c0e8d6a5d4dcefd9f0b32b120628fb7f16f4e + pristine_git_object: 3c7827be2c4c4a7106a4c02ecf1bd21531d6e8e2 docs/sdks/images/README.mdx: id: 534a6c102c4f last_write_checksum: sha1:1c0a9c704bdd9090f5a0a74f4d9ae0c4360707bb @@ -7046,8 +7046,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:8ad13a878e6b4cd386295697329733e9540a0fe5 - pristine_git_object: 59d8a340a085a79e82e7f8aee53e82a3529c2392 + last_write_checksum: sha1:a8356d256eff93b06f8098df8f72d95c5b7760c4 + pristine_git_object: 726b8caee9917506c0d06dca2de7c22d6f1bda15 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7074,8 +7074,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:a1df53c12984d840da2d89f1bdcfe9e149c16935 - pristine_git_object: acc2a45cf40c9f459881a490afb4c5f3c59e92bb + last_write_checksum: sha1:00885d78769daff0fb6b4c2c3475bf1ce97011cc + pristine_git_object: abd485793c13776fe0d799bd8141faa6665ea002 src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:9e709b71dd0611056dc0cec6150b578defe32841 @@ -9458,8 +9458,8 @@ trackedFiles: pristine_git_object: fda00ebca117e6d3accc21c5252351f77cf34692 src/openrouter/components/workspace.py: id: 682282304bd8 - last_write_checksum: sha1:68bd7960640bee8db112f908c1a53f92f085cb04 - pristine_git_object: 35e47a230f13706d8bb8c59a8aefd779b55b7b6e + last_write_checksum: sha1:69434be003cd92f09b14e7a8ed2fac59ebd05446 + pristine_git_object: 68c99ace24396e1b7bd903cac6ae78a1403b9591 src/openrouter/components/workspacebudget.py: id: f80c6983502a last_write_checksum: sha1:14f6ab02291a2222836247463c57ed42d568a6a9 @@ -9578,8 +9578,8 @@ trackedFiles: pristine_git_object: f6dbf5440466ba6b1d92442cad1b91e2b3587c52 src/openrouter/guardrails.py: id: 705839f34e66 - last_write_checksum: sha1:82a1e00688a33e519d1fac2cd8447a54faa72dfe - pristine_git_object: 45c04ccc276a43956cc63101064453b77956ed63 + last_write_checksum: sha1:2880419c2b3f79cce2f1326b80c4b283de6ef56a + pristine_git_object: c90c233e63bcae52461ce48c12326fd2e891b7e1 src/openrouter/httpclient.py: id: e9311185443d last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 @@ -11822,4 +11822,3 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Python SDK Changes:\n* `open_router.beta.responses.send()`: \n * `request.input.union(Array<>)[].union(class (7)).type` **Changed**\n* `open_router.presets.create_presets_responses()`: \n * `request.input.union(Array<>)[].union(class (7)).type` **Changed**\n* `open_router.responses.send()`: \n * `request.input.union(Array<>)[].union(class (7)).type` **Changed**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index e207a1dd..4f4ae853 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.23 + version: 1.1.24 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 339949af..a6072722 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -25076,7 +25076,7 @@ components: - 'string' - 'null' default_guardrail_id: - description: 'Deterministic ID of the workspace''s implicitly-created default guardrail' + description: 'Deterministic ID derived from the workspace ID. The default guardrail is materialized when its configuration is first written.' example: '595d5849-7e86-51fd-a7c0-705c34e4afff' format: 'uuid' type: 'string' @@ -29853,7 +29853,7 @@ paths: message: 'Resource not found' schema: $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' + description: 'Guardrail not found, or the workspace default guardrail has not been configured yet.' '500': content: application/json: @@ -29869,7 +29869,7 @@ paths: - 'Guardrails' x-speakeasy-name-override: 'get' patch: - description: 'Update an existing guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + description: 'Update an existing guardrail, or materialize an unconfigured workspace default guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.' operationId: 'updateGuardrail' parameters: - description: 'The unique identifier of the guardrail to update' @@ -29930,7 +29930,7 @@ paths: message: 'Invalid request parameters' schema: $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' + description: 'Invalid request, or an attempt to change a workspace default guardrail''s name (which is derived from its workspace and not editable).' '401': content: application/json: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 7720f4fa..db709f48 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:71ad71e0b5138ebb6ed877f60e121fd26f0cca98284f0abb4b7cd7fef45cfa40 - sourceBlobDigest: sha256:92929a5c9d144c5f379c694094acea53c3767e9ca1a9df64c84b92e3e67aca7d + sourceRevisionDigest: sha256:6145bc8c07f796b5b6600bc2d72e4add45345bba90ac06bc65d657393d9d3404 + sourceBlobDigest: sha256:b1047454bde05da0913b1ee9d40f84e0075bc4fc529f6b86d6e0376a47ab8c46 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:71ad71e0b5138ebb6ed877f60e121fd26f0cca98284f0abb4b7cd7fef45cfa40 - sourceBlobDigest: sha256:92929a5c9d144c5f379c694094acea53c3767e9ca1a9df64c84b92e3e67aca7d + sourceRevisionDigest: sha256:6145bc8c07f796b5b6600bc2d72e4add45345bba90ac06bc65d657393d9d3404 + sourceBlobDigest: sha256:b1047454bde05da0913b1ee9d40f84e0075bc4fc529f6b86d6e0376a47ab8c46 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:ab150ee098def8e75556180e64ae86bf6877be5271dbe315935df33658a1f525 + codeSamplesRevisionDigest: sha256:4f8ac677bf8ba355ba6cef7a3edf6d0a007497cca141b2a359fab6be5455e780 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 9c2b72e7..a632c380 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1019,4 +1019,14 @@ Based on: ### Generated - [python v1.1.23] . ### Releases -- [PyPI v1.1.23] https://pypi.org/project/openrouter/1.1.23 - . \ No newline at end of file +- [PyPI v1.1.23] https://pypi.org/project/openrouter/1.1.23 - . + +## 2026-08-01 05:17:17 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.24] . +### Releases +- [PyPI v1.1.24] https://pypi.org/project/openrouter/1.1.24 - . \ No newline at end of file diff --git a/docs/components/workspace.mdx b/docs/components/workspace.mdx index e70b0743..bfb57ad4 100644 --- a/docs/components/workspace.mdx +++ b/docs/components/workspace.mdx @@ -4,22 +4,22 @@ title: "Workspace" ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the workspace was created | 2025-08-24T10:30:00Z | -| `created_by` | *Nullable[str]* | :heavy_check_mark: | User ID of the workspace creator | user_abc123 | -| `default_guardrail_id` | *str* | :heavy_check_mark: | Deterministic ID of the workspace's implicitly-created default guardrail | 595d5849-7e86-51fd-a7c0-705c34e4afff | -| `default_image_model` | *Nullable[str]* | :heavy_check_mark: | Default image model for this workspace | openai/dall-e-3 | -| `default_provider_sort` | *Nullable[str]* | :heavy_check_mark: | Default provider sort preference (price, throughput, latency, exacto) | price | -| `default_text_model` | *Nullable[str]* | :heavy_check_mark: | Default text model for this workspace | openai/gpt-4o | -| `description` | *Nullable[str]* | :heavy_check_mark: | Description of the workspace | Production environment workspace | -| `id` | *str* | :heavy_check_mark: | Unique identifier for the workspace | 550e8400-e29b-41d4-a716-446655440000 | -| `include_byok_in_budgets` | *Optional[bool]* | :heavy_minus_sign: | 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*] | :heavy_check_mark: | Optional array of API key IDs to filter I/O logging. Null means all keys are logged. | null | -| `io_logging_sampling_rate` | *float* | :heavy_check_mark: | Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged. | 1 | -| `is_data_discount_logging_enabled` | *bool* | :heavy_check_mark: | Whether data discount logging is enabled for this workspace | true | -| `is_observability_broadcast_enabled` | *bool* | :heavy_check_mark: | Whether broadcast is enabled for this workspace | false | -| `is_observability_io_logging_enabled` | *bool* | :heavy_check_mark: | Whether private logging is enabled for this workspace | false | -| `name` | *str* | :heavy_check_mark: | Name of the workspace | Production | -| `slug` | *str* | :heavy_check_mark: | URL-friendly slug for the workspace | production | -| `updated_at` | *Nullable[str]* | :heavy_check_mark: | 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* | :heavy_check_mark: | ISO 8601 timestamp of when the workspace was created | 2025-08-24T10:30:00Z | +| `created_by` | *Nullable[str]* | :heavy_check_mark: | User ID of the workspace creator | user_abc123 | +| `default_guardrail_id` | *str* | :heavy_check_mark: | 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]* | :heavy_check_mark: | Default image model for this workspace | openai/dall-e-3 | +| `default_provider_sort` | *Nullable[str]* | :heavy_check_mark: | Default provider sort preference (price, throughput, latency, exacto) | price | +| `default_text_model` | *Nullable[str]* | :heavy_check_mark: | Default text model for this workspace | openai/gpt-4o | +| `description` | *Nullable[str]* | :heavy_check_mark: | Description of the workspace | Production environment workspace | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the workspace | 550e8400-e29b-41d4-a716-446655440000 | +| `include_byok_in_budgets` | *Optional[bool]* | :heavy_minus_sign: | 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*] | :heavy_check_mark: | Optional array of API key IDs to filter I/O logging. Null means all keys are logged. | null | +| `io_logging_sampling_rate` | *float* | :heavy_check_mark: | Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged. | 1 | +| `is_data_discount_logging_enabled` | *bool* | :heavy_check_mark: | Whether data discount logging is enabled for this workspace | true | +| `is_observability_broadcast_enabled` | *bool* | :heavy_check_mark: | Whether broadcast is enabled for this workspace | false | +| `is_observability_io_logging_enabled` | *bool* | :heavy_check_mark: | Whether private logging is enabled for this workspace | false | +| `name` | *str* | :heavy_check_mark: | Name of the workspace | Production | +| `slug` | *str* | :heavy_check_mark: | URL-friendly slug for the workspace | production | +| `updated_at` | *Nullable[str]* | :heavy_check_mark: | 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/guardrails/README.mdx b/docs/sdks/guardrails/README.mdx index 9f05abe7..3c7827be 100644 --- a/docs/sdks/guardrails/README.mdx +++ b/docs/sdks/guardrails/README.mdx @@ -246,7 +246,7 @@ with OpenRouter( ## update -Update an existing guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required. +Update an existing guardrail, or materialize an unconfigured workspace default guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required. ### Example Usage diff --git a/pyproject.toml b/pyproject.toml index 59d8a340..726b8cae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.23" +version = "1.1.24" 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 acc2a45c..abd48579 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.1.23" +__version__: str = "1.1.24" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.23 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.24 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/workspace.py b/src/openrouter/components/workspace.py index 35e47a23..68c99ace 100644 --- a/src/openrouter/components/workspace.py +++ b/src/openrouter/components/workspace.py @@ -13,7 +13,7 @@ class WorkspaceTypedDict(TypedDict): created_by: Nullable[str] r"""User ID of the workspace creator""" default_guardrail_id: str - r"""Deterministic ID of the workspace's implicitly-created default guardrail""" + 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] @@ -52,7 +52,7 @@ class Workspace(BaseModel): r"""User ID of the workspace creator""" default_guardrail_id: str - r"""Deterministic ID of the workspace's implicitly-created default guardrail""" + 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""" diff --git a/src/openrouter/guardrails.py b/src/openrouter/guardrails.py index 45c04ccc..c90c233e 100644 --- a/src/openrouter/guardrails.py +++ b/src/openrouter/guardrails.py @@ -1358,7 +1358,7 @@ def update( ) -> components.UpdateGuardrailResponse: r"""Update a guardrail - Update an existing guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Update an existing guardrail, or materialize an unconfigured workspace default guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: The unique identifier of the guardrail to update :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. @@ -1584,7 +1584,7 @@ async def update_async( ) -> components.UpdateGuardrailResponse: r"""Update a guardrail - Update an existing guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Update an existing guardrail, or materialize an unconfigured workspace default guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required. :param id: The unique identifier of the guardrail to update :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 ac7db154..0997b176 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.23" +version = "1.1.24" source = { editable = "." } dependencies = [ { name = "httpcore" },