diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index 2c771fca..4c6206dd 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: 6152da50840ea472ac36de5480f9b2f4
+ docChecksum: db032b8ea274c4705542ebb675dded9e
docVersion: 1.0.0
speakeasyVersion: 1.803.2
generationVersion: 2.950.13
- releaseVersion: 1.3.128
- configChecksum: ce6c3b893b682a0f1c8373f02b5199ae
+ releaseVersion: 1.3.129
+ configChecksum: 6eacd486505b1d1218fd70daf545e658
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
persistentEdits:
- generation_id: a67b8607-c5fc-4330-833b-9192d52daccc
- pristine_commit_hash: 53155d6644f2aa88d3a1258b562dd0aeee98219d
- pristine_tree_hash: 681f2eeb68cb3f1d89525448913096df78da8339
+ generation_id: cf643e99-16f3-419e-93e6-7ffdb023654b
+ pristine_commit_hash: c0f6b92e248a160e41bc2c86794ea7d7993d7186
+ pristine_tree_hash: 3067f598d7a55537b1b6e018dc5cd96182ebe945
features:
python:
acceptHeaders: 3.0.0
@@ -4140,8 +4140,8 @@ trackedFiles:
pristine_git_object: bccd158982dba4b4ed810b98b5f7d4a6c04afaa7
docs/components/imagegenerationrequest.mdx:
id: b093cb0f5e81
- last_write_checksum: sha1:e959f62cf9d792b98fff4b9049397af6feffdfa0
- pristine_git_object: dd4b81c7691e25e1253570f1c26a4b4c9e0a93cc
+ last_write_checksum: sha1:27c16608a25d9c01367944ae327f2d4f6d341526
+ pristine_git_object: 39e8743149fc8e55e859a5ca14bba651bc1ea621
docs/components/imagegenerationrequestaspectratio.mdx:
id: bda89377f32d
last_write_checksum: sha1:58af560f1182c30c06f8d9413e9e7073038cdc99
@@ -4150,10 +4150,14 @@ trackedFiles:
id: cab3c6c6dfc6
last_write_checksum: sha1:ea6f2fa5f8f63600e2d1a67a784e6a93cf295975
pristine_git_object: 8501680bcfebabb3af52b518c01f732d18282120
+ docs/components/imagegenerationrequestimageurl.mdx:
+ id: bec658a4fbd7
+ last_write_checksum: sha1:9d877ffc82f167a19eabe781637dab59822a60bc
+ pristine_git_object: 304c295124abe063fb0d3df347e59849eaef5ef4
docs/components/imagegenerationrequestoutputformat.mdx:
id: 380f12bf77bd
- last_write_checksum: sha1:afb479dc34118828e988888a8f49e7a5a50a45ab
- pristine_git_object: 4901416246fb4e34fc9227d3dc0bbbc08aa717e2
+ last_write_checksum: sha1:6058a022aafe16fc2726553abc6fe036df191a52
+ pristine_git_object: c14274944a8f3644b30d99267832f02aa25d0d6e
docs/components/imagegenerationrequestquality.mdx:
id: 7699c7fce91f
last_write_checksum: sha1:a11821458c8b7951edb5ba7c827e1819b236d471
@@ -4162,6 +4166,10 @@ trackedFiles:
id: 5dcb01b22e48
last_write_checksum: sha1:e9988b6c6bb828aa024a766e8d78f98f825b2ddc
pristine_git_object: af076aee50627f2a3229b2c57c64f22d2e6c22a1
+ docs/components/imagegenerationrequesttype.mdx:
+ id: bdfd99eea1bc
+ last_write_checksum: sha1:40a7f3f0638e9a52fc358dff16834c1cd3871f11
+ pristine_git_object: cf889aea249ef88ede12f570f17d89d138645a2b
docs/components/imagegenerationresponse.mdx:
id: 094e477544e9
last_write_checksum: sha1:504f7c03629153c61d508d997c079dcf843694f9
@@ -4726,6 +4734,10 @@ trackedFiles:
id: f798eb0c37e5
last_write_checksum: sha1:5d6bef6f4625c91f704ac9499a26ba8feae0cb48
pristine_git_object: b01926a6c334894b342efde13f9bd5a7d896fd84
+ docs/components/markup.mdx:
+ id: e931d9d4c3cb
+ last_write_checksum: sha1:d93143c3ce209487242c9ef750b449f9c0df877b
+ pristine_git_object: f2754cc71f87b63eb4b3fa338b4a588807695d5a
docs/components/match.mdx:
id: 581f981d1b56
last_write_checksum: sha1:74c04f63cf00b7eada4b07a21a1e836ce12a94bd
@@ -10804,8 +10816,8 @@ trackedFiles:
pristine_git_object: 5549912bda5e7b96a81658a996a60715573f0603
docs/sdks/images/README.mdx:
id: 534a6c102c4f
- last_write_checksum: sha1:9a94123859c352dbc08387e1ea59756fd0f347db
- pristine_git_object: fa46dc09c893aadcb2c56921b973a019603010e1
+ last_write_checksum: sha1:e6afcda11b6fa507787f0260e872e51e2a5b5f9d
+ pristine_git_object: aa2008a0118c07ef31fd62ce81d12053dc1fc2aa
docs/sdks/models/README.mdx:
id: 58f1ca464e0b
last_write_checksum: sha1:2d106e4557b3c7602c77b7b7f237867a8736bb6c
@@ -10884,8 +10896,8 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml:
id: 5d07e7d72637
- last_write_checksum: sha1:22b40838d5d593ff0dd2a9295f3d96e8e73cc4ca
- pristine_git_object: 175db3bd3af16619bbd50a742ce5fb08b46120cd
+ last_write_checksum: sha1:9597962d069c1ddd38642e3959f8d5443aa5a1d5
+ pristine_git_object: fae1ed2a79e407c0c4dbc3c3801c690fd45f43ca
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
@@ -10912,8 +10924,8 @@ trackedFiles:
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
src/openrouter/_version.py:
id: d8d15ad6c586
- last_write_checksum: sha1:e9aba58992d35af57141736e6cb830783c50793e
- pristine_git_object: 907355fff6c943437aed0911f09b1842b3dc0c50
+ last_write_checksum: sha1:99d4294a7d1a4d5677d38c6cc105e24cb90f65b2
+ pristine_git_object: 8b271b6250204d1d142d92e51550e2de2beda088
src/openrouter/alpha.py:
id: 306c4d93308d
last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766
@@ -10960,8 +10972,8 @@ trackedFiles:
pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1
src/openrouter/components/__init__.py:
id: 81754e97b3f4
- last_write_checksum: sha1:48ad93d96227249948388186cfa57152de6547c2
- pristine_git_object: e9f2addc2139e9b103cb5dcaf7d83716d8c166bb
+ last_write_checksum: sha1:85310c54aa421d6aeec2cbb5728b6d09268f66bb
+ pristine_git_object: b0363175cb1e9ea0bb0697b89e04155e7c3d2dd0
src/openrouter/components/aabenchmarkentry.py:
id: e2e0f0b48c82
last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c
@@ -12688,8 +12700,8 @@ trackedFiles:
pristine_git_object: 010c0fa0e5022ab360e6b824d26e2c044682fd5c
src/openrouter/components/imagegenerationrequest.py:
id: f8291a7be9a0
- last_write_checksum: sha1:a2edac94246c81c7f86f92f1a66896eca2200965
- pristine_git_object: 10ece11aa6634f6b76db832d62bc42e359238342
+ last_write_checksum: sha1:31c65099ab7cd41604f121de7abad17cf3863978
+ pristine_git_object: ca824f4abeb7b1babb86010a4de0c57c153a5c43
src/openrouter/components/imagegenerationresponse.py:
id: 53354cd0cbfc
last_write_checksum: sha1:53f1cde7b8bfe4f9e786a76f6e57b0a1f76aced2
@@ -14728,8 +14740,8 @@ trackedFiles:
pristine_git_object: 89560b566073785535643e694c112bedbd3db13d
src/openrouter/images.py:
id: c4d7adf63ae0
- last_write_checksum: sha1:9bd5680ead1e403f61d81743e01dcb887b98363c
- pristine_git_object: c21152bd7ce24419c1952a778fb14b14e8381b12
+ last_write_checksum: sha1:9eab422c5ae39039b24468a49c5b436956455df7
+ pristine_git_object: 24e5d4cf2a091d39674763afe417c12bdb3b7518
src/openrouter/models/__init__.py:
id: ed73b93abb3f
last_write_checksum: sha1:932a790ae66ccd7d7022b39c659bcf72a664ebea
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index dd399590..ae72f9a9 100644
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -37,7 +37,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
python:
- version: 1.3.128
+ version: 1.3.129
additionalDependencies:
dev:
pytest: '>=8.3'
diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml
index 40b2d90d..b4d40e6c 100644
--- a/.speakeasy/out.openapi.yaml
+++ b/.speakeasy/out.openapi.yaml
@@ -15472,12 +15472,30 @@ components:
example: 'auto'
type: 'string'
x-speakeasy-unknown-values: allow
+ frame_count:
+ description: 'Number of animation frames (2-64) when `output_format` is `gif`. Only honored by models that produce animations (OpenAI gpt-image-2.6, generations only); ignored otherwise.'
+ example: 8
+ type: 'integer'
+ frame_duration_ms:
+ description: 'Display time of each animation frame in milliseconds (20-2000) when `output_format` is `gif`. Ignored by models that do not produce animations.'
+ example: 100
+ type: 'integer'
input_references:
description: 'Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.'
items:
$ref: '#/components/schemas/ContentPartImage'
maxItems: 16
type: 'array'
+ markup:
+ allOf:
+ - $ref: '#/components/schemas/ContentPartImage'
+ - properties: {}
+ type: 'object'
+ description: 'A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise.'
+ example:
+ image_url:
+ url: 'https://example.com/image.png'
+ type: 'image_url'
model:
description: 'The image generation model to use'
example: 'bytedance-seed/seedream-4.5'
@@ -15491,12 +15509,13 @@ components:
example: 100
type: 'integer'
output_format:
- description: 'Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.'
+ description: 'Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`).'
enum:
- 'png'
- 'jpeg'
- 'webp'
- 'svg'
+ - 'gif'
example: 'png'
type: 'string'
x-speakeasy-unknown-values: allow
diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index c44d6fec..70cf4c25 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:da46f1837bbc97d21d6a4f238d58830e4efb5135fb0fa92a9d5b21b17ca6b70b
- sourceBlobDigest: sha256:d5b092075ef29b9adc0c51a1ab1945b056815599f8b03d20715e0366d57dee7a
+ sourceRevisionDigest: sha256:947a564a5e27eb4a3871e6358c714e9b8d1993f06f4c1019df56bf8851c2bd12
+ sourceBlobDigest: sha256:f9eb30c1bd3667d87534aa6a661f7de3783298d340c6b631a959df9608245ce4
tags:
- latest
- 1.0.0
@@ -11,10 +11,10 @@ targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
- sourceRevisionDigest: sha256:da46f1837bbc97d21d6a4f238d58830e4efb5135fb0fa92a9d5b21b17ca6b70b
- sourceBlobDigest: sha256:d5b092075ef29b9adc0c51a1ab1945b056815599f8b03d20715e0366d57dee7a
+ sourceRevisionDigest: sha256:947a564a5e27eb4a3871e6358c714e9b8d1993f06f4c1019df56bf8851c2bd12
+ sourceBlobDigest: sha256:f9eb30c1bd3667d87534aa6a661f7de3783298d340c6b631a959df9608245ce4
codeSamplesNamespace: open-router-python-code-samples
- codeSamplesRevisionDigest: sha256:a90f918cbdf285c7446e74ba876819729afc9aeb5a31e8385339c73e8c2c5c1a
+ codeSamplesRevisionDigest: sha256:c4751683719fdbf1c7f6c08ea2cf2262525bc995be3f20cab7cdb7aa161c0065
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.803.2
diff --git a/RELEASES.md b/RELEASES.md
index 38c40026..3770cef2 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -4049,4 +4049,14 @@ Based on:
### Generated
- [python v1.3.128] .
### Releases
-- [PyPI v1.3.128] https://pypi.org/project/openrouter/1.3.128 - .
\ No newline at end of file
+- [PyPI v1.3.128] https://pypi.org/project/openrouter/1.3.128 - .
+
+## 2026-11-05 13:35:25
+### Changes
+Based on:
+- OpenAPI Doc
+- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [python v1.3.129] .
+### Releases
+- [PyPI v1.3.129] https://pypi.org/project/openrouter/1.3.129 - .
\ No newline at end of file
diff --git a/docs/components/imagegenerationrequest.mdx b/docs/components/imagegenerationrequest.mdx
index dd4b81c7..39e87431 100644
--- a/docs/components/imagegenerationrequest.mdx
+++ b/docs/components/imagegenerationrequest.mdx
@@ -11,11 +11,14 @@ Image generation request input
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `aspect_ratio` | [Optional[components.ImageGenerationRequestAspectRatio]](../components/imagegenerationrequestaspectratio.mdx) | ➖ | Normalized aspect ratio of the generated image. Providers clamp to their supported subset. | 16:9 |
| `background` | [Optional[components.ImageGenerationRequestBackground]](../components/imagegenerationrequestbackground.mdx) | ➖ | Background treatment. `transparent` requires an output_format that supports alpha (png or webp). | auto |
+| `frame_count` | *Optional[int]* | ➖ | Number of animation frames (2-64) when `output_format` is `gif`. Only honored by models that produce animations (OpenAI gpt-image-2.6, generations only); ignored otherwise. | 8 |
+| `frame_duration_ms` | *Optional[int]* | ➖ | Display time of each animation frame in milliseconds (20-2000) when `output_format` is `gif`. Ignored by models that do not produce animations. | 100 |
| `input_references` | List[[components.ContentPartImage](../components/contentpartimage.mdx)] | ➖ | Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. | |
+| `markup` | [Optional[components.Markup]](../components/markup.mdx) | ➖ | A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise. | \{
"image_url": \{
"url": "https://example.com/image.png"
},
"type": "image_url"
} |
| `model` | *str* | ✔️ | The image generation model to use | bytedance-seed/seedream-4.5 |
| `n` | *Optional[int]* | ➖ | Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. | 1 |
| `output_compression` | *Optional[int]* | ➖ | Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format "jpeg" or "webp"). | 100 |
-| `output_format` | [Optional[components.ImageGenerationRequestOutputFormat]](../components/imagegenerationrequestoutputformat.mdx) | ➖ | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. | png |
+| `output_format` | [Optional[components.ImageGenerationRequestOutputFormat]](../components/imagegenerationrequestoutputformat.mdx) | ➖ | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`). | png |
| `prompt` | *str* | ✔️ | Text description of the desired image | a red panda astronaut floating in space, studio lighting |
| `provider` | [Optional[components.ImageGenerationProviderPreferences]](../components/imagegenerationproviderpreferences.mdx) | ➖ | Provider routing preferences and provider-specific passthrough configuration. | \{
"allow_fallbacks": false,
"only": [
"google-ai-studio"
]
} |
| `quality` | [Optional[components.ImageGenerationRequestQuality]](../components/imagegenerationrequestquality.mdx) | ➖ | Rendering quality. Providers without a quality knob ignore this. | high |
diff --git a/docs/components/imagegenerationrequestimageurl.mdx b/docs/components/imagegenerationrequestimageurl.mdx
new file mode 100644
index 00000000..304c2951
--- /dev/null
+++ b/docs/components/imagegenerationrequestimageurl.mdx
@@ -0,0 +1,9 @@
+---
+title: "ImageGenerationRequestImageURL"
+---
+
+## Fields
+
+| Field | Type | Required | Description |
+| ------------------ | ------------------ | ------------------ | ------------------ |
+| `url` | *str* | ✔️ | N/A |
\ No newline at end of file
diff --git a/docs/components/imagegenerationrequestoutputformat.mdx b/docs/components/imagegenerationrequestoutputformat.mdx
index 49014162..c1427494 100644
--- a/docs/components/imagegenerationrequestoutputformat.mdx
+++ b/docs/components/imagegenerationrequestoutputformat.mdx
@@ -2,7 +2,7 @@
title: "ImageGenerationRequestOutputFormat"
---
-Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.
+Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`).
## Example Usage
@@ -22,3 +22,4 @@ This is an open enum. Unrecognized values will not fail type checks.
- `"jpeg"`
- `"webp"`
- `"svg"`
+- `"gif"`
diff --git a/docs/components/imagegenerationrequesttype.mdx b/docs/components/imagegenerationrequesttype.mdx
new file mode 100644
index 00000000..cf889aea
--- /dev/null
+++ b/docs/components/imagegenerationrequesttype.mdx
@@ -0,0 +1,15 @@
+---
+title: "ImageGenerationRequestType"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import ImageGenerationRequestType
+value: ImageGenerationRequestType = "image_url"
+```
+
+
+## Values
+
+- `"image_url"`
diff --git a/docs/components/markup.mdx b/docs/components/markup.mdx
new file mode 100644
index 00000000..f2754cc7
--- /dev/null
+++ b/docs/components/markup.mdx
@@ -0,0 +1,13 @@
+---
+title: "Markup"
+---
+
+A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise.
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
+| `image_url` | [components.ImageGenerationRequestImageURL](../components/imagegenerationrequestimageurl.mdx) | ✔️ | N/A |
+| `type` | [components.ImageGenerationRequestType](../components/imagegenerationrequesttype.mdx) | ✔️ | N/A |
\ No newline at end of file
diff --git a/docs/sdks/images/README.mdx b/docs/sdks/images/README.mdx
index fa46dc09..aa2008a0 100644
--- a/docs/sdks/images/README.mdx
+++ b/docs/sdks/images/README.mdx
@@ -51,10 +51,13 @@ with OpenRouter(
| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
| `aspect_ratio` | [Optional[components.ImageGenerationRequestAspectRatio]](../../components/imagegenerationrequestaspectratio.mdx) | ➖ | Normalized aspect ratio of the generated image. Providers clamp to their supported subset. | 16:9 |
| `background` | [Optional[components.ImageGenerationRequestBackground]](../../components/imagegenerationrequestbackground.mdx) | ➖ | Background treatment. `transparent` requires an output_format that supports alpha (png or webp). | auto |
+| `frame_count` | *Optional[int]* | ➖ | Number of animation frames (2-64) when `output_format` is `gif`. Only honored by models that produce animations (OpenAI gpt-image-2.6, generations only); ignored otherwise. | 8 |
+| `frame_duration_ms` | *Optional[int]* | ➖ | Display time of each animation frame in milliseconds (20-2000) when `output_format` is `gif`. Ignored by models that do not produce animations. | 100 |
| `input_references` | List[[components.ContentPartImage](../../components/contentpartimage.mdx)] | ➖ | Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. | |
+| `markup` | [Optional[components.Markup]](../../components/markup.mdx) | ➖ | A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise. | \{
"image_url": \{
"url": "https://example.com/image.png"
},
"type": "image_url"
} |
| `n` | *Optional[int]* | ➖ | Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. | 1 |
| `output_compression` | *Optional[int]* | ➖ | Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format "jpeg" or "webp"). | 100 |
-| `output_format` | [Optional[components.ImageGenerationRequestOutputFormat]](../../components/imagegenerationrequestoutputformat.mdx) | ➖ | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. | png |
+| `output_format` | [Optional[components.ImageGenerationRequestOutputFormat]](../../components/imagegenerationrequestoutputformat.mdx) | ➖ | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`). | png |
| `provider` | [Optional[components.ImageGenerationProviderPreferences]](../../components/imagegenerationproviderpreferences.mdx) | ➖ | Provider routing preferences and provider-specific passthrough configuration. | \{
"allow_fallbacks": false,
"only": [
"google-ai-studio"
]
} |
| `quality` | [Optional[components.ImageGenerationRequestQuality]](../../components/imagegenerationrequestquality.mdx) | ➖ | Rendering quality. Providers without a quality knob ignore this. | high |
| `resolution` | [Optional[components.ImageGenerationRequestResolution]](../../components/imagegenerationrequestresolution.mdx) | ➖ | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K |
diff --git a/pyproject.toml b/pyproject.toml
index 175db3bd..fae1ed2a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "openrouter"
-version = "1.3.128"
+version = "1.3.129"
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 907355ff..8b271b62 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.128"
+__version__: str = "1.3.129"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.950.13"
-__user_agent__: str = "speakeasy-sdk/python 1.3.128 2.950.13 1.0.0 openrouter"
+__user_agent__: str = "speakeasy-sdk/python 1.3.129 2.950.13 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 e9f2addc..b0363175 100644
--- a/src/openrouter/components/__init__.py
+++ b/src/openrouter/components/__init__.py
@@ -2337,10 +2337,15 @@
ImageGenerationRequest,
ImageGenerationRequestAspectRatio,
ImageGenerationRequestBackground,
+ ImageGenerationRequestImageURL,
+ ImageGenerationRequestImageURLTypedDict,
ImageGenerationRequestOutputFormat,
ImageGenerationRequestQuality,
ImageGenerationRequestResolution,
+ ImageGenerationRequestType,
ImageGenerationRequestTypedDict,
+ Markup,
+ MarkupTypedDict,
)
from .imagegenerationresponse import (
ImageGenerationResponse,
@@ -6425,9 +6430,12 @@
"ImageGenerationRequest",
"ImageGenerationRequestAspectRatio",
"ImageGenerationRequestBackground",
+ "ImageGenerationRequestImageURL",
+ "ImageGenerationRequestImageURLTypedDict",
"ImageGenerationRequestOutputFormat",
"ImageGenerationRequestQuality",
"ImageGenerationRequestResolution",
+ "ImageGenerationRequestType",
"ImageGenerationRequestTypedDict",
"ImageGenerationResponse",
"ImageGenerationResponseData",
@@ -6645,6 +6653,8 @@
"ManagedPrivateEndpointResponse",
"ManagedPrivateEndpointResponseTypedDict",
"ManagedPrivateEndpointTypedDict",
+ "Markup",
+ "MarkupTypedDict",
"Match",
"MatchTypedDict",
"MaxPrice",
@@ -9988,10 +9998,15 @@
"ImageGenerationRequest": ".imagegenerationrequest",
"ImageGenerationRequestAspectRatio": ".imagegenerationrequest",
"ImageGenerationRequestBackground": ".imagegenerationrequest",
+ "ImageGenerationRequestImageURL": ".imagegenerationrequest",
+ "ImageGenerationRequestImageURLTypedDict": ".imagegenerationrequest",
"ImageGenerationRequestOutputFormat": ".imagegenerationrequest",
"ImageGenerationRequestQuality": ".imagegenerationrequest",
"ImageGenerationRequestResolution": ".imagegenerationrequest",
+ "ImageGenerationRequestType": ".imagegenerationrequest",
"ImageGenerationRequestTypedDict": ".imagegenerationrequest",
+ "Markup": ".imagegenerationrequest",
+ "MarkupTypedDict": ".imagegenerationrequest",
"ImageGenerationResponse": ".imagegenerationresponse",
"ImageGenerationResponseData": ".imagegenerationresponse",
"ImageGenerationResponseDataTypedDict": ".imagegenerationresponse",
diff --git a/src/openrouter/components/imagegenerationrequest.py b/src/openrouter/components/imagegenerationrequest.py
index 10ece11a..ca824f4a 100644
--- a/src/openrouter/components/imagegenerationrequest.py
+++ b/src/openrouter/components/imagegenerationrequest.py
@@ -58,16 +58,43 @@
r"""Background treatment. `transparent` requires an output_format that supports alpha (png or webp)."""
+class ImageGenerationRequestImageURLTypedDict(TypedDict):
+ url: str
+
+
+class ImageGenerationRequestImageURL(BaseModel):
+ url: str
+
+
+ImageGenerationRequestType = Literal["image_url",]
+
+
+class MarkupTypedDict(TypedDict):
+ r"""A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise."""
+
+ image_url: ImageGenerationRequestImageURLTypedDict
+ type: ImageGenerationRequestType
+
+
+class Markup(BaseModel):
+ r"""A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise."""
+
+ image_url: ImageGenerationRequestImageURL
+
+ type: ImageGenerationRequestType
+
+
ImageGenerationRequestOutputFormat = Union[
Literal[
"png",
"jpeg",
"webp",
"svg",
+ "gif",
],
UnrecognizedStr,
]
-r"""Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`."""
+r"""Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`)."""
ImageGenerationRequestQuality = Union[
@@ -109,14 +136,20 @@ class ImageGenerationRequestTypedDict(TypedDict):
r"""Normalized aspect ratio of the generated image. Providers clamp to their supported subset."""
background: NotRequired[ImageGenerationRequestBackground]
r"""Background treatment. `transparent` requires an output_format that supports alpha (png or webp)."""
+ frame_count: NotRequired[int]
+ r"""Number of animation frames (2-64) when `output_format` is `gif`. Only honored by models that produce animations (OpenAI gpt-image-2.6, generations only); ignored otherwise."""
+ frame_duration_ms: NotRequired[int]
+ r"""Display time of each animation frame in milliseconds (20-2000) when `output_format` is `gif`. Ignored by models that do not produce animations."""
input_references: NotRequired[List[ContentPartImageTypedDict]]
r"""Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs."""
+ markup: NotRequired[MarkupTypedDict]
+ r"""A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise."""
n: NotRequired[int]
r"""Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1."""
output_compression: NotRequired[int]
r"""Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\")."""
output_format: NotRequired[ImageGenerationRequestOutputFormat]
- r"""Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`."""
+ r"""Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`)."""
provider: NotRequired[ImageGenerationProviderPreferencesTypedDict]
r"""Provider routing preferences and provider-specific passthrough configuration."""
quality: NotRequired[ImageGenerationRequestQuality]
@@ -152,9 +185,18 @@ class ImageGenerationRequest(BaseModel):
background: Optional[ImageGenerationRequestBackground] = None
r"""Background treatment. `transparent` requires an output_format that supports alpha (png or webp)."""
+ frame_count: Optional[int] = None
+ r"""Number of animation frames (2-64) when `output_format` is `gif`. Only honored by models that produce animations (OpenAI gpt-image-2.6, generations only); ignored otherwise."""
+
+ frame_duration_ms: Optional[int] = None
+ r"""Display time of each animation frame in milliseconds (20-2000) when `output_format` is `gif`. Ignored by models that do not produce animations."""
+
input_references: Optional[List[ContentPartImage]] = None
r"""Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs."""
+ markup: Optional[Markup] = None
+ r"""A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise."""
+
n: Optional[int] = None
r"""Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1."""
@@ -162,7 +204,7 @@ class ImageGenerationRequest(BaseModel):
r"""Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\")."""
output_format: Optional[ImageGenerationRequestOutputFormat] = None
- r"""Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`."""
+ r"""Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`)."""
provider: Optional[ImageGenerationProviderPreferences] = None
r"""Provider routing preferences and provider-specific passthrough configuration."""
@@ -197,7 +239,10 @@ def serialize_model(self, handler):
[
"aspect_ratio",
"background",
+ "frame_count",
+ "frame_duration_ms",
"input_references",
+ "markup",
"n",
"output_compression",
"output_format",
diff --git a/src/openrouter/images.py b/src/openrouter/images.py
index c21152bd..24e5d4cf 100644
--- a/src/openrouter/images.py
+++ b/src/openrouter/images.py
@@ -23,12 +23,15 @@ def generate(
x_open_router_categories: Optional[str] = None,
aspect_ratio: Optional[components.ImageGenerationRequestAspectRatio] = None,
background: Optional[components.ImageGenerationRequestBackground] = None,
+ frame_count: Optional[int] = None,
+ frame_duration_ms: Optional[int] = None,
input_references: Optional[
Union[
Iterable[components.ContentPartImage],
Iterable[components.ContentPartImageTypedDict],
]
] = None,
+ markup: Optional[Union[components.Markup, components.MarkupTypedDict]] = None,
n: Optional[int] = None,
output_compression: Optional[int] = None,
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
@@ -68,10 +71,13 @@ def generate(
:param aspect_ratio: Normalized aspect ratio of the generated image. Providers clamp to their supported subset.
:param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp).
+ :param frame_count: Number of animation frames (2-64) when `output_format` is `gif`. Only honored by models that produce animations (OpenAI gpt-image-2.6, generations only); ignored otherwise.
+ :param frame_duration_ms: Display time of each animation frame in milliseconds (20-2000) when `output_format` is `gif`. Ignored by models that do not produce animations.
:param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.
+ :param markup: A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise.
:param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\").
- :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.
+ :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`).
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
@@ -98,12 +104,15 @@ def generate(
x_open_router_categories: Optional[str] = None,
aspect_ratio: Optional[components.ImageGenerationRequestAspectRatio] = None,
background: Optional[components.ImageGenerationRequestBackground] = None,
+ frame_count: Optional[int] = None,
+ frame_duration_ms: Optional[int] = None,
input_references: Optional[
Union[
Iterable[components.ContentPartImage],
Iterable[components.ContentPartImageTypedDict],
]
] = None,
+ markup: Optional[Union[components.Markup, components.MarkupTypedDict]] = None,
n: Optional[int] = None,
output_compression: Optional[int] = None,
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
@@ -143,10 +152,13 @@ def generate(
:param aspect_ratio: Normalized aspect ratio of the generated image. Providers clamp to their supported subset.
:param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp).
+ :param frame_count: Number of animation frames (2-64) when `output_format` is `gif`. Only honored by models that produce animations (OpenAI gpt-image-2.6, generations only); ignored otherwise.
+ :param frame_duration_ms: Display time of each animation frame in milliseconds (20-2000) when `output_format` is `gif`. Ignored by models that do not produce animations.
:param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.
+ :param markup: A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise.
:param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\").
- :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.
+ :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`).
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
@@ -173,12 +185,15 @@ def generate(
x_open_router_categories: Optional[str] = None,
aspect_ratio: Optional[components.ImageGenerationRequestAspectRatio] = None,
background: Optional[components.ImageGenerationRequestBackground] = None,
+ frame_count: Optional[int] = None,
+ frame_duration_ms: Optional[int] = None,
input_references: Optional[
Union[
Iterable[components.ContentPartImage],
Iterable[components.ContentPartImageTypedDict],
]
] = None,
+ markup: Optional[Union[components.Markup, components.MarkupTypedDict]] = None,
n: Optional[int] = None,
output_compression: Optional[int] = None,
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
@@ -221,10 +236,13 @@ def generate(
:param aspect_ratio: Normalized aspect ratio of the generated image. Providers clamp to their supported subset.
:param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp).
+ :param frame_count: Number of animation frames (2-64) when `output_format` is `gif`. Only honored by models that produce animations (OpenAI gpt-image-2.6, generations only); ignored otherwise.
+ :param frame_duration_ms: Display time of each animation frame in milliseconds (20-2000) when `output_format` is `gif`. Ignored by models that do not produce animations.
:param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.
+ :param markup: A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise.
:param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\").
- :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.
+ :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`).
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
@@ -250,12 +268,15 @@ def generate(
x_open_router_categories: Optional[str] = None,
aspect_ratio: Optional[components.ImageGenerationRequestAspectRatio] = None,
background: Optional[components.ImageGenerationRequestBackground] = None,
+ frame_count: Optional[int] = None,
+ frame_duration_ms: Optional[int] = None,
input_references: Optional[
Union[
Iterable[components.ContentPartImage],
Iterable[components.ContentPartImageTypedDict],
]
] = None,
+ markup: Optional[Union[components.Markup, components.MarkupTypedDict]] = None,
n: Optional[int] = None,
output_compression: Optional[int] = None,
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
@@ -298,10 +319,13 @@ def generate(
:param aspect_ratio: Normalized aspect ratio of the generated image. Providers clamp to their supported subset.
:param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp).
+ :param frame_count: Number of animation frames (2-64) when `output_format` is `gif`. Only honored by models that produce animations (OpenAI gpt-image-2.6, generations only); ignored otherwise.
+ :param frame_duration_ms: Display time of each animation frame in milliseconds (20-2000) when `output_format` is `gif`. Ignored by models that do not produce animations.
:param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.
+ :param markup: A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise.
:param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\").
- :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.
+ :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`).
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
@@ -333,9 +357,12 @@ def generate(
image_generation_request=components.ImageGenerationRequest(
aspect_ratio=aspect_ratio,
background=background,
+ frame_count=frame_count,
+ frame_duration_ms=frame_duration_ms,
input_references=utils.get_pydantic_model(
input_references, Optional[List[components.ContentPartImage]]
),
+ markup=utils.get_pydantic_model(markup, Optional[components.Markup]),
model=model,
n=n,
output_compression=output_compression,
@@ -538,12 +565,15 @@ async def generate_async(
x_open_router_categories: Optional[str] = None,
aspect_ratio: Optional[components.ImageGenerationRequestAspectRatio] = None,
background: Optional[components.ImageGenerationRequestBackground] = None,
+ frame_count: Optional[int] = None,
+ frame_duration_ms: Optional[int] = None,
input_references: Optional[
Union[
Iterable[components.ContentPartImage],
Iterable[components.ContentPartImageTypedDict],
]
] = None,
+ markup: Optional[Union[components.Markup, components.MarkupTypedDict]] = None,
n: Optional[int] = None,
output_compression: Optional[int] = None,
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
@@ -583,10 +613,13 @@ async def generate_async(
:param aspect_ratio: Normalized aspect ratio of the generated image. Providers clamp to their supported subset.
:param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp).
+ :param frame_count: Number of animation frames (2-64) when `output_format` is `gif`. Only honored by models that produce animations (OpenAI gpt-image-2.6, generations only); ignored otherwise.
+ :param frame_duration_ms: Display time of each animation frame in milliseconds (20-2000) when `output_format` is `gif`. Ignored by models that do not produce animations.
:param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.
+ :param markup: A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise.
:param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\").
- :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.
+ :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`).
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
@@ -613,12 +646,15 @@ async def generate_async(
x_open_router_categories: Optional[str] = None,
aspect_ratio: Optional[components.ImageGenerationRequestAspectRatio] = None,
background: Optional[components.ImageGenerationRequestBackground] = None,
+ frame_count: Optional[int] = None,
+ frame_duration_ms: Optional[int] = None,
input_references: Optional[
Union[
Iterable[components.ContentPartImage],
Iterable[components.ContentPartImageTypedDict],
]
] = None,
+ markup: Optional[Union[components.Markup, components.MarkupTypedDict]] = None,
n: Optional[int] = None,
output_compression: Optional[int] = None,
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
@@ -658,10 +694,13 @@ async def generate_async(
:param aspect_ratio: Normalized aspect ratio of the generated image. Providers clamp to their supported subset.
:param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp).
+ :param frame_count: Number of animation frames (2-64) when `output_format` is `gif`. Only honored by models that produce animations (OpenAI gpt-image-2.6, generations only); ignored otherwise.
+ :param frame_duration_ms: Display time of each animation frame in milliseconds (20-2000) when `output_format` is `gif`. Ignored by models that do not produce animations.
:param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.
+ :param markup: A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise.
:param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\").
- :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.
+ :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`).
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
@@ -688,12 +727,15 @@ async def generate_async(
x_open_router_categories: Optional[str] = None,
aspect_ratio: Optional[components.ImageGenerationRequestAspectRatio] = None,
background: Optional[components.ImageGenerationRequestBackground] = None,
+ frame_count: Optional[int] = None,
+ frame_duration_ms: Optional[int] = None,
input_references: Optional[
Union[
Iterable[components.ContentPartImage],
Iterable[components.ContentPartImageTypedDict],
]
] = None,
+ markup: Optional[Union[components.Markup, components.MarkupTypedDict]] = None,
n: Optional[int] = None,
output_compression: Optional[int] = None,
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
@@ -736,10 +778,13 @@ async def generate_async(
:param aspect_ratio: Normalized aspect ratio of the generated image. Providers clamp to their supported subset.
:param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp).
+ :param frame_count: Number of animation frames (2-64) when `output_format` is `gif`. Only honored by models that produce animations (OpenAI gpt-image-2.6, generations only); ignored otherwise.
+ :param frame_duration_ms: Display time of each animation frame in milliseconds (20-2000) when `output_format` is `gif`. Ignored by models that do not produce animations.
:param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.
+ :param markup: A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise.
:param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\").
- :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.
+ :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`).
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
@@ -765,12 +810,15 @@ async def generate_async(
x_open_router_categories: Optional[str] = None,
aspect_ratio: Optional[components.ImageGenerationRequestAspectRatio] = None,
background: Optional[components.ImageGenerationRequestBackground] = None,
+ frame_count: Optional[int] = None,
+ frame_duration_ms: Optional[int] = None,
input_references: Optional[
Union[
Iterable[components.ContentPartImage],
Iterable[components.ContentPartImageTypedDict],
]
] = None,
+ markup: Optional[Union[components.Markup, components.MarkupTypedDict]] = None,
n: Optional[int] = None,
output_compression: Optional[int] = None,
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
@@ -813,10 +861,13 @@ async def generate_async(
:param aspect_ratio: Normalized aspect ratio of the generated image. Providers clamp to their supported subset.
:param background: Background treatment. `transparent` requires an output_format that supports alpha (png or webp).
+ :param frame_count: Number of animation frames (2-64) when `output_format` is `gif`. Only honored by models that produce animations (OpenAI gpt-image-2.6, generations only); ignored otherwise.
+ :param frame_duration_ms: Display time of each animation frame in milliseconds (20-2000) when `output_format` is `gif`. Ignored by models that do not produce animations.
:param input_references: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.
+ :param markup: A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise.
:param n: Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format \"jpeg\" or \"webp\").
- :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.
+ :param output_format: Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`).
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
@@ -848,9 +899,12 @@ async def generate_async(
image_generation_request=components.ImageGenerationRequest(
aspect_ratio=aspect_ratio,
background=background,
+ frame_count=frame_count,
+ frame_duration_ms=frame_duration_ms,
input_references=utils.get_pydantic_model(
input_references, Optional[List[components.ContentPartImage]]
),
+ markup=utils.get_pydantic_model(markup, Optional[components.Markup]),
model=model,
n=n,
output_compression=output_compression,
diff --git a/uv.lock b/uv.lock
index 6785ac7b..1a6a7436 100644
--- a/uv.lock
+++ b/uv.lock
@@ -231,7 +231,7 @@ wheels = [
[[package]]
name = "openrouter"
-version = "1.3.128"
+version = "1.3.129"
source = { editable = "." }
dependencies = [
{ name = "httpcore" },