From 3dee30855f0fc956f2c3fd2b2c8b72d570163a0b Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 19 Aug 2026 20:47:41 +0000 Subject: [PATCH 1/2] ## Python SDK Changes: * `open_router.video_generation.generate()`: `request` **Changed** * `open_router.video_generation.list_videos_models()`: `response.data[]` **Changed** --- .speakeasy/gen.lock | 59 +++++++++++-------- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 35 +++++++++++ .speakeasy/workflow.lock | 10 ++-- RELEASES.md | 12 +++- docs/components/upscalefactor.mdx | 13 ++++ docs/components/videogenerationrequest.mdx | 4 +- docs/components/videomodel.mdx | 4 +- docs/sdks/videogeneration/README.mdx | 2 + pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- src/openrouter/components/__init__.py | 6 ++ .../components/videogenerationrequest.py | 12 ++++ src/openrouter/components/videomodel.py | 52 ++++++++++++++++ src/openrouter/video_generation.py | 12 ++++ uv.lock | 2 +- 16 files changed, 192 insertions(+), 39 deletions(-) create mode 100644 docs/components/upscalefactor.mdx diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index b1f11db9..71479f45 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: 70f3ab92fb1757fe6fd721c78ba894ed + docChecksum: d7bfeca4e93241d2d1c998e257eb0460 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.64 - configChecksum: e9adf1e0afd4d8f2fedb9fe76743644d + releaseVersion: 1.1.65 + configChecksum: 418f5fa64f420d6ab8307edf6c3bee47 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 32d709d1-2144-467d-bdd3-b0ed3dd97df8 - pristine_commit_hash: 1203d6c0ba320025aa33aca75ea7f2bb3fd1500d - pristine_tree_hash: 69271419732b2548bba3b6f456bfb333c8ad70a1 + generation_id: 883259d9-7d2d-418f-819e-7ba7ca19d2a5 + pristine_commit_hash: 0389d6ee0a4ef52904c97ed11892d179b2f93de4 + pristine_tree_hash: c8302b5ea736dfdd9883c0c64e6ce80ed6bc9f1f features: python: acceptHeaders: 3.0.0 @@ -5496,6 +5496,10 @@ trackedFiles: id: b9779063a1b3 last_write_checksum: sha1:3af637ba6cb6624ac3390470e21ef1d38e99c104 pristine_git_object: 62f4522181f9c1ebe5755bd3bd5851a611534c87 + docs/components/upscalefactor.mdx: + id: d68710dea098 + last_write_checksum: sha1:6f0c8ba91272969b8b4c7e4d420ed1090e6c4bb5 + pristine_git_object: 8ab4fef86efedcd20198f5708f44aaf5252e90ef docs/components/upsertworkspacebudgetrequest.mdx: id: fd79f23696a1 last_write_checksum: sha1:6e9f5f25a4340b5e989295577095d1625c6c2b12 @@ -5534,8 +5538,8 @@ trackedFiles: pristine_git_object: 7dedd74d072b742dc84e8afafa3e2ae47dbded10 docs/components/videogenerationrequest.mdx: id: b92ddbd15ee4 - last_write_checksum: sha1:2f59d7867bb238bc1a50733bb3160132c5cb37bb - pristine_git_object: 18c2380112dbd40f22a364b81f59baeb68cc4bae + last_write_checksum: sha1:691ba3554e13181bbb7e5e591d2095df3d2c4eb5 + pristine_git_object: e53114a381d29202f4b6dd99a9a3298e8a1dbfa0 docs/components/videogenerationrequestaspectratio.mdx: id: c14859c0d8c3 last_write_checksum: sha1:4ad4aae702af1cd2ddee7b443c35c9b3df6824e8 @@ -5566,8 +5570,8 @@ trackedFiles: pristine_git_object: 1916659065ee957050e522c051899e9e0c5b8d7b docs/components/videomodel.mdx: id: 7477360941c9 - last_write_checksum: sha1:cfb8b48981d4b96121011a288d965e5c1fff08fd - pristine_git_object: ad8a6c3f8e9de205349a5a33cead5e355e5b9228 + last_write_checksum: sha1:529a8e6cb21893f578285165d55b1832699c437a + pristine_git_object: ebe922ee8450f2e1cee8f3641777c5b048c7fe1b docs/components/videomodelslistresponse.mdx: id: da08c4cf70a1 last_write_checksum: sha1:a2a799c8769d23a55955a85823ec6e59a1c13b68 @@ -7238,8 +7242,8 @@ trackedFiles: pristine_git_object: 9cf862e8536690785ef58c199f61c87f8945b574 docs/sdks/videogeneration/README.mdx: id: 9a8fa04c3872 - last_write_checksum: sha1:4c1c095386fcdf1c4329bf95a0491d6815e0a426 - pristine_git_object: 3ea6c23aa5715eac2c8d2e0a3d385cbaf12ad979 + last_write_checksum: sha1:795a3adc37bbdd3fb375708e95faa080fd614934 + pristine_git_object: 37da69173c4be1ca80538e4c60b1fa356c77a790 docs/sdks/workspaces/README.mdx: id: 0c75d023ef6b last_write_checksum: sha1:c079746a64ae6d17d275a869566c100b54d955bf @@ -7250,8 +7254,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:ed7fe7a914a6cd7a0c1609753fa5cebedba923c7 - pristine_git_object: e823397e9b0c660033fc5146b23b734eea44ece0 + last_write_checksum: sha1:3dd51e6717e9a501475e570722088dc6fa78a84e + pristine_git_object: f1584d3ff4441d6c91cc91385dbc283e0511decc scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7278,8 +7282,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:d7958726a5435981410aeaa43f2e386cbfa1a0e7 - pristine_git_object: 31d8ed78e8fcbff03276adcb217dcf340dac50e4 + last_write_checksum: sha1:b4f50ddf8b21f6e9b3c8f4e184f34e9a4ee036de + pristine_git_object: f4db5fa55081a16e12d617e733e600fdd0cfadbb src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:3ea0f1c73fb9c101b7bc5719da4dd7bf62ff469a @@ -7322,8 +7326,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:22904934dac60fa1c97520d0af7148864e9a05a4 - pristine_git_object: 0ecfa1024355f685f89166989f37ddf8a98375dc + last_write_checksum: sha1:13d30da328640c1eb0857c32ee5d0f4b847c721f + pristine_git_object: 60e49249505afd5037532efd99c1c19c02818c35 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -9658,8 +9662,8 @@ trackedFiles: pristine_git_object: a0491cc8fd3bd9986146cb1176e27d5b9c9beb60 src/openrouter/components/videogenerationrequest.py: id: 70e3c9ff288c - last_write_checksum: sha1:35de649a912fdc02d9ffe7f461876b6ba4fa290e - pristine_git_object: 034203f278c889a5c20f0d1cb8817fac7701919b + last_write_checksum: sha1:8d3719514d32545cc5389550df6cc368b94ad73f + pristine_git_object: 2269fc9559ae48cfd70dadda3406572767fd2734 src/openrouter/components/videogenerationresponse.py: id: 541f1321b072 last_write_checksum: sha1:18c3aa7845f63a9614286b1a27b6098eae1c4951 @@ -9670,8 +9674,8 @@ trackedFiles: pristine_git_object: c6f80ef4af6effc740beb6e0f1abfee653340717 src/openrouter/components/videomodel.py: id: a544a49f7891 - last_write_checksum: sha1:8c7943cbfc33e712296a9604a61ccf9f1f58c408 - pristine_git_object: 0c072a2528d68c497dcb36083e62d48eaf2ade88 + last_write_checksum: sha1:0a4c711e6c0b0bef79eeeeb6cebf5accfbea4cd7 + pristine_git_object: 3dc009fb8f4b0e81cae87f726fc638560d22ca21 src/openrouter/components/videomodelslistresponse.py: id: 2e9d1ce2cf19 last_write_checksum: sha1:b94977aa6941f7cf15c889f1b7cc69b50cd35856 @@ -10434,8 +10438,8 @@ trackedFiles: pristine_git_object: dae01a44384ac3bc13ae07453a053bf6c898ebe3 src/openrouter/video_generation.py: id: d0a90c1b8efe - last_write_checksum: sha1:9385460df98798b801e97a6f1f77d0748d31d0db - pristine_git_object: 34a2f1e5eb9526f692341b5efa393b2b58fb7a57 + last_write_checksum: sha1:25e4ca847d4139f7e33d5611009d2b19e3f7f3ac + pristine_git_object: d6a2f5b25bc1bbad8bf5faa911f453f65fb0465f src/openrouter/workspaces.py: id: cd6c533b1802 last_write_checksum: sha1:b796f38262144b21ebf8f77e0a842903b4098e24 @@ -11135,7 +11139,7 @@ examples: speakeasy-default-list-videos-models: responses: "200": - application/json: {"data": [{"allowed_passthrough_parameters": [], "canonical_slug": "google/veo-3.1", "created": 1700000000, "generate_audio": true, "id": "google/veo-3.1", "name": "Veo 3.1", "seed": null, "supported_aspect_ratios": ["16:9"], "supported_durations": [5, 8], "supported_frame_images": ["first_frame", "last_frame"], "supported_resolutions": ["720p"], "supported_sizes": null}]} + application/json: {"data": [{"allowed_passthrough_parameters": [], "canonical_slug": "google/veo-3.1", "created": 1700000000, "creativity": [], "generate_audio": true, "id": "google/veo-3.1", "name": "Veo 3.1", "seed": null, "supported_aspect_ratios": ["16:9"], "supported_durations": [5, 8], "supported_frame_images": ["first_frame", "last_frame"], "supported_resolutions": ["720p"], "supported_sizes": null, "upscale_factor": {}}]} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "500": @@ -12171,4 +12175,7 @@ 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(AdditionalToolsItem).tools[].union(AdvisorServerTool_OpenRouter).parameters` **Changed** (Breaking ⚠️)\n* `open_router.chat.send()`: \n * `request.tools[].union(AdvisorServerTool_OpenRouter).parameters` **Changed** (Breaking ⚠️)\n* `open_router.presets.create_presets_chat_completions()`: \n * `request.tools[].union(AdvisorServerTool_OpenRouter).parameters` **Changed** (Breaking ⚠️)\n* `open_router.presets.create_presets_responses()`: \n * `request.input.union(Array<>)[].union(AdditionalToolsItem).tools[].union(AdvisorServerTool_OpenRouter).parameters` **Changed** (Breaking ⚠️)\n* `open_router.responses.send()`: \n * `request.input.union(Array<>)[].union(AdditionalToolsItem).tools[].union(AdvisorServerTool_OpenRouter).parameters` **Changed** (Breaking ⚠️)\n" +releaseNotes: | + ## Python SDK Changes: + * `open_router.video_generation.generate()`: `request` **Changed** + * `open_router.video_generation.list_videos_models()`: `response.data[]` **Changed** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 39de7c46..9c0a9c40 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.64 + version: 1.1.65 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 21cc8c15..cb6c1a65 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -25557,6 +25557,10 @@ components: example: 'https://example.com/webhook' format: 'uri' type: 'string' + creativity: + description: 'Creativity level for video upscaling models only. This parameter is not supported by video generation models.' + example: 1 + type: 'integer' duration: description: 'Duration of the generated video in seconds' example: 8 @@ -25613,6 +25617,12 @@ components: description: 'Exact pixel dimensions of the generated video in "WIDTHxHEIGHT" format (e.g. "1280x720"). Interchangeable with resolution + aspect_ratio.' example: '1280x720' type: 'string' + upscale_factor: + description: 'Upscale factor for video upscaling models only. This parameter is not supported by video generation models.' + example: 2 + exclusiveMinimum: true + minimum: 0 + type: 'number' required: - 'model' type: 'object' @@ -25706,6 +25716,13 @@ components: description: 'Unix timestamp of when the model was created' example: 1692901234 type: 'integer' + creativity: + description: 'Supported creativity levels for video upscaling models' + items: + type: 'integer' + type: + - 'array' + - 'null' description: description: 'Description of the model' example: 'GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.' @@ -25864,6 +25881,22 @@ components: type: - 'array' - 'null' + upscale_factor: + description: 'Supported upscale factor range for video upscaling models' + properties: + max: + format: 'double' + type: + - 'number' + - 'null' + min: + format: 'double' + type: + - 'number' + - 'null' + type: + - 'object' + - 'null' required: - 'id' - 'canonical_slug' @@ -25874,6 +25907,8 @@ components: - 'supported_sizes' - 'supported_durations' - 'supported_frame_images' + - 'upscale_factor' + - 'creativity' - 'generate_audio' - 'seed' - 'allowed_passthrough_parameters' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index ea82c457..0187399b 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:8619baee716f98a1763601a5e441153de11ba39cd1987e4a3bac14c99bf09e17 - sourceBlobDigest: sha256:8dfabc64791bb2672929791e0cd1e22f17fc22c506259586458e48b661c12331 + sourceRevisionDigest: sha256:f957978d89d9c8088e7e1add6c3b14f9411d3cf2c1ca104c3ae72d26d48a6869 + sourceBlobDigest: sha256:0218702bdcc5b58985c2496f7f97211fd48ceeebad4ae1f6440a4a7884b4f86a tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:8619baee716f98a1763601a5e441153de11ba39cd1987e4a3bac14c99bf09e17 - sourceBlobDigest: sha256:8dfabc64791bb2672929791e0cd1e22f17fc22c506259586458e48b661c12331 + sourceRevisionDigest: sha256:f957978d89d9c8088e7e1add6c3b14f9411d3cf2c1ca104c3ae72d26d48a6869 + sourceBlobDigest: sha256:0218702bdcc5b58985c2496f7f97211fd48ceeebad4ae1f6440a4a7884b4f86a codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:fc65d3b585ff9c91785e620714dc0ad87f207be2a2c1d0155c2c62858a918892 + codeSamplesRevisionDigest: sha256:3363b924d12bbff8893e207af69292c7819960aea2887d548af85ab94063a1cf workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index f20570b3..2c508bb1 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1429,4 +1429,14 @@ Based on: ### Generated - [python v1.1.64] . ### Releases -- [PyPI v1.1.64] https://pypi.org/project/openrouter/1.1.64 - . \ No newline at end of file +- [PyPI v1.1.64] https://pypi.org/project/openrouter/1.1.64 - . + +## 2026-08-19 20:45:35 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.65] . +### Releases +- [PyPI v1.1.65] https://pypi.org/project/openrouter/1.1.65 - . \ No newline at end of file diff --git a/docs/components/upscalefactor.mdx b/docs/components/upscalefactor.mdx new file mode 100644 index 00000000..8ab4fef8 --- /dev/null +++ b/docs/components/upscalefactor.mdx @@ -0,0 +1,13 @@ +--- +title: "UpscaleFactor" +--- + +Supported upscale factor range for video upscaling models + + +## Fields + +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `max` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `min` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/videogenerationrequest.mdx b/docs/components/videogenerationrequest.mdx index 18c23801..e53114a3 100644 --- a/docs/components/videogenerationrequest.mdx +++ b/docs/components/videogenerationrequest.mdx @@ -8,6 +8,7 @@ title: "VideoGenerationRequest" | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `aspect_ratio` | [Optional[components.VideoGenerationRequestAspectRatio]](../components/videogenerationrequestaspectratio.mdx) | :heavy_minus_sign: | Aspect ratio of the generated video | 16:9 | | `callback_url` | *Optional[str]* | :heavy_minus_sign: | URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS. | https://example.com/webhook | +| `creativity` | *Optional[int]* | :heavy_minus_sign: | Creativity level for video upscaling models only. This parameter is not supported by video generation models. | 1 | | `duration` | *Optional[int]* | :heavy_minus_sign: | Duration of the generated video in seconds | 8 | | `frame_images` | List[[components.FrameImage](../components/frameimage.mdx)] | :heavy_minus_sign: | Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame. | | | `generate_audio` | *Optional[bool]* | :heavy_minus_sign: | Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set. | true | @@ -17,4 +18,5 @@ title: "VideoGenerationRequest" | `provider` | [Optional[components.VideoGenerationRequestProvider]](../components/videogenerationrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | | | `resolution` | [Optional[components.VideoGenerationRequestResolution]](../components/videogenerationrequestresolution.mdx) | :heavy_minus_sign: | Resolution of the generated video | 720p | | `seed` | *Optional[int]* | :heavy_minus_sign: | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | -| `size` | *Optional[str]* | :heavy_minus_sign: | Exact pixel dimensions of the generated video in "WIDTHxHEIGHT" format (e.g. "1280x720"). Interchangeable with resolution + aspect_ratio. | 1280x720 | \ No newline at end of file +| `size` | *Optional[str]* | :heavy_minus_sign: | Exact pixel dimensions of the generated video in "WIDTHxHEIGHT" format (e.g. "1280x720"). Interchangeable with resolution + aspect_ratio. | 1280x720 | +| `upscale_factor` | *Optional[float]* | :heavy_minus_sign: | Upscale factor for video upscaling models only. This parameter is not supported by video generation models. | 2 | \ No newline at end of file diff --git a/docs/components/videomodel.mdx b/docs/components/videomodel.mdx index ad8a6c3f..ebe922ee 100644 --- a/docs/components/videomodel.mdx +++ b/docs/components/videomodel.mdx @@ -9,6 +9,7 @@ title: "VideoModel" | `allowed_passthrough_parameters` | List[*str*] | :heavy_check_mark: | List of parameters that are allowed to be passed through to the provider | | | `canonical_slug` | *str* | :heavy_check_mark: | Canonical slug for the model | openai/gpt-4 | | `created` | *int* | :heavy_check_mark: | Unix timestamp of when the model was created | 1692901234 | +| `creativity` | List[*int*] | :heavy_check_mark: | Supported creativity levels for video upscaling models | | | `description` | *Optional[str]* | :heavy_minus_sign: | Description of the model | GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. | | `generate_audio` | *Nullable[bool]* | :heavy_check_mark: | Whether the model supports generating audio alongside video | | | `hugging_face_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Hugging Face model identifier, if applicable | microsoft/DialoGPT-medium | @@ -20,4 +21,5 @@ title: "VideoModel" | `supported_durations` | List[*int*] | :heavy_check_mark: | Supported video durations in seconds | | | `supported_frame_images` | List[[components.SupportedFrameImage](../components/supportedframeimage.mdx)] | :heavy_check_mark: | Supported frame image types (e.g. first_frame, last_frame) | | | `supported_resolutions` | List[[components.SupportedResolution](../components/supportedresolution.mdx)] | :heavy_check_mark: | Supported output resolutions | | -| `supported_sizes` | List[[components.SupportedSize](../components/supportedsize.mdx)] | :heavy_check_mark: | Supported output sizes (width x height) | | \ No newline at end of file +| `supported_sizes` | List[[components.SupportedSize](../components/supportedsize.mdx)] | :heavy_check_mark: | Supported output sizes (width x height) | | +| `upscale_factor` | [Nullable[components.UpscaleFactor]](../components/upscalefactor.mdx) | :heavy_check_mark: | Supported upscale factor range for video upscaling models | | \ No newline at end of file diff --git a/docs/sdks/videogeneration/README.mdx b/docs/sdks/videogeneration/README.mdx index 3ea6c23a..37da6917 100644 --- a/docs/sdks/videogeneration/README.mdx +++ b/docs/sdks/videogeneration/README.mdx @@ -49,6 +49,7 @@ with OpenRouter( | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `aspect_ratio` | [Optional[components.VideoGenerationRequestAspectRatio]](../../components/videogenerationrequestaspectratio.mdx) | :heavy_minus_sign: | Aspect ratio of the generated video | 16:9 | | `callback_url` | *Optional[str]* | :heavy_minus_sign: | URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS. | https://example.com/webhook | +| `creativity` | *Optional[int]* | :heavy_minus_sign: | Creativity level for video upscaling models only. This parameter is not supported by video generation models. | 1 | | `duration` | *Optional[int]* | :heavy_minus_sign: | Duration of the generated video in seconds | 8 | | `frame_images` | List[[components.FrameImage](../../components/frameimage.mdx)] | :heavy_minus_sign: | Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame. | | | `generate_audio` | *Optional[bool]* | :heavy_minus_sign: | Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set. | true | @@ -58,6 +59,7 @@ with OpenRouter( | `resolution` | [Optional[components.VideoGenerationRequestResolution]](../../components/videogenerationrequestresolution.mdx) | :heavy_minus_sign: | Resolution of the generated video | 720p | | `seed` | *Optional[int]* | :heavy_minus_sign: | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | | `size` | *Optional[str]* | :heavy_minus_sign: | Exact pixel dimensions of the generated video in "WIDTHxHEIGHT" format (e.g. "1280x720"). Interchangeable with resolution + aspect_ratio. | 1280x720 | +| `upscale_factor` | *Optional[float]* | :heavy_minus_sign: | Upscale factor for video upscaling models only. This parameter is not supported by video generation models. | 2 | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/pyproject.toml b/pyproject.toml index e823397e..f1584d3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.64" +version = "1.1.65" 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 31d8ed78..f4db5fa5 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.64" +__version__: str = "1.1.65" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.64 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.65 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index 0ecfa102..60e49249 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -3018,6 +3018,8 @@ SupportedFrameImage, SupportedResolution, SupportedSize, + UpscaleFactor, + UpscaleFactorTypedDict, VideoModel, VideoModelTypedDict, ) @@ -5289,6 +5291,8 @@ "UpdateWorkspaceRequestTypedDict", "UpdateWorkspaceResponse", "UpdateWorkspaceResponseTypedDict", + "UpscaleFactor", + "UpscaleFactorTypedDict", "UpsertWorkspaceBudgetRequest", "UpsertWorkspaceBudgetRequestTypedDict", "UpsertWorkspaceBudgetResponse", @@ -7578,6 +7582,8 @@ "SupportedFrameImage": ".videomodel", "SupportedResolution": ".videomodel", "SupportedSize": ".videomodel", + "UpscaleFactor": ".videomodel", + "UpscaleFactorTypedDict": ".videomodel", "VideoModel": ".videomodel", "VideoModelTypedDict": ".videomodel", "VideoModelsListResponse": ".videomodelslistresponse", diff --git a/src/openrouter/components/videogenerationrequest.py b/src/openrouter/components/videogenerationrequest.py index 034203f2..2269fc95 100644 --- a/src/openrouter/components/videogenerationrequest.py +++ b/src/openrouter/components/videogenerationrequest.py @@ -694,6 +694,8 @@ class VideoGenerationRequestTypedDict(TypedDict): r"""Aspect ratio of the generated video""" callback_url: NotRequired[str] r"""URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS.""" + creativity: NotRequired[int] + r"""Creativity level for video upscaling models only. This parameter is not supported by video generation models.""" duration: NotRequired[int] r"""Duration of the generated video in seconds""" frame_images: NotRequired[List[FrameImageTypedDict]] @@ -712,6 +714,8 @@ class VideoGenerationRequestTypedDict(TypedDict): r"""If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers.""" size: NotRequired[str] r"""Exact pixel dimensions of the generated video in \"WIDTHxHEIGHT\" format (e.g. \"1280x720\"). Interchangeable with resolution + aspect_ratio.""" + upscale_factor: NotRequired[float] + r"""Upscale factor for video upscaling models only. This parameter is not supported by video generation models.""" class VideoGenerationRequest(BaseModel): @@ -723,6 +727,9 @@ class VideoGenerationRequest(BaseModel): callback_url: Optional[str] = None r"""URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS.""" + creativity: Optional[int] = None + r"""Creativity level for video upscaling models only. This parameter is not supported by video generation models.""" + duration: Optional[int] = None r"""Duration of the generated video in seconds""" @@ -750,12 +757,16 @@ class VideoGenerationRequest(BaseModel): size: Optional[str] = None r"""Exact pixel dimensions of the generated video in \"WIDTHxHEIGHT\" format (e.g. \"1280x720\"). Interchangeable with resolution + aspect_ratio.""" + upscale_factor: Optional[float] = None + r"""Upscale factor for video upscaling models only. This parameter is not supported by video generation models.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( [ "aspect_ratio", "callback_url", + "creativity", "duration", "frame_images", "generate_audio", @@ -765,6 +776,7 @@ def serialize_model(self, handler): "resolution", "seed", "size", + "upscale_factor", ] ) serialized = handler(self) diff --git a/src/openrouter/components/videomodel.py b/src/openrouter/components/videomodel.py index 0c072a25..3dc009fb 100644 --- a/src/openrouter/components/videomodel.py +++ b/src/openrouter/components/videomodel.py @@ -122,6 +122,46 @@ ] +class UpscaleFactorTypedDict(TypedDict): + r"""Supported upscale factor range for video upscaling models""" + + max: NotRequired[Nullable[float]] + min: NotRequired[Nullable[float]] + + +class UpscaleFactor(BaseModel): + r"""Supported upscale factor range for video upscaling models""" + + max: OptionalNullable[float] = UNSET + + min: OptionalNullable[float] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["max", "min"]) + nullable_fields = set(["max", "min"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + class VideoModelTypedDict(TypedDict): allowed_passthrough_parameters: List[str] r"""List of parameters that are allowed to be passed through to the provider""" @@ -129,6 +169,8 @@ class VideoModelTypedDict(TypedDict): r"""Canonical slug for the model""" created: int r"""Unix timestamp of when the model was created""" + creativity: Nullable[List[int]] + r"""Supported creativity levels for video upscaling models""" generate_audio: Nullable[bool] r"""Whether the model supports generating audio alongside video""" id: str @@ -147,6 +189,8 @@ class VideoModelTypedDict(TypedDict): r"""Supported output resolutions""" supported_sizes: Nullable[List[SupportedSize]] r"""Supported output sizes (width x height)""" + upscale_factor: Nullable[UpscaleFactorTypedDict] + r"""Supported upscale factor range for video upscaling models""" description: NotRequired[str] r"""Description of the model""" hugging_face_id: NotRequired[Nullable[str]] @@ -165,6 +209,9 @@ class VideoModel(BaseModel): created: int r"""Unix timestamp of when the model was created""" + creativity: Nullable[List[int]] + r"""Supported creativity levels for video upscaling models""" + generate_audio: Nullable[bool] r"""Whether the model supports generating audio alongside video""" @@ -192,6 +239,9 @@ class VideoModel(BaseModel): supported_sizes: Nullable[List[SupportedSize]] r"""Supported output sizes (width x height)""" + upscale_factor: Nullable[UpscaleFactor] + r"""Supported upscale factor range for video upscaling models""" + description: Optional[str] = None r"""Description of the model""" @@ -206,6 +256,7 @@ def serialize_model(self, handler): optional_fields = set(["description", "hugging_face_id", "pricing_skus"]) nullable_fields = set( [ + "creativity", "generate_audio", "hugging_face_id", "pricing_skus", @@ -215,6 +266,7 @@ def serialize_model(self, handler): "supported_frame_images", "supported_resolutions", "supported_sizes", + "upscale_factor", ] ) serialized = handler(self) diff --git a/src/openrouter/video_generation.py b/src/openrouter/video_generation.py index 34a2f1e5..d6a2f5b2 100644 --- a/src/openrouter/video_generation.py +++ b/src/openrouter/video_generation.py @@ -22,6 +22,7 @@ def generate( x_open_router_categories: Optional[str] = None, aspect_ratio: Optional[components.VideoGenerationRequestAspectRatio] = None, callback_url: Optional[str] = None, + creativity: Optional[int] = None, duration: Optional[int] = None, frame_images: Optional[ Union[ @@ -46,6 +47,7 @@ def generate( resolution: Optional[components.VideoGenerationRequestResolution] = None, seed: Optional[int] = None, size: Optional[str] = None, + upscale_factor: Optional[float] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -65,6 +67,7 @@ def generate( :param aspect_ratio: Aspect ratio of the generated video :param callback_url: URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS. + :param creativity: Creativity level for video upscaling models only. This parameter is not supported by video generation models. :param duration: Duration of the generated video in seconds :param frame_images: Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame. :param generate_audio: Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set. @@ -74,6 +77,7 @@ def generate( :param resolution: Resolution of the generated video :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param size: Exact pixel dimensions of the generated video in \"WIDTHxHEIGHT\" format (e.g. \"1280x720\"). Interchangeable with resolution + aspect_ratio. + :param upscale_factor: Upscale factor for video upscaling models only. This parameter is not supported by video generation models. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -96,6 +100,7 @@ def generate( video_generation_request=components.VideoGenerationRequest( aspect_ratio=aspect_ratio, callback_url=callback_url, + creativity=creativity, duration=duration, frame_images=utils.get_pydantic_model( frame_images, Optional[List[components.FrameImage]] @@ -112,6 +117,7 @@ def generate( resolution=resolution, seed=seed, size=size, + upscale_factor=upscale_factor, ), ) @@ -228,6 +234,7 @@ async def generate_async( x_open_router_categories: Optional[str] = None, aspect_ratio: Optional[components.VideoGenerationRequestAspectRatio] = None, callback_url: Optional[str] = None, + creativity: Optional[int] = None, duration: Optional[int] = None, frame_images: Optional[ Union[ @@ -252,6 +259,7 @@ async def generate_async( resolution: Optional[components.VideoGenerationRequestResolution] = None, seed: Optional[int] = None, size: Optional[str] = None, + upscale_factor: Optional[float] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -271,6 +279,7 @@ async def generate_async( :param aspect_ratio: Aspect ratio of the generated video :param callback_url: URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS. + :param creativity: Creativity level for video upscaling models only. This parameter is not supported by video generation models. :param duration: Duration of the generated video in seconds :param frame_images: Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame. :param generate_audio: Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set. @@ -280,6 +289,7 @@ async def generate_async( :param resolution: Resolution of the generated video :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param size: Exact pixel dimensions of the generated video in \"WIDTHxHEIGHT\" format (e.g. \"1280x720\"). Interchangeable with resolution + aspect_ratio. + :param upscale_factor: Upscale factor for video upscaling models only. This parameter is not supported by video generation models. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -302,6 +312,7 @@ async def generate_async( video_generation_request=components.VideoGenerationRequest( aspect_ratio=aspect_ratio, callback_url=callback_url, + creativity=creativity, duration=duration, frame_images=utils.get_pydantic_model( frame_images, Optional[List[components.FrameImage]] @@ -318,6 +329,7 @@ async def generate_async( resolution=resolution, seed=seed, size=size, + upscale_factor=upscale_factor, ), ) diff --git a/uv.lock b/uv.lock index fa977930..0c706843 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.64" +version = "1.1.65" source = { editable = "." } dependencies = [ { name = "httpcore" }, From b984aaf4c99aa071f25eef177e8d681c8dce69d5 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 20:47:48 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow