Skip to content

chore(api): updates to supported Voice IDs #2261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2025
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
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 82
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-5ad6884898c07591750dde560118baf7074a59aecd1f367f930c5e42b04e848a.yml
openapi_spec_hash: 0c255269b89767eae26f4d4dc22d3cbd
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-6663c59193eb95b201e492de17dcbd5e126ba03d18ce66287a3e2c632ca56fe7.yml
openapi_spec_hash: 7996d2c34cc44fe2ce9ffe93c0ab774e
config_hash: d36e491b0afc4f79e3afad4b3c9bec70
16 changes: 10 additions & 6 deletions src/openai/resources/audio/speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def create(
*,
input: str,
model: Union[str, SpeechModel],
voice: Literal["alloy", "ash", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer"],
voice: Union[
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
],
instructions: str | NotGiven = NOT_GIVEN,
response_format: Literal["mp3", "opus", "aac", "flac", "wav", "pcm"] | NotGiven = NOT_GIVEN,
speed: float | NotGiven = NOT_GIVEN,
Expand All @@ -75,8 +77,8 @@ def create(
`tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.

voice: The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
`coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
voices are available in the
`ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
`verse`. Previews of the voices are available in the
[Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).

instructions: Control the voice of your generated audio with additional instructions. Does not
Expand Down Expand Up @@ -142,7 +144,9 @@ async def create(
*,
input: str,
model: Union[str, SpeechModel],
voice: Literal["alloy", "ash", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer"],
voice: Union[
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
],
instructions: str | NotGiven = NOT_GIVEN,
response_format: Literal["mp3", "opus", "aac", "flac", "wav", "pcm"] | NotGiven = NOT_GIVEN,
speed: float | NotGiven = NOT_GIVEN,
Expand All @@ -164,8 +168,8 @@ async def create(
`tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.

voice: The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
`coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
voices are available in the
`ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
`verse`. Previews of the voices are available in the
[Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).

instructions: Control the voice of your generated audio with additional instructions. Does not
Expand Down
16 changes: 12 additions & 4 deletions src/openai/resources/beta/realtime/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ def create(
tool_choice: str | NotGiven = NOT_GIVEN,
tools: Iterable[session_create_params.Tool] | NotGiven = NOT_GIVEN,
turn_detection: session_create_params.TurnDetection | NotGiven = NOT_GIVEN,
voice: Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"] | NotGiven = NOT_GIVEN,
voice: Union[
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
]
| NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -147,7 +150,8 @@ def create(

voice: The voice the model uses to respond. Voice cannot be changed during the session
once the model has responded with audio at least once. Current voice options are
`alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
`alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
`shimmer`, and `verse`.

extra_headers: Send extra headers

Expand Down Expand Up @@ -227,7 +231,10 @@ async def create(
tool_choice: str | NotGiven = NOT_GIVEN,
tools: Iterable[session_create_params.Tool] | NotGiven = NOT_GIVEN,
turn_detection: session_create_params.TurnDetection | NotGiven = NOT_GIVEN,
voice: Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"] | NotGiven = NOT_GIVEN,
voice: Union[
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
]
| NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -309,7 +316,8 @@ async def create(

voice: The voice the model uses to respond. Voice cannot be changed during the session
once the model has responded with audio at least once. Current voice options are
`alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
`alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
`shimmer`, and `verse`.

extra_headers: Send extra headers

Expand Down
13 changes: 12 additions & 1 deletion src/openai/resources/responses/input_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Any, cast
from typing import Any, List, cast
from typing_extensions import Literal

import httpx
Expand All @@ -17,6 +17,7 @@
from ..._base_client import AsyncPaginator, make_request_options
from ...types.responses import input_item_list_params
from ...types.responses.response_item import ResponseItem
from ...types.responses.response_includable import ResponseIncludable

__all__ = ["InputItems", "AsyncInputItems"]

Expand Down Expand Up @@ -47,6 +48,7 @@ def list(
*,
after: str | NotGiven = NOT_GIVEN,
before: str | NotGiven = NOT_GIVEN,
include: List[ResponseIncludable] | NotGiven = NOT_GIVEN,
limit: int | NotGiven = NOT_GIVEN,
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -64,6 +66,9 @@ def list(

before: An item ID to list items before, used in pagination.

include: Additional fields to include in the response. See the `include` parameter for
Response creation above for more information.

limit: A limit on the number of objects to be returned. Limit can range between 1 and
100, and the default is 20.

Expand Down Expand Up @@ -94,6 +99,7 @@ def list(
{
"after": after,
"before": before,
"include": include,
"limit": limit,
"order": order,
},
Expand Down Expand Up @@ -130,6 +136,7 @@ def list(
*,
after: str | NotGiven = NOT_GIVEN,
before: str | NotGiven = NOT_GIVEN,
include: List[ResponseIncludable] | NotGiven = NOT_GIVEN,
limit: int | NotGiven = NOT_GIVEN,
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -147,6 +154,9 @@ def list(

before: An item ID to list items before, used in pagination.

include: Additional fields to include in the response. See the `include` parameter for
Response creation above for more information.

limit: A limit on the number of objects to be returned. Limit can range between 1 and
100, and the default is 20.

Expand Down Expand Up @@ -177,6 +187,7 @@ def list(
{
"after": after,
"before": before,
"include": include,
"limit": limit,
"order": order,
},
Expand Down
24 changes: 12 additions & 12 deletions src/openai/resources/responses/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ def create(
context.

When using along with `previous_response_id`, the instructions from a previous
response will be not be carried over to the next response. This makes it simple
to swap out system (or developer) messages in new responses.
response will not be carried over to the next response. This makes it simple to
swap out system (or developer) messages in new responses.

max_output_tokens: An upper bound for the number of tokens that can be generated for a response,
including visible output tokens and
Expand Down Expand Up @@ -310,8 +310,8 @@ def create(
context.

When using along with `previous_response_id`, the instructions from a previous
response will be not be carried over to the next response. This makes it simple
to swap out system (or developer) messages in new responses.
response will not be carried over to the next response. This makes it simple to
swap out system (or developer) messages in new responses.

max_output_tokens: An upper bound for the number of tokens that can be generated for a response,
including visible output tokens and
Expand Down Expand Up @@ -475,8 +475,8 @@ def create(
context.

When using along with `previous_response_id`, the instructions from a previous
response will be not be carried over to the next response. This makes it simple
to swap out system (or developer) messages in new responses.
response will not be carried over to the next response. This makes it simple to
swap out system (or developer) messages in new responses.

max_output_tokens: An upper bound for the number of tokens that can be generated for a response,
including visible output tokens and
Expand Down Expand Up @@ -795,8 +795,8 @@ async def create(
context.

When using along with `previous_response_id`, the instructions from a previous
response will be not be carried over to the next response. This makes it simple
to swap out system (or developer) messages in new responses.
response will not be carried over to the next response. This makes it simple to
swap out system (or developer) messages in new responses.

max_output_tokens: An upper bound for the number of tokens that can be generated for a response,
including visible output tokens and
Expand Down Expand Up @@ -967,8 +967,8 @@ async def create(
context.

When using along with `previous_response_id`, the instructions from a previous
response will be not be carried over to the next response. This makes it simple
to swap out system (or developer) messages in new responses.
response will not be carried over to the next response. This makes it simple to
swap out system (or developer) messages in new responses.

max_output_tokens: An upper bound for the number of tokens that can be generated for a response,
including visible output tokens and
Expand Down Expand Up @@ -1132,8 +1132,8 @@ async def create(
context.

When using along with `previous_response_id`, the instructions from a previous
response will be not be carried over to the next response. This makes it simple
to swap out system (or developer) messages in new responses.
response will not be carried over to the next response. This makes it simple to
swap out system (or developer) messages in new responses.

max_output_tokens: An upper bound for the number of tokens that can be generated for a response,
including visible output tokens and
Expand Down
11 changes: 8 additions & 3 deletions src/openai/types/audio/speech_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@ class SpeechCreateParams(TypedDict, total=False):
`tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.
"""

voice: Required[Literal["alloy", "ash", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer"]]
voice: Required[
Union[
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
]
]
"""The voice to use when generating the audio.

Supported voices are `alloy`, `ash`, `coral`, `echo`, `fable`, `onyx`, `nova`,
`sage` and `shimmer`. Previews of the voices are available in the
Supported voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`,
`nova`, `sage`, `shimmer`, and `verse`. Previews of the voices are available in
the
[Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
"""

Expand Down
9 changes: 7 additions & 2 deletions src/openai/types/beta/realtime/realtime_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,13 @@ class RealtimeResponse(BaseModel):
will become the input for later turns.
"""

voice: Optional[Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]] = None
voice: Union[
str,
Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"],
None,
] = None
"""
The voice the model used to respond. Current voice options are `alloy`, `ash`,
`ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
`ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
`verse`.
"""
8 changes: 6 additions & 2 deletions src/openai/types/beta/realtime/response_create_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,16 @@ class Response(BaseModel):
tools: Optional[List[ResponseTool]] = None
"""Tools (functions) available to the model."""

voice: Optional[Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]] = None
voice: Union[
str,
Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"],
None,
] = None
"""The voice the model uses to respond.

Voice cannot be changed during the session once the model has responded with
audio at least once. Current voice options are `alloy`, `ash`, `ballad`,
`coral`, `echo` `sage`, `shimmer` and `verse`.
`coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`.
"""


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ class Response(TypedDict, total=False):
tools: Iterable[ResponseTool]
"""Tools (functions) available to the model."""

voice: Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]
voice: Union[
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
]
"""The voice the model uses to respond.

Voice cannot be changed during the session once the model has responded with
audio at least once. Current voice options are `alloy`, `ash`, `ballad`,
`coral`, `echo` `sage`, `shimmer` and `verse`.
`coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`.
"""


Expand Down
6 changes: 5 additions & 1 deletion src/openai/types/beta/realtime/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@ class Session(BaseModel):
natural conversations, but may have a higher latency.
"""

voice: Optional[Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]] = None
voice: Union[
str,
Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"],
None,
] = None
"""The voice the model uses to respond.

Voice cannot be changed during the session once the model has responded with
Expand Down
6 changes: 4 additions & 2 deletions src/openai/types/beta/realtime/session_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ class SessionCreateParams(TypedDict, total=False):
natural conversations, but may have a higher latency.
"""

voice: Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]
voice: Union[
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
]
"""The voice the model uses to respond.

Voice cannot be changed during the session once the model has responded with
audio at least once. Current voice options are `alloy`, `ash`, `ballad`,
`coral`, `echo` `sage`, `shimmer` and `verse`.
`coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`.
"""


Expand Down
6 changes: 5 additions & 1 deletion src/openai/types/beta/realtime/session_create_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ class SessionCreateResponse(BaseModel):
speech.
"""

voice: Optional[Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]] = None
voice: Union[
str,
Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"],
None,
] = None
"""The voice the model uses to respond.

Voice cannot be changed during the session once the model has responded with
Expand Down
8 changes: 6 additions & 2 deletions src/openai/types/beta/realtime/session_update_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,16 @@ class Session(BaseModel):
natural conversations, but may have a higher latency.
"""

voice: Optional[Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]] = None
voice: Union[
str,
Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"],
None,
] = None
"""The voice the model uses to respond.

Voice cannot be changed during the session once the model has responded with
audio at least once. Current voice options are `alloy`, `ash`, `ballad`,
`coral`, `echo` `sage`, `shimmer` and `verse`.
`coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`.
"""


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,14 @@ class Session(TypedDict, total=False):
natural conversations, but may have a higher latency.
"""

voice: Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]
voice: Union[
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
]
"""The voice the model uses to respond.

Voice cannot be changed during the session once the model has responded with
audio at least once. Current voice options are `alloy`, `ash`, `ballad`,
`coral`, `echo` `sage`, `shimmer` and `verse`.
`coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`.
"""


Expand Down
Loading