diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index f7e6866c..973527c1 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: 5fef1881cb8a1de0e83efde8d77faf74 + docChecksum: 324e5e9417697fdd19ac40dbdee29092 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.152 - configChecksum: 78ed5c653eaf792d9360e0931c2f766e + releaseVersion: 1.1.153 + configChecksum: 1b1e98d91f1d9f955c562b44db842a80 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 74c5e9bc-a7d9-42fd-b85c-ac8919abde8f - pristine_commit_hash: e39a1aaa41102958f1940d05c84991d81c2dabfd - pristine_tree_hash: 3a3ad835ef2a647514fc8afbc4a4bf99cb3f0a0c + generation_id: d17916fa-f2c2-4c10-a368-d022ee4cea26 + pristine_commit_hash: 4308baa564414b4c16cf56988b4de95fa6b3748b + pristine_tree_hash: 53611524c08c7f544a475792d4162569b168363d features: python: acceptHeaders: 3.0.0 @@ -6298,8 +6298,8 @@ trackedFiles: pristine_git_object: b5031668ec1156a4157609e4812b7a3937b802a2 docs/operations/createaudiotranscriptionsmultipartrequestbody.mdx: id: 0550cc56c73a - last_write_checksum: sha1:c15b1a62c475511e194d9a5b7b2ed240e369a4d1 - pristine_git_object: 3054ebe9dc2b1c40dbac7a5b387a57a89c468bdc + last_write_checksum: sha1:45ce0af51dcacc830616021ab7c8288373983a01 + pristine_git_object: 654d92baa9e84a3f25074f605c7b28654eb5adbc docs/operations/createaudiotranscriptionsrequest.mdx: id: 68a813383936 last_write_checksum: sha1:a3ad7e4691917927539d6c614788da7f4d6b4892 @@ -7742,8 +7742,8 @@ trackedFiles: pristine_git_object: c7435646cf280b7b2fbb2805b2cde15b4c570896 docs/sdks/stt/README.mdx: id: 190b0dc9a5d1 - last_write_checksum: sha1:c183265bd06b51f339aca6432cf255dad8804e85 - pristine_git_object: 67a89362fa0b41a55357fe305a5c77ceef915d3c + last_write_checksum: sha1:9a13f8f1e26550bccf3935a36e9c3426febc6fcb + pristine_git_object: 1a12d8375fe6ddf9ef6ee1911ce0ed6831a16942 docs/sdks/tts/README.mdx: id: cd1132543884 last_write_checksum: sha1:37918eb124f9ae0234e8047be7ec07a955458cbc @@ -7766,8 +7766,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:3cfc9ee899cdda5cca4600e751d5e69f8c39563b - pristine_git_object: 062b23a1d3bf00497f224ab89f718834158da4e8 + last_write_checksum: sha1:fd4d921e42e46b6699e830c81e753256bbea0319 + pristine_git_object: 45e7d66074138141c0a1d58ac0060b708a5a897e scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7794,8 +7794,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:25ce11eca3b8530378dc4fef1340532c46a74db9 - pristine_git_object: 02a088a4c37a08ba118bf4b3810e9c27dea7e26c + last_write_checksum: sha1:f1b890fd1369a6a362ed7f88a9a369cc66501fb3 + pristine_git_object: 1ce83d17236585b76fe03355f52f670179995cd8 src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:1e0004d8d1d5d797e2b54cd1cabeb7f9489d08e9 @@ -10626,8 +10626,8 @@ trackedFiles: pristine_git_object: 4e8414f223370bff1e4f060919f36f70da6ec40c src/openrouter/operations/createaudiotranscriptions_multipart.py: id: da07d463225a - last_write_checksum: sha1:a267131b5e9d8803f51431bbbc96a29484e97f0b - pristine_git_object: ff5459ee49af5fabed9c5e9a68979b923a7c4e9b + last_write_checksum: sha1:a0d6838eba0635f3057db76527784340e1bf9743 + pristine_git_object: 30c86b20152166e13b91cd3d4bfd1082675702c8 src/openrouter/operations/createauthkeyscode.py: id: 4253a437de22 last_write_checksum: sha1:8f496fd0e965aba76a0882a3af0382649d0f8c4d @@ -11070,8 +11070,8 @@ trackedFiles: pristine_git_object: 26433165a0b1c25d7bd3115b9b129b18f2dc9387 src/openrouter/stt.py: id: fc0c2f669423 - last_write_checksum: sha1:ac1f83bdae9bc71bdd68c5f70fe57f726808f6da - pristine_git_object: d9a7e94f050d37133489799052b5313b92c42052 + last_write_checksum: sha1:294961a1d783e04ac54c3733e4563494e241fcd7 + pristine_git_object: 7502cb976473e1324ca78330ed0f22505d01c925 src/openrouter/tts.py: id: 5055d4b95f1d last_write_checksum: sha1:cdeb84948a22d150b582c65b63a53bfab5c13109 @@ -14211,10 +14211,4 @@ examples: examplesVersion: 1.0.2 releaseNotes: | ## Python SDK Changes: - * `open_router.vault.list_intern_vault_secrets()`: **Added** - * `open_router.vault.delete_intern_vault_secret()`: **Added** - * `open_router.vault.store_intern_vault_secret()`: **Added** - * `open_router.vault.copy_vault_secrets_to_intern()`: **Added** - * `open_router.vault.list_vault_secrets()`: **Added** - * `open_router.vault.delete_vault_secret()`: **Added** - * `open_router.vault.store_vault_secret()`: **Added** + * `open_router.stt.create_transcription_multipart()`: `request` **Changed** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 5be40c24..ffc2b992 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.152 + version: 1.1.153 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 8dceac98..bca80c55 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -29339,6 +29339,10 @@ paths: - 'verbose_json' type: 'string' x-speakeasy-unknown-values: allow + session_id: + description: 'A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence.' + maxLength: 256 + type: 'string' temperature: description: 'The sampling temperature.' type: 'number' @@ -29351,6 +29355,13 @@ paths: type: 'string' x-speakeasy-unknown-values: allow type: 'array' + trace: + description: 'JSON-encoded trace metadata object (trace_id, trace_name, span_name, generation_name, parent_span_id and custom keys) attached to the Broadcast trace. Must decode to a JSON object.' + type: 'string' + user: + description: 'A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.' + maxLength: 256 + type: 'string' required: - 'file' - 'model' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index dc768787..d11b15d4 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:f372695c8d95f0486ae2494a35f43d3143679a95c48ec8fac077a3827484ae81 - sourceBlobDigest: sha256:3c5b24e2b7e270598cf25304fb459757f30c7da5b495e1058d65c4c3c19830b2 + sourceRevisionDigest: sha256:75aa60b9bf581640f76674835075b94f849acb002b47cc83c3a3d1fb79b033a9 + sourceBlobDigest: sha256:6bd42aec1d1358ebf45a46d4800e77bf6b62555942de153a65e2eb72894cc9cb tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:f372695c8d95f0486ae2494a35f43d3143679a95c48ec8fac077a3827484ae81 - sourceBlobDigest: sha256:3c5b24e2b7e270598cf25304fb459757f30c7da5b495e1058d65c4c3c19830b2 + sourceRevisionDigest: sha256:75aa60b9bf581640f76674835075b94f849acb002b47cc83c3a3d1fb79b033a9 + sourceBlobDigest: sha256:6bd42aec1d1358ebf45a46d4800e77bf6b62555942de153a65e2eb72894cc9cb codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:c9a74e74510bfbe06a5613e792d32fdaf7f9409dc8d66e7503a1c498f83d3cfd + codeSamplesRevisionDigest: sha256:4933127c25c73a3a8890225176081e40f10cbdf634015f135beb4c13c0992dcd workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index eae17b53..9fd4868b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2309,4 +2309,14 @@ Based on: ### Generated - [python v1.1.152] . ### Releases -- [PyPI v1.1.152] https://pypi.org/project/openrouter/1.1.152 - . \ No newline at end of file +- [PyPI v1.1.152] https://pypi.org/project/openrouter/1.1.152 - . + +## 2026-09-16 20:40:25 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.153] . +### Releases +- [PyPI v1.1.153] https://pypi.org/project/openrouter/1.1.153 - . \ No newline at end of file diff --git a/docs/operations/createaudiotranscriptionsmultipartrequestbody.mdx b/docs/operations/createaudiotranscriptionsmultipartrequestbody.mdx index 3054ebe9..654d92ba 100644 --- a/docs/operations/createaudiotranscriptionsmultipartrequestbody.mdx +++ b/docs/operations/createaudiotranscriptionsmultipartrequestbody.mdx @@ -4,11 +4,14 @@ title: "CreateAudioTranscriptionsMultipartRequestBody" ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `file` | [operations.CreateAudioTranscriptionsMultipartFile](../operations/createaudiotranscriptionsmultipartfile.mdx) | :heavy_check_mark: | The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio. | -| `language` | *Optional[str]* | :heavy_minus_sign: | The language of the input audio (ISO-639-1). | -| `model` | *str* | :heavy_check_mark: | The model to use for transcription. | -| `response_format` | [Optional[operations.ResponseFormat]](../operations/responseformat.mdx) | :heavy_minus_sign: | The response format. "json" (default) returns \{ text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). | -| `temperature` | *Optional[float]* | :heavy_minus_sign: | The sampling temperature. | -| `timestamp_granularities` | List[[operations.TimestampGranularities](../operations/timestampgranularities.mdx)] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `file` | [operations.CreateAudioTranscriptionsMultipartFile](../operations/createaudiotranscriptionsmultipartfile.mdx) | :heavy_check_mark: | The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio. | +| `language` | *Optional[str]* | :heavy_minus_sign: | The language of the input audio (ISO-639-1). | +| `model` | *str* | :heavy_check_mark: | The model to use for transcription. | +| `response_format` | [Optional[operations.ResponseFormat]](../operations/responseformat.mdx) | :heavy_minus_sign: | The response format. "json" (default) returns \{ text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). | +| `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | The sampling temperature. | +| `timestamp_granularities` | List[[operations.TimestampGranularities](../operations/timestampgranularities.mdx)] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array. | +| `trace` | *Optional[str]* | :heavy_minus_sign: | JSON-encoded trace metadata object (trace_id, trace_name, span_name, generation_name, parent_span_id and custom keys) attached to the Broadcast trace. Must decode to a JSON object. | +| `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. | \ No newline at end of file diff --git a/docs/sdks/stt/README.mdx b/docs/sdks/stt/README.mdx index 67a89362..1a12d837 100644 --- a/docs/sdks/stt/README.mdx +++ b/docs/sdks/stt/README.mdx @@ -112,18 +112,21 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `file` | [operations.CreateAudioTranscriptionsMultipartFile](../../operations/createaudiotranscriptionsmultipartfile.mdx) | :heavy_check_mark: | The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio. | -| `model` | *str* | :heavy_check_mark: | The model to use for transcription. | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `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.
| -| `language` | *Optional[str]* | :heavy_minus_sign: | The language of the input audio (ISO-639-1). | -| `response_format` | [Optional[operations.ResponseFormat]](../../operations/responseformat.mdx) | :heavy_minus_sign: | The response format. "json" (default) returns \{ text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). | -| `temperature` | *Optional[float]* | :heavy_minus_sign: | The sampling temperature. | -| `timestamp_granularities` | List[[operations.TimestampGranularities](../../operations/timestampgranularities.mdx)] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `file` | [operations.CreateAudioTranscriptionsMultipartFile](../../operations/createaudiotranscriptionsmultipartfile.mdx) | :heavy_check_mark: | The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio. | +| `model` | *str* | :heavy_check_mark: | The model to use for transcription. | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `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.
| +| `language` | *Optional[str]* | :heavy_minus_sign: | The language of the input audio (ISO-639-1). | +| `response_format` | [Optional[operations.ResponseFormat]](../../operations/responseformat.mdx) | :heavy_minus_sign: | The response format. "json" (default) returns \{ text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). | +| `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | The sampling temperature. | +| `timestamp_granularities` | List[[operations.TimestampGranularities](../../operations/timestampgranularities.mdx)] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array. | +| `trace` | *Optional[str]* | :heavy_minus_sign: | JSON-encoded trace metadata object (trace_id, trace_name, span_name, generation_name, parent_span_id and custom keys) attached to the Broadcast trace. Must decode to a JSON object. | +| `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. | +| `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 062b23a1..45e7d660 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.152" +version = "1.1.153" 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 02a088a4..1ce83d17 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.152" +__version__: str = "1.1.153" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.152 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.153 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/operations/createaudiotranscriptions_multipart.py b/src/openrouter/operations/createaudiotranscriptions_multipart.py index ff5459ee..30c86b20 100644 --- a/src/openrouter/operations/createaudiotranscriptions_multipart.py +++ b/src/openrouter/operations/createaudiotranscriptions_multipart.py @@ -147,10 +147,16 @@ class CreateAudioTranscriptionsMultipartRequestBodyTypedDict(TypedDict): r"""The language of the input audio (ISO-639-1).""" response_format: NotRequired[ResponseFormat] r"""The response format. \"json\" (default) returns { text, usage }; \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only).""" + session_id: NotRequired[str] + r"""A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence.""" temperature: NotRequired[float] r"""The sampling temperature.""" timestamp_granularities: NotRequired[List[TimestampGranularities]] r"""Timestamp detail levels to include when response_format is \"verbose_json\". \"word\" additionally returns word-level timestamps in the words array.""" + trace: NotRequired[str] + r"""JSON-encoded trace metadata object (trace_id, trace_name, span_name, generation_name, parent_span_id and custom keys) attached to the Broadcast trace. Must decode to a JSON object.""" + user: NotRequired[str] + r"""A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.""" class CreateAudioTranscriptionsMultipartRequestBody(BaseModel): @@ -171,6 +177,9 @@ class CreateAudioTranscriptionsMultipartRequestBody(BaseModel): ] = None r"""The response format. \"json\" (default) returns { text, usage }; \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only).""" + session_id: Annotated[Optional[str], FieldMetadata(multipart=True)] = None + r"""A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence.""" + temperature: Annotated[Optional[float], FieldMetadata(multipart=True)] = None r"""The sampling temperature.""" @@ -181,10 +190,24 @@ class CreateAudioTranscriptionsMultipartRequestBody(BaseModel): ] = None r"""Timestamp detail levels to include when response_format is \"verbose_json\". \"word\" additionally returns word-level timestamps in the words array.""" + trace: Annotated[Optional[str], FieldMetadata(multipart=True)] = None + r"""JSON-encoded trace metadata object (trace_id, trace_name, span_name, generation_name, parent_span_id and custom keys) attached to the Broadcast trace. Must decode to a JSON object.""" + + user: Annotated[Optional[str], FieldMetadata(multipart=True)] = None + r"""A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["language", "response_format", "temperature", "timestamp_granularities[]"] + [ + "language", + "response_format", + "session_id", + "temperature", + "timestamp_granularities[]", + "trace", + "user", + ] ) serialized = handler(self) m = {} diff --git a/src/openrouter/stt.py b/src/openrouter/stt.py index d9a7e94f..7502cb97 100644 --- a/src/openrouter/stt.py +++ b/src/openrouter/stt.py @@ -471,10 +471,13 @@ def create_transcription_multipart( x_open_router_categories: Optional[str] = None, language: Optional[str] = None, response_format: Optional[operations.ResponseFormat] = None, + session_id: Optional[str] = None, temperature: Optional[float] = None, timestamp_granularities: Optional[ Iterable[operations.TimestampGranularities] ] = None, + trace: Optional[str] = None, + user: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -495,8 +498,11 @@ def create_transcription_multipart( :param language: The language of the input audio (ISO-639-1). :param response_format: The response format. \"json\" (default) returns { text, usage }; \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). + :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. :param temperature: The sampling temperature. :param timestamp_granularities: Timestamp detail levels to include when response_format is \"verbose_json\". \"word\" additionally returns word-level timestamps in the words array. + :param trace: JSON-encoded trace metadata object (trace_id, trace_name, span_name, generation_name, parent_span_id and custom keys) attached to the Broadcast trace. Must decode to a JSON object. + :param user: A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. :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 @@ -523,11 +529,14 @@ def create_transcription_multipart( language=language, model=model, response_format=response_format, + session_id=session_id, temperature=temperature, timestamp_granularities=utils.unmarshal( timestamp_granularities, Optional[List[operations.TimestampGranularities]], ), + trace=trace, + user=user, ), ) @@ -683,10 +692,13 @@ async def create_transcription_multipart_async( x_open_router_categories: Optional[str] = None, language: Optional[str] = None, response_format: Optional[operations.ResponseFormat] = None, + session_id: Optional[str] = None, temperature: Optional[float] = None, timestamp_granularities: Optional[ Iterable[operations.TimestampGranularities] ] = None, + trace: Optional[str] = None, + user: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -707,8 +719,11 @@ async def create_transcription_multipart_async( :param language: The language of the input audio (ISO-639-1). :param response_format: The response format. \"json\" (default) returns { text, usage }; \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). + :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. :param temperature: The sampling temperature. :param timestamp_granularities: Timestamp detail levels to include when response_format is \"verbose_json\". \"word\" additionally returns word-level timestamps in the words array. + :param trace: JSON-encoded trace metadata object (trace_id, trace_name, span_name, generation_name, parent_span_id and custom keys) attached to the Broadcast trace. Must decode to a JSON object. + :param user: A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. :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 @@ -735,11 +750,14 @@ async def create_transcription_multipart_async( language=language, model=model, response_format=response_format, + session_id=session_id, temperature=temperature, timestamp_granularities=utils.unmarshal( timestamp_granularities, Optional[List[operations.TimestampGranularities]], ), + trace=trace, + user=user, ), ) diff --git a/uv.lock b/uv.lock index d091aa10..fe0187e2 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.152" +version = "1.1.153" source = { editable = "." } dependencies = [ { name = "httpcore" },