soniox 2.3.0__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.0 → soniox-2.3.2}/CHANGELOG.md +25 -2
  2. {soniox-2.3.0 → soniox-2.3.2}/PKG-INFO +3 -3
  3. {soniox-2.3.0 → soniox-2.3.2}/README.md +2 -2
  4. {soniox-2.3.0 → soniox-2.3.2}/docs/async_client.md +3 -1
  5. {soniox-2.3.0 → soniox-2.3.2}/docs/types.md +3 -1
  6. {soniox-2.3.0 → soniox-2.3.2}/examples/async_soniox_client/tts_api_example.py +1 -1
  7. {soniox-2.3.0 → soniox-2.3.2}/examples/async_soniox_client/tts_realtime_example.py +1 -1
  8. {soniox-2.3.0 → soniox-2.3.2}/examples/async_soniox_client/tts_realtime_multiplexed_example.py +1 -1
  9. {soniox-2.3.0 → soniox-2.3.2}/examples/soniox_client/tts_api_example.py +1 -1
  10. {soniox-2.3.0 → soniox-2.3.2}/examples/soniox_client/tts_realtime_example.py +1 -1
  11. {soniox-2.3.0 → soniox-2.3.2}/examples/soniox_client/tts_realtime_multiplexed_example.py +1 -1
  12. {soniox-2.3.0 → soniox-2.3.2}/pyproject.toml +1 -1
  13. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/async_auth.py +4 -0
  14. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/async_tts.py +1 -1
  15. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/auth.py +4 -0
  16. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/tts.py +1 -1
  17. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/types/api.py +7 -1
  18. {soniox-2.3.0 → soniox-2.3.2}/.gitignore +0 -0
  19. {soniox-2.3.0 → soniox-2.3.2}/LICENSE +0 -0
  20. {soniox-2.3.0 → soniox-2.3.2}/assets/coffee_shop.mp3 +0 -0
  21. {soniox-2.3.0 → soniox-2.3.2}/assets/coffee_shop.pcm_s16le +0 -0
  22. {soniox-2.3.0 → soniox-2.3.2}/assets/two_way_translation.mp3 +0 -0
  23. {soniox-2.3.0 → soniox-2.3.2}/assets/two_way_translation.pcm_s16le +0 -0
  24. {soniox-2.3.0 → soniox-2.3.2}/docs/realtime_client.md +0 -0
  25. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/__init__.md +0 -0
  26. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/api/__init__.md +0 -0
  27. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/api/api__utils.md +0 -0
  28. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/api/api_async_auth.md +0 -0
  29. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/api/api_async_files.md +0 -0
  30. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/api/api_async_models.md +0 -0
  31. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/api/api_async_stt.md +0 -0
  32. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/api/api_async_transcriptions.md +0 -0
  33. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/api/api_async_webhooks.md +0 -0
  34. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/api/api_auth.md +0 -0
  35. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/api/api_files.md +0 -0
  36. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/api/api_models.md +0 -0
  37. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/api/api_stt.md +0 -0
  38. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/api/api_transcriptions.md +0 -0
  39. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/api/api_webhooks.md +0 -0
  40. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/realtime/__init__.md +0 -0
  41. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/realtime/realtime__utils.md +0 -0
  42. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/realtime/realtime_async_stt.md +0 -0
  43. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/realtime/realtime_stt.md +0 -0
  44. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/soniox_client.md +0 -0
  45. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/soniox_errors.md +0 -0
  46. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/soniox_utils.md +0 -0
  47. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/types/__init__.md +0 -0
  48. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/types/types_api.md +0 -0
  49. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/types/types_common.md +0 -0
  50. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/types/types_realtime.md +0 -0
  51. {soniox-2.3.0 → soniox-2.3.2}/docs/soniox/types/types_webhooks.md +0 -0
  52. {soniox-2.3.0 → soniox-2.3.2}/examples/async_soniox_client/api_example.py +0 -0
  53. {soniox-2.3.0 → soniox-2.3.2}/examples/async_soniox_client/realtime_example.py +0 -0
  54. {soniox-2.3.0 → soniox-2.3.2}/examples/soniox_client/api_example.py +0 -0
  55. {soniox-2.3.0 → soniox-2.3.2}/examples/soniox_client/realtime_example.py +0 -0
  56. {soniox-2.3.0 → soniox-2.3.2}/justfile +0 -0
  57. {soniox-2.3.0 → soniox-2.3.2}/scripts/generate_docs.py +0 -0
  58. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/__init__.py +0 -0
  59. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/__init__.py +0 -0
  60. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/_utils.py +0 -0
  61. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/async_files.py +0 -0
  62. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/async_models.py +0 -0
  63. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/async_stt.py +0 -0
  64. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/async_tts_models.py +0 -0
  65. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/async_webhooks.py +0 -0
  66. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/files.py +0 -0
  67. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/models.py +0 -0
  68. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/stt.py +0 -0
  69. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/tts_models.py +0 -0
  70. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/api/webhooks.py +0 -0
  71. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/client.py +0 -0
  72. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/errors.py +0 -0
  73. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/realtime/__init__.py +0 -0
  74. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/realtime/_constants.py +0 -0
  75. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/realtime/_utils.py +0 -0
  76. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/realtime/async_stt.py +0 -0
  77. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/realtime/async_tts.py +0 -0
  78. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/realtime/stt.py +0 -0
  79. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/realtime/tts.py +0 -0
  80. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/types/__init__.py +0 -0
  81. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/types/common.py +0 -0
  82. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/types/realtime.py +0 -0
  83. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/types/webhooks.py +0 -0
  84. {soniox-2.3.0 → soniox-2.3.2}/src/soniox/utils.py +0 -0
  85. {soniox-2.3.0 → soniox-2.3.2}/uv.lock +0 -0
@@ -77,11 +77,34 @@ Examples:
77
77
 
78
78
  ---
79
79
 
80
- ## [3.0.0] - 22 apr 2026
80
+ ## [2.3.2] - 4 may 2026
81
81
 
82
82
  ### Added
83
83
 
84
- - Added TTS support for REST and websocket APIs.
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
+
89
+ ## [2.3.1] - 29 apr 2026
90
+
91
+ ### Changed
92
+
93
+ - Default TTS model is now `tts-rt-v1` (previously `tts-rt-v1-preview`).
94
+
95
+ ---
96
+
97
+ ## [2.3.0] - 22 apr 2026
98
+
99
+ ### Added
100
+
101
+ - Text-to-Speech (TTS) support, available on both `SonioxClient` and `AsyncSonioxClient`.
102
+ - REST TTS API via `client.tts`: `generate()` returns audio bytes, `generate_to_file()` writes audio to a path or file-like object. Configurable `voice`, `model`, `language`, `audio_format`, `sample_rate`, and `bitrate`.
103
+ - TTS model listing via `client.tts_models.list()`.
104
+ - Realtime TTS over websocket via `client.realtime.tts.connect(...)`: stream text in with `send_text_chunk` / `send_text_chunks` / `finish`, receive audio with `receive_audio_chunks` or raw events with `receive_events`, plus `cancel`, `pause`, `resume`, and `keep_alive`.
105
+ - Multiplexed realtime TTS via `client.realtime.tts.connect_multi_stream()`: run multiple concurrent TTS streams over a single websocket connection using `open_stream`.
106
+ - New TTS examples for sync and async clients (REST, realtime, and multiplexed realtime).
107
+ - `tts_api_base_url` and `tts_websocket_base_url` client options for overriding TTS endpoints.
85
108
 
86
109
  ---
87
110
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: soniox
3
- Version: 2.3.0
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
@@ -80,7 +80,7 @@ output_file = output_file_for_audio_format("wav", "tts_sync_output")
80
80
  written = client.tts.generate_to_file(
81
81
  output_file,
82
82
  text="Hello from Soniox Python SDK Text-to-Speech.",
83
- model="tts-rt-v1-preview",
83
+ model="tts-rt-v1",
84
84
  language="en",
85
85
  voice="Adrian",
86
86
  audio_format="wav",
@@ -133,7 +133,7 @@ from soniox.types import RealtimeTTSConfig
133
133
  client = SonioxClient()
134
134
  config = RealtimeTTSConfig(
135
135
  stream_id=f"sync-{uuid4()}",
136
- model="tts-rt-v1-preview",
136
+ model="tts-rt-v1",
137
137
  language="en",
138
138
  voice="Adrian",
139
139
  audio_format="wav",
@@ -43,7 +43,7 @@ output_file = output_file_for_audio_format("wav", "tts_sync_output")
43
43
  written = client.tts.generate_to_file(
44
44
  output_file,
45
45
  text="Hello from Soniox Python SDK Text-to-Speech.",
46
- model="tts-rt-v1-preview",
46
+ model="tts-rt-v1",
47
47
  language="en",
48
48
  voice="Adrian",
49
49
  audio_format="wav",
@@ -96,7 +96,7 @@ from soniox.types import RealtimeTTSConfig
96
96
  client = SonioxClient()
97
97
  config = RealtimeTTSConfig(
98
98
  stream_id=f"sync-{uuid4()}",
99
- model="tts-rt-v1-preview",
99
+ model="tts-rt-v1",
100
100
  language="en",
101
101
  voice="Adrian",
102
102
  audio_format="wav",
@@ -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.
@@ -5,7 +5,7 @@ from soniox.errors import SonioxAPIError
5
5
  from soniox.types import TtsAudioFormat
6
6
  from soniox.utils import output_file_for_audio_format
7
7
 
8
- MODEL = "tts-rt-v1-preview"
8
+ MODEL = "tts-rt-v1"
9
9
  LANGUAGE = "en"
10
10
  VOICE = "Adrian"
11
11
  AUDIO_FORMAT: TtsAudioFormat = "wav"
@@ -7,7 +7,7 @@ from soniox.errors import SonioxRealtimeError
7
7
  from soniox.types import RealtimeTTSConfig, TtsAudioFormat
8
8
  from soniox.utils import output_file_for_audio_format
9
9
 
10
- MODEL = "tts-rt-v1-preview"
10
+ MODEL = "tts-rt-v1"
11
11
  LANGUAGE = "en"
12
12
  VOICE = "Maya"
13
13
  AUDIO_FORMAT: TtsAudioFormat = "wav"
@@ -6,7 +6,7 @@ from soniox.client import AsyncSonioxClient
6
6
  from soniox.types import RealtimeTTSConfig, TtsAudioFormat
7
7
  from soniox.utils import output_file_for_audio_format
8
8
 
9
- MODEL = "tts-rt-v1-preview"
9
+ MODEL = "tts-rt-v1"
10
10
  AUDIO_FORMAT: TtsAudioFormat = "wav"
11
11
 
12
12
  STREAM_SPECS = {
@@ -3,7 +3,7 @@ from soniox.errors import SonioxAPIError
3
3
  from soniox.types import TtsAudioFormat
4
4
  from soniox.utils import output_file_for_audio_format
5
5
 
6
- MODEL = "tts-rt-v1-preview"
6
+ MODEL = "tts-rt-v1"
7
7
  LANGUAGE = "en"
8
8
  VOICE = "Adrian"
9
9
  AUDIO_FORMAT: TtsAudioFormat = "wav"
@@ -7,7 +7,7 @@ from soniox.errors import SonioxRealtimeError
7
7
  from soniox.types import RealtimeTTSConfig, TtsAudioFormat
8
8
  from soniox.utils import output_file_for_audio_format, start_text_thread
9
9
 
10
- MODEL = "tts-rt-v1-preview"
10
+ MODEL = "tts-rt-v1"
11
11
  LANGUAGE = "en"
12
12
  VOICE = "Adrian"
13
13
  AUDIO_FORMAT: TtsAudioFormat = "wav"
@@ -7,7 +7,7 @@ from soniox.client import SonioxClient
7
7
  from soniox.types import RealtimeTTSConfig, TtsAudioFormat
8
8
  from soniox.utils import output_file_for_audio_format, start_text_thread
9
9
 
10
- MODEL = "tts-rt-v1-preview"
10
+ MODEL = "tts-rt-v1"
11
11
  AUDIO_FORMAT: TtsAudioFormat = "wav"
12
12
 
13
13
  STREAM_SPECS = {
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "soniox"
7
- version = "2.3.0"
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)
@@ -10,7 +10,7 @@ if TYPE_CHECKING:
10
10
  from ..client import AsyncSonioxClient
11
11
 
12
12
 
13
- DEFAULT_MODEL = "tts-rt-v1-preview"
13
+ DEFAULT_MODEL = "tts-rt-v1"
14
14
  DEFAULT_VOICE = "Adrian"
15
15
  DEFAULT_LANGUAGE = "en"
16
16
  DEFAULT_AUDIO_FORMAT: TtsAudioFormat = "wav"
@@ -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)
@@ -10,7 +10,7 @@ if TYPE_CHECKING:
10
10
  from ..client import SonioxClient
11
11
 
12
12
 
13
- DEFAULT_MODEL = "tts-rt-v1-preview"
13
+ DEFAULT_MODEL = "tts-rt-v1"
14
14
  DEFAULT_VOICE = "Adrian"
15
15
  DEFAULT_LANGUAGE = "en"
16
16
  DEFAULT_AUDIO_FORMAT: TtsAudioFormat = "wav"
@@ -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