Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
lockVersion: 2.0.0
id: c48cf606-fb42-4a45-9c23-8f0555307828
management:
docChecksum: 71c8ad142a8771298fc33c554a34f8fc
docChecksum: f789c2aa1b196ab1119a66a58241adce
docVersion: 1.0.0
speakeasyVersion: 1.803.2
generationVersion: 2.950.13
releaseVersion: 1.3.243
configChecksum: 8e8fac1cf7a5b30acc4669d7eb63eddb
releaseVersion: 1.3.244
configChecksum: bde88a04cadc45c76bfe5f1bf7458769
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
persistentEdits:
generation_id: 6bdd2415-f232-4697-92d4-abf14814fb8d
pristine_commit_hash: 4961056dbe17230f727025c9a4c87497bc6df72a
pristine_tree_hash: 27e7d504b0d273ab1c7ac6e88279046b7512a2f8
generation_id: d289e1ab-5ac2-44e1-bb10-7a98d1e5b80f
pristine_commit_hash: 59b1470526c9265a021a593caa8eeddaeae5009a
pristine_tree_hash: 6f1723c16973202f988d209bb87c6e98c060c241
features:
python:
acceptHeaders: 3.0.0
Expand Down Expand Up @@ -4448,8 +4448,8 @@ trackedFiles:
pristine_git_object: a470ef90ddcfdf10de7f040ffc8aee37d634306d
docs/components/imageendpoint.mdx:
id: d7d1514fbcd6
last_write_checksum: sha1:aa430d0cbe9e25d98c05942834aa0c77d1833821
pristine_git_object: 564ab03c845baf0833fd352cb5dc193f16269239
last_write_checksum: sha1:d71b13c3a4b40aba314505f878132eedb4b5a786
pristine_git_object: 318cd3065ceb9027d393c9ba01058e5a3a25a180
docs/components/imagegencallcompletedevent.mdx:
id: 16f72f044ccc
last_write_checksum: sha1:910bef169bc44743800d6586e780a714020a08c2
Expand Down Expand Up @@ -4770,6 +4770,10 @@ trackedFiles:
id: 033b801659d0
last_write_checksum: sha1:0e263e16a02ab441862930d01db2b1a5871ac2da
pristine_git_object: 2092337ea3b892e78fab5607d098d772376f655e
docs/components/inputimagerole.mdx:
id: a8a87a6a0c2a
last_write_checksum: sha1:6eedfe4f31ef76ca7bd48c794bddb9be031a7510
pristine_git_object: ad02aafa1dacae37a8aedd76165fb694e9c0b801
docs/components/inputimagetype.mdx:
id: 74ad50005674
last_write_checksum: sha1:f2fe452162811ec4f2a5325418a75c68d7bf4218
Expand Down Expand Up @@ -12656,8 +12660,8 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml:
id: 5d07e7d72637
last_write_checksum: sha1:b52626a9ac31d5773337db1c72e3bfb65d2c9fc3
pristine_git_object: 65b206f7393fad89ebbc4cb8414484eb4c6f828f
last_write_checksum: sha1:1f4dd3fa30629cff40ba23b19e04013a21e7a151
pristine_git_object: c0ed6597f551cd42d92e4cfcebd1ad317597b0ea
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
Expand All @@ -12684,8 +12688,8 @@ trackedFiles:
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
src/openrouter/_version.py:
id: d8d15ad6c586
last_write_checksum: sha1:ae87b6fb98e6501b6b99bc67b23105d8bff835cf
pristine_git_object: 5e770fce330c79c8ba36abfc7ea8d5962fd412b8
last_write_checksum: sha1:ac6d620946c7c675528e08cb6c822162d2f91a3f
pristine_git_object: be6ef088b6f383894681e8bd40ca3d39dbb8f203
src/openrouter/alpha.py:
id: 306c4d93308d
last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766
Expand Down Expand Up @@ -12732,8 +12736,8 @@ trackedFiles:
pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1
src/openrouter/components/__init__.py:
id: 81754e97b3f4
last_write_checksum: sha1:d0e4ce3143411726d62385d5d2234a9246de7c50
pristine_git_object: bbdce2c6c9e16f85cd1f886970294a54fcf54e2a
last_write_checksum: sha1:981d6840b9827a149a88da7d6c23c9c664484e0e
pristine_git_object: 45c3d7f6ca27f7e13d3b7393c5ddf30c221555df
src/openrouter/components/aabenchmarkentry.py:
id: e2e0f0b48c82
last_write_checksum: sha1:08125e1d60df82793e11e8aed6e3c9fdb7512ebb
Expand Down Expand Up @@ -14620,8 +14624,8 @@ trackedFiles:
pristine_git_object: 62c61b3a14000361f8a47e6f7aafb53cbdedc081
src/openrouter/components/imageendpoint.py:
id: 6466b0bedef0
last_write_checksum: sha1:d23af03705511e411f7dbe92876b4862e8ec6895
pristine_git_object: 20e9907afdff75fd947bba59e2b2ecbdd4798d61
last_write_checksum: sha1:4c49171c710ca2cfdffa272d4b766666ce4f44c2
pristine_git_object: bf0c18af337561ef024458811a8663c701e2cf87
src/openrouter/components/imagegencallcompletedevent.py:
id: cbf654faeb3e
last_write_checksum: sha1:8fb3e34408dd8b167afc6aad641de9cc2483c9f1
Expand Down Expand Up @@ -23395,3 +23399,6 @@ examples:
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
examplesVersion: 1.0.2
releaseNotes: |
## Python SDK Changes:
* `open_router.images.list_model_endpoints()`: `response.endpoints[].input_image_role` **Added**
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
python:
version: 1.3.243
version: 1.3.244
additionalDependencies:
dev:
pytest: '>=8.3'
Expand Down
8 changes: 8 additions & 0 deletions .speakeasy/out.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17617,6 +17617,14 @@ components:
items:
type: 'string'
type: 'array'
input_image_role:
description: 'How this endpoint uses input_references: edit transforms the input image; reference guides a new generation.'
enum:
- 'edit'
- 'reference'
example: 'edit'
type: 'string'
x-speakeasy-unknown-values: allow
input_modalities:
description: 'Typed inputs the model accepts, following the Models API V2 document.'
items:
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ speakeasyVersion: 1.803.2
sources:
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:10c3504a51db3373ac0499ee5053645406656196f2c57775bcb2ad46dfdcb1c9
sourceBlobDigest: sha256:42ba74d1683c77b46105c7531ef35a678bfb618574202f4e365a063a9a898659
sourceRevisionDigest: sha256:104e05c9ccb0764c3976195e839b42127ef778f73bf7e11dba495a2bb02703f4
sourceBlobDigest: sha256:780e4e87c2f64322ecf1a2ed2914460d923c452a80b7fc06f9feaf590b8369b1
tags:
- latest
- 1.0.0
targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:10c3504a51db3373ac0499ee5053645406656196f2c57775bcb2ad46dfdcb1c9
sourceBlobDigest: sha256:42ba74d1683c77b46105c7531ef35a678bfb618574202f4e365a063a9a898659
sourceRevisionDigest: sha256:104e05c9ccb0764c3976195e839b42127ef778f73bf7e11dba495a2bb02703f4
sourceBlobDigest: sha256:780e4e87c2f64322ecf1a2ed2914460d923c452a80b7fc06f9feaf590b8369b1
codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:ce53a5199d9041683635a2f8597fce589231288db7034d391e3bae057f338888
codeSamplesRevisionDigest: sha256:fbd2263cc835257060a4ef49c9a36198dfdfa2036cc7b3706431187c03cd5df4
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.803.2
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5199,4 +5199,14 @@ Based on:
### Generated
- [python v1.3.243] .
### Releases
- [PyPI v1.3.243] https://pypi.org/project/openrouter/1.3.243 - .
- [PyPI v1.3.243] https://pypi.org/project/openrouter/1.3.243 - .

## 2026-12-04 11:13:35
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v1.3.244] .
### Releases
- [PyPI v1.3.244] https://pypi.org/project/openrouter/1.3.244 - .
1 change: 1 addition & 0 deletions docs/components/imageendpoint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ An endpoint that serves a given image model.
| Field | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `allowed_passthrough_parameters` | List[*str*] | βœ”οΈ | Provider-specific options accepted under provider.options[provider_slug]. | [] |
| `input_image_role` | [Optional[components.InputImageRole]](../components/inputimagerole.mdx) | βž– | How this endpoint uses input_references: edit transforms the input image; reference guides a new generation. | edit |
| `input_modalities` | List[[components.ModelInputModalityV2](../components/modelinputmodalityv2.mdx)] | βž– | Typed inputs the model accepts, following the Models API V2 document. | |
| `output_modalities` | List[[components.ModelOutputModalityV2](../components/modeloutputmodalityv2.mdx)] | βž– | Typed outputs with the request fields each accepts, following the Models API V2 document. | |
| `pricing` | List[[components.ImagePricingEntry](../components/imagepricingentry.mdx)] | βœ”οΈ | Billable pricing lines for this endpoint. | [<br/>\{<br/>"billable": "output_image",<br/>"cost_usd": 0.05,<br/>"unit": "image"<br/>}<br/>] |
Expand Down
22 changes: 22 additions & 0 deletions docs/components/inputimagerole.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: "InputImageRole"
---

How this endpoint uses input_references: edit transforms the input image; reference guides a new generation.

## Example Usage

```python
from openrouter.components import InputImageRole

# Open enum: unrecognized values are captured as UnrecognizedStr
value: InputImageRole = "edit"
```


## Values

This is an open enum. Unrecognized values will not fail type checks.

- `"edit"`
- `"reference"`
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openrouter"
version = "1.3.243"
version = "1.3.244"
description = "Official Python Client SDK for OpenRouter."
authors = [{ name = "OpenRouter" },]
readme = "README-PYPI.md"
Expand Down
4 changes: 2 additions & 2 deletions src/openrouter/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import importlib.metadata

__title__: str = "openrouter"
__version__: str = "1.3.243"
__version__: str = "1.3.244"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.950.13"
__user_agent__: str = "speakeasy-sdk/python 1.3.243 2.950.13 1.0.0 openrouter"
__user_agent__: str = "speakeasy-sdk/python 1.3.244 2.950.13 1.0.0 openrouter"

try:
if __package__ is not None:
Expand Down
4 changes: 3 additions & 1 deletion src/openrouter/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2541,7 +2541,7 @@
GuardrailPolicyAssignmentStateTypedDict,
)
from .imageconfig import ImageConfig, ImageConfigTypedDict
from .imageendpoint import ImageEndpoint, ImageEndpointTypedDict
from .imageendpoint import ImageEndpoint, ImageEndpointTypedDict, InputImageRole
from .imagegencallcompletedevent import (
ImageGenCallCompletedEvent,
ImageGenCallCompletedEventType,
Expand Down Expand Up @@ -7451,6 +7451,7 @@
"InputImageDetail",
"InputImageMask",
"InputImageMaskTypedDict",
"InputImageRole",
"InputImageType",
"InputImageTypedDict",
"InputMessageItem",
Expand Down Expand Up @@ -11445,6 +11446,7 @@
"ImageConfigTypedDict": ".imageconfig",
"ImageEndpoint": ".imageendpoint",
"ImageEndpointTypedDict": ".imageendpoint",
"InputImageRole": ".imageendpoint",
"ImageGenCallCompletedEvent": ".imagegencallcompletedevent",
"ImageGenCallCompletedEventType": ".imagegencallcompletedevent",
"ImageGenCallCompletedEventTypedDict": ".imagegencallcompletedevent",
Expand Down
23 changes: 20 additions & 3 deletions src/openrouter/components/imageendpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@
from .imagepricingentry import ImagePricingEntry, ImagePricingEntryTypedDict
from .modelinputmodalityv2 import ModelInputModalityV2, ModelInputModalityV2TypedDict
from .modeloutputmodalityv2 import ModelOutputModalityV2, ModelOutputModalityV2TypedDict
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr
from pydantic import model_serializer
from typing import Dict, List, Optional
from typing import Dict, List, Literal, Optional, Union
from typing_extensions import NotRequired, TypedDict


InputImageRole = Union[
Literal[
"edit",
"reference",
],
UnrecognizedStr,
]
r"""How this endpoint uses input_references: edit transforms the input image; reference guides a new generation."""


class ImageEndpointTypedDict(TypedDict):
r"""An endpoint that serves a given image model."""

Expand All @@ -27,6 +37,8 @@ class ImageEndpointTypedDict(TypedDict):
supported_parameters: Dict[str, CapabilityDescriptorTypedDict]
supports_streaming: bool
r"""Whether this endpoint supports native SSE streaming (`stream: true` in the request)."""
input_image_role: NotRequired[InputImageRole]
r"""How this endpoint uses input_references: edit transforms the input image; reference guides a new generation."""
input_modalities: NotRequired[List[ModelInputModalityV2TypedDict]]
r"""Typed inputs the model accepts, following the Models API V2 document."""
output_modalities: NotRequired[List[ModelOutputModalityV2TypedDict]]
Expand Down Expand Up @@ -56,6 +68,9 @@ class ImageEndpoint(BaseModel):
supports_streaming: bool
r"""Whether this endpoint supports native SSE streaming (`stream: true` in the request)."""

input_image_role: Optional[InputImageRole] = None
r"""How this endpoint uses input_references: edit transforms the input image; reference guides a new generation."""

input_modalities: Optional[List[ModelInputModalityV2]] = None
r"""Typed inputs the model accepts, following the Models API V2 document."""

Expand All @@ -64,7 +79,9 @@ class ImageEndpoint(BaseModel):

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["input_modalities", "output_modalities"])
optional_fields = set(
["input_image_role", "input_modalities", "output_modalities"]
)
nullable_fields = set(["provider_tag"])
serialized = handler(self)
m = {}
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.