soniox 2.3.1__tar.gz → 2.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. {soniox-2.3.1 → soniox-2.3.2}/CHANGELOG.md +9 -0
  2. {soniox-2.3.1 → soniox-2.3.2}/PKG-INFO +1 -1
  3. {soniox-2.3.1 → soniox-2.3.2}/docs/async_client.md +3 -1
  4. {soniox-2.3.1 → soniox-2.3.2}/docs/types.md +3 -1
  5. {soniox-2.3.1 → soniox-2.3.2}/pyproject.toml +1 -1
  6. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/async_auth.py +4 -0
  7. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/auth.py +4 -0
  8. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/types/api.py +7 -1
  9. {soniox-2.3.1 → soniox-2.3.2}/.gitignore +0 -0
  10. {soniox-2.3.1 → soniox-2.3.2}/LICENSE +0 -0
  11. {soniox-2.3.1 → soniox-2.3.2}/README.md +0 -0
  12. {soniox-2.3.1 → soniox-2.3.2}/assets/coffee_shop.mp3 +0 -0
  13. {soniox-2.3.1 → soniox-2.3.2}/assets/coffee_shop.pcm_s16le +0 -0
  14. {soniox-2.3.1 → soniox-2.3.2}/assets/two_way_translation.mp3 +0 -0
  15. {soniox-2.3.1 → soniox-2.3.2}/assets/two_way_translation.pcm_s16le +0 -0
  16. {soniox-2.3.1 → soniox-2.3.2}/docs/realtime_client.md +0 -0
  17. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/__init__.md +0 -0
  18. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/api/__init__.md +0 -0
  19. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/api/api__utils.md +0 -0
  20. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/api/api_async_auth.md +0 -0
  21. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/api/api_async_files.md +0 -0
  22. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/api/api_async_models.md +0 -0
  23. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/api/api_async_stt.md +0 -0
  24. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/api/api_async_transcriptions.md +0 -0
  25. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/api/api_async_webhooks.md +0 -0
  26. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/api/api_auth.md +0 -0
  27. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/api/api_files.md +0 -0
  28. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/api/api_models.md +0 -0
  29. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/api/api_stt.md +0 -0
  30. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/api/api_transcriptions.md +0 -0
  31. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/api/api_webhooks.md +0 -0
  32. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/realtime/__init__.md +0 -0
  33. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/realtime/realtime__utils.md +0 -0
  34. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/realtime/realtime_async_stt.md +0 -0
  35. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/realtime/realtime_stt.md +0 -0
  36. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/soniox_client.md +0 -0
  37. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/soniox_errors.md +0 -0
  38. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/soniox_utils.md +0 -0
  39. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/types/__init__.md +0 -0
  40. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/types/types_api.md +0 -0
  41. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/types/types_common.md +0 -0
  42. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/types/types_realtime.md +0 -0
  43. {soniox-2.3.1 → soniox-2.3.2}/docs/soniox/types/types_webhooks.md +0 -0
  44. {soniox-2.3.1 → soniox-2.3.2}/examples/async_soniox_client/api_example.py +0 -0
  45. {soniox-2.3.1 → soniox-2.3.2}/examples/async_soniox_client/realtime_example.py +0 -0
  46. {soniox-2.3.1 → soniox-2.3.2}/examples/async_soniox_client/tts_api_example.py +0 -0
  47. {soniox-2.3.1 → soniox-2.3.2}/examples/async_soniox_client/tts_realtime_example.py +0 -0
  48. {soniox-2.3.1 → soniox-2.3.2}/examples/async_soniox_client/tts_realtime_multiplexed_example.py +0 -0
  49. {soniox-2.3.1 → soniox-2.3.2}/examples/soniox_client/api_example.py +0 -0
  50. {soniox-2.3.1 → soniox-2.3.2}/examples/soniox_client/realtime_example.py +0 -0
  51. {soniox-2.3.1 → soniox-2.3.2}/examples/soniox_client/tts_api_example.py +0 -0
  52. {soniox-2.3.1 → soniox-2.3.2}/examples/soniox_client/tts_realtime_example.py +0 -0
  53. {soniox-2.3.1 → soniox-2.3.2}/examples/soniox_client/tts_realtime_multiplexed_example.py +0 -0
  54. {soniox-2.3.1 → soniox-2.3.2}/justfile +0 -0
  55. {soniox-2.3.1 → soniox-2.3.2}/scripts/generate_docs.py +0 -0
  56. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/__init__.py +0 -0
  57. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/__init__.py +0 -0
  58. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/_utils.py +0 -0
  59. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/async_files.py +0 -0
  60. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/async_models.py +0 -0
  61. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/async_stt.py +0 -0
  62. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/async_tts.py +0 -0
  63. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/async_tts_models.py +0 -0
  64. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/async_webhooks.py +0 -0
  65. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/files.py +0 -0
  66. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/models.py +0 -0
  67. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/stt.py +0 -0
  68. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/tts.py +0 -0
  69. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/tts_models.py +0 -0
  70. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/api/webhooks.py +0 -0
  71. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/client.py +0 -0
  72. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/errors.py +0 -0
  73. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/realtime/__init__.py +0 -0
  74. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/realtime/_constants.py +0 -0
  75. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/realtime/_utils.py +0 -0
  76. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/realtime/async_stt.py +0 -0
  77. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/realtime/async_tts.py +0 -0
  78. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/realtime/stt.py +0 -0
  79. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/realtime/tts.py +0 -0
  80. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/types/__init__.py +0 -0
  81. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/types/common.py +0 -0
  82. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/types/realtime.py +0 -0
  83. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/types/webhooks.py +0 -0
  84. {soniox-2.3.1 → soniox-2.3.2}/src/soniox/utils.py +0 -0
  85. {soniox-2.3.1 → soniox-2.3.2}/uv.lock +0 -0
@@ -77,6 +77,15 @@ Examples:
77
77
 
78
78
  ---
79
79
 
80
+ ## [2.3.2] - 4 may 2026
81
+
82
+ ### Added
83
+
84
+ - `single_use` and `max_session_duration_seconds` parameters on `client.auth.create_temporary_api_key()` (and the async variant).
85
+ - `tts_rt` value for `TemporaryApiKeyUsageType`, allowing temporary API keys to be scoped to realtime TTS.
86
+
87
+ ---
88
+
80
89
  ## [2.3.1] - 29 apr 2026
81
90
 
82
91
  ### Changed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: soniox
3
- Version: 2.3.1
3
+ Version: 2.3.2
4
4
  Summary: The official Python SDK for the Soniox API (STT, REST)
5
5
  Project-URL: Homepage, https://sonoix.com
6
6
  Project-URL: Documentation, https://soniox.com/docs
@@ -1129,7 +1129,7 @@ AsyncAuthAPI(client: AsyncSonioxClient)
1129
1129
  ### create_temporary_api_key()
1130
1130
 
1131
1131
  ```python
1132
- create_temporary_api_key(*, usage_type: TemporaryApiKeyUsageType = 'transcribe_websocket', expires_in_seconds: int = 5 * 60, client_reference_id: str | None = None) -> CreateTemporaryApiKeyResponse
1132
+ create_temporary_api_key(*, usage_type: TemporaryApiKeyUsageType = 'transcribe_websocket', expires_in_seconds: int = 5 * 60, client_reference_id: str | None = None, single_use: bool | None = None, max_session_duration_seconds: int | None = None) -> CreateTemporaryApiKeyResponse
1133
1133
  ```
1134
1134
 
1135
1135
  Create a temporary API key.
@@ -1143,6 +1143,8 @@ Performs a POST request to ``/auth/temporary-api-key``.
1143
1143
  | `usage_type` | `TemporaryApiKeyUsageType` | Intended usage of the temporary API key. |
1144
1144
  | `expires_in_seconds` | `int` | Duration in seconds until the temporary API key expires |
1145
1145
  | `client_reference_id` | `str \| None` | Optional tracking identifier string. Does not need to be unique |
1146
+ | `single_use` | `bool \| None` | When true, restricts the temporary API key to a single use. |
1147
+ | `max_session_duration_seconds` | `int \| None` | Maximum connection duration in seconds for WebSocket and TTS HTTP streaming endpoints. |
1146
1148
 
1147
1149
  **Returns**
1148
1150
 
@@ -75,6 +75,8 @@ Payload for requesting a temporary API key (e.g., websocket).
75
75
  | `usage_type` | `TemporaryApiKeyUsageType` | Intended usage of the temporary API key. |
76
76
  | `expires_in_seconds` | `int` | Duration in seconds until the temporary API key expires |
77
77
  | `client_reference_id` | `str \| None` | Optional tracking identifier string. Does not need to be unique |
78
+ | `single_use` | `bool \| None` | When true, restricts the temporary API key to a single use. |
79
+ | `max_session_duration_seconds` | `int \| None` | Maximum connection duration in seconds for WebSocket and TTS HTTP streaming endpoints. |
78
80
 
79
81
  ---
80
82
 
@@ -557,7 +559,7 @@ Represents a Text-to-Speech voice.
557
559
  ## TemporaryApiKeyUsageType
558
560
 
559
561
  ```python
560
- TemporaryApiKeyUsageType = Literal["transcribe_websocket"]
562
+ TemporaryApiKeyUsageType = Literal["transcribe_websocket", "tts_rt"]
561
563
  ```
562
564
 
563
565
  Intended usage for temporary API keys.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "soniox"
7
- version = "2.3.1"
7
+ version = "2.3.2"
8
8
  dependencies = ["httpx>0.25.0", "websockets>11.0", "pydantic>2"]
9
9
  requires-python = ">=3.10"
10
10
  authors = [{ name = "Soniox", email = "support@soniox.com" }]
@@ -23,6 +23,8 @@ class AsyncAuthAPI:
23
23
  usage_type: TemporaryApiKeyUsageType = "transcribe_websocket",
24
24
  expires_in_seconds: int = 5 * 60,
25
25
  client_reference_id: str | None = None,
26
+ single_use: bool | None = None,
27
+ max_session_duration_seconds: int | None = None,
26
28
  ) -> CreateTemporaryApiKeyResponse:
27
29
  """
28
30
  Create a temporary API key.
@@ -36,6 +38,8 @@ class AsyncAuthAPI:
36
38
  usage_type=usage_type,
37
39
  expires_in_seconds=expires_in_seconds,
38
40
  client_reference_id=client_reference_id,
41
+ single_use=single_use,
42
+ max_session_duration_seconds=max_session_duration_seconds,
39
43
  )
40
44
  response = await self._client.request(
41
45
  "POST", "/auth/temporary-api-key", json=payload.model_dump(exclude_none=True)
@@ -23,6 +23,8 @@ class AuthAPI:
23
23
  usage_type: TemporaryApiKeyUsageType = "transcribe_websocket",
24
24
  expires_in_seconds: int = 5 * 60,
25
25
  client_reference_id: str | None = None,
26
+ single_use: bool | None = None,
27
+ max_session_duration_seconds: int | None = None,
26
28
  ) -> CreateTemporaryApiKeyResponse:
27
29
  """
28
30
  Create a temporary API key.
@@ -36,6 +38,8 @@ class AuthAPI:
36
38
  usage_type=usage_type,
37
39
  expires_in_seconds=expires_in_seconds,
38
40
  client_reference_id=client_reference_id,
41
+ single_use=single_use,
42
+ max_session_duration_seconds=max_session_duration_seconds,
39
43
  )
40
44
  response = self._client.request(
41
45
  "POST", "/auth/temporary-api-key", json=payload.model_dump(exclude_none=True)
@@ -17,7 +17,7 @@ TranscriptionMode = Literal["real_time", "async"]
17
17
  TranslationType = Literal["one_way", "two_way"]
18
18
  """Supported translation configuration types."""
19
19
 
20
- TemporaryApiKeyUsageType = Literal["transcribe_websocket"]
20
+ TemporaryApiKeyUsageType = Literal["transcribe_websocket", "tts_rt"]
21
21
  """Intended usage for temporary API keys."""
22
22
 
23
23
  TtsAudioFormat = Literal[
@@ -346,6 +346,12 @@ class CreateTemporaryApiKeyPayload(BaseModel):
346
346
  client_reference_id: str | None = Field(default=None, max_length=256)
347
347
  """Optional tracking identifier string. Does not need to be unique"""
348
348
 
349
+ single_use: bool | None = None
350
+ """When true, restricts the temporary API key to a single use."""
351
+
352
+ max_session_duration_seconds: int | None = Field(default=None, ge=1, le=18000)
353
+ """Maximum connection duration in seconds for WebSocket and TTS HTTP streaming endpoints."""
354
+
349
355
 
350
356
  class CreateTemporaryApiKeyResponse(BaseModel):
351
357
  """Response data for a temp API key request."""
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes