From e6318453a4059f4038b87d5f91ebcbfe11d36e98 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 17:46:29 +0000 Subject: [PATCH] SDK regeneration --- .mock/definition/__package__.yml | 280 +- .../conversationalAi/agents/widget.yml | 21 + .mock/definition/speechToText.yml | 14 +- .mock/definition/voices.yml | 4 +- .mock/definition/workspace.yml | 34 + .mock/fern.config.json | 2 +- .mock/openapi.json | 1202 +- poetry.lock | 8 +- pyproject.toml | 2 +- reference.md | 14220 ---------------- src/elevenlabs/__init__.py | 24 +- src/elevenlabs/base_client.py | 4 +- .../conversations/feedback/raw_client.py | 4 + .../conversations/raw_client.py | 4 + .../knowledge_base/documents/raw_client.py | 4 + .../phone_numbers/raw_client.py | 4 + src/elevenlabs/core/client_wrapper.py | 4 +- src/elevenlabs/speech_to_text/client.py | 14 +- src/elevenlabs/speech_to_text/raw_client.py | 14 +- src/elevenlabs/types/__init__.py | 24 +- src/elevenlabs/types/built_in_tools.py | 44 + src/elevenlabs/types/client_event.py | 3 +- ...shared_sound_generations_response_model.py | 23 - src/elevenlabs/types/integration_type.py | 5 + src/elevenlabs/types/mcp_approval_policy.py | 7 + .../types/mcp_approval_required_model.py | 8 - src/elevenlabs/types/mcp_tool_config_input.py | 29 +- .../types/mcp_tool_config_output.py | 29 +- .../types/native_mcp_tool_config_input.py | 59 - .../types/native_mcp_tool_config_output.py | 59 - src/elevenlabs/types/prompt_agent_db_model.py | 2 + .../types/prompt_agent_db_model_tools_item.py | 36 +- .../types/prompt_agent_input_tools_item.py | 36 +- .../types/prompt_agent_output_tools_item.py | 36 +- .../shared_sound_generation_response_model.py | 31 - src/elevenlabs/types/supported_voice.py | 5 + .../types/system_tool_config_input_params.py | 1 + .../types/system_tool_config_output_params.py | 1 + .../types/transfer_to_number_tool_config.py | 4 + src/elevenlabs/types/widget_config.py | 6 + .../types/widget_config_response.py | 6 + src/elevenlabs/types/widget_styles.py | 118 + .../types/workspace_resource_type.py | 2 +- src/elevenlabs/voices/client.py | 4 +- src/elevenlabs/voices/raw_client.py | 4 +- src/elevenlabs/workspace/client.py | 80 + src/elevenlabs/workspace/raw_client.py | 130 + .../workspace/resources/raw_client.py | 8 + 48 files changed, 1389 insertions(+), 15274 deletions(-) create mode 100644 .mock/definition/workspace.yml delete mode 100644 reference.md create mode 100644 src/elevenlabs/types/built_in_tools.py delete mode 100644 src/elevenlabs/types/get_shared_sound_generations_response_model.py create mode 100644 src/elevenlabs/types/integration_type.py create mode 100644 src/elevenlabs/types/mcp_approval_policy.py delete mode 100644 src/elevenlabs/types/mcp_approval_required_model.py delete mode 100644 src/elevenlabs/types/native_mcp_tool_config_input.py delete mode 100644 src/elevenlabs/types/native_mcp_tool_config_output.py delete mode 100644 src/elevenlabs/types/shared_sound_generation_response_model.py create mode 100644 src/elevenlabs/types/widget_styles.py diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml index 42f5f890..9680d7d2 100644 --- a/.mock/definition/__package__.yml +++ b/.mock/definition/__package__.yml @@ -1228,6 +1228,25 @@ types: include_workspace_metrics is False. source: openapi: openapi.json + BuiltInTools: + properties: + end_call: + type: optional + docs: The end call tool + language_detection: + type: optional + docs: The language detection tool + transfer_to_agent: + type: optional + docs: The transfer to agent tool + transfer_to_number: + type: optional + docs: The transfer to number tool + skip_turn: + type: optional + docs: The skip turn tool + source: + openapi: openapi.json ChapterContentBlockExtendableNodeResponseModel: docs: Not used. Make sure you anticipate new types in the future. properties: {} @@ -1463,10 +1482,11 @@ types: - agent_response - agent_response_correction - client_tool_call + - mcp_tool_call + - agent_tool_response - vad_score - internal_turn_probability - internal_tentative_agent_response - - internal_native_mcp_tool_call source: openapi: openapi.json ClientToolConfigInput: @@ -3490,14 +3510,6 @@ types: docs: The description of the pronunciation dictionary. source: openapi: openapi.json - GetSharedSoundGenerationsResponseModel: - properties: - shared_sound_generations: - type: list - last_sort_id: optional - has_more: boolean - source: - openapi: openapi.json GetSpeechHistoryResponse: properties: history: @@ -3587,6 +3599,12 @@ types: default: '' source: openapi: openapi.json + IntegrationType: + enum: + - mcp_server + - mcp_integration + source: + openapi: openapi.json InvoiceResponse: properties: amount_due_cents: @@ -3977,16 +3995,16 @@ types: docs: The constant value of the property source: openapi: openapi.json - McpApprovalRequiredModel: + McpApprovalPolicy: enum: - - user_approval_always_given - - user_approval_never_given - - user_approval_required_per_tool - docs: Defines the approval model for an MCP tool + - auto_approve_all + - require_approval_all + - require_approval_per_tool + docs: Defines the MCP server-level approval policy for tool execution. source: openapi: openapi.json McpToolConfigInput: - docs: A MCP tool is a tool that is used to call a MCP server + docs: An MCP tool configuration that can be used to call MCP servers properties: id: type: optional @@ -4004,24 +4022,34 @@ types: type: optional docs: The maximum time in seconds to wait for the tool call to complete. default: 20 + integration_type: + type: IntegrationType + docs: The type of MCP tool parameters: type: optional docs: Schema for any parameters the LLM needs to provide to the MCP tool. + approval_policy: + type: optional + docs: The approval policy for the MCP tool mcp_tool_name: type: string docs: The name of the MCP tool to call + mcp_tool_description: + type: string + docs: The description of the MCP tool to call mcp_server_id: type: string docs: The id of the MCP server to call - approval_mode: - type: optional - docs: >- - If set to approved, the tool will be pre-approved and not require user - approval before executing + mcp_server_name: + type: string + docs: The name of the MCP server to call + mcp_input_schema: + type: optional> + docs: Original inputSchema dict for consistent hashing (pure MCP format) source: openapi: openapi.json McpToolConfigOutput: - docs: A MCP tool is a tool that is used to call a MCP server + docs: An MCP tool configuration that can be used to call MCP servers properties: id: type: optional @@ -4039,20 +4067,30 @@ types: type: optional docs: The maximum time in seconds to wait for the tool call to complete. default: 20 + integration_type: + type: IntegrationType + docs: The type of MCP tool parameters: type: optional docs: Schema for any parameters the LLM needs to provide to the MCP tool. + approval_policy: + type: optional + docs: The approval policy for the MCP tool mcp_tool_name: type: string docs: The name of the MCP tool to call + mcp_tool_description: + type: string + docs: The description of the MCP tool to call mcp_server_id: type: string docs: The id of the MCP server to call - approval_mode: - type: optional - docs: >- - If set to approved, the tool will be pre-approved and not require user - approval before executing + mcp_server_name: + type: string + docs: The name of the MCP server to call + mcp_input_schema: + type: optional> + docs: Original inputSchema dict for consistent hashing (pure MCP format) source: openapi: openapi.json ManualVerificationFileResponse: @@ -4237,76 +4275,6 @@ types: docs: Whether the user is on the watchlist. source: openapi: openapi.json - NativeMcpToolConfigInput: - docs: A Native MCP tool is a tool that is used to call a Native MCP server - properties: - id: - type: optional - default: '' - name: - type: string - validation: - pattern: ^[a-zA-Z0-9_-]{1,64}$ - minLength: 0 - description: - type: string - validation: - minLength: 0 - response_timeout_secs: - type: optional - docs: The maximum time in seconds to wait for the tool call to complete. - default: 20 - parameters: - type: optional - docs: Schema for any parameters the LLM needs to provide to the MCP tool. - mcp_tool_name: - type: string - docs: The name of the MCP tool to call - mcp_server_id: - type: string - docs: The id of the MCP server to call - approval_mode: - type: optional - docs: >- - If set to always accept, the tool will be pre-approved and not require - user approval before executing - source: - openapi: openapi.json - NativeMcpToolConfigOutput: - docs: A Native MCP tool is a tool that is used to call a Native MCP server - properties: - id: - type: optional - default: '' - name: - type: string - validation: - pattern: ^[a-zA-Z0-9_-]{1,64}$ - minLength: 0 - description: - type: string - validation: - minLength: 0 - response_timeout_secs: - type: optional - docs: The maximum time in seconds to wait for the tool call to complete. - default: 20 - parameters: - type: optional - docs: Schema for any parameters the LLM needs to provide to the MCP tool. - mcp_tool_name: - type: string - docs: The name of the MCP tool to call - mcp_server_id: - type: string - docs: The id of the MCP server to call - approval_mode: - type: optional - docs: >- - If set to always accept, the tool will be pre-approved and not require - user approval before executing - source: - openapi: openapi.json ObjectJsonSchemaPropertyInputPropertiesValue: discriminated: false union: @@ -4913,8 +4881,6 @@ types: type: ClientToolConfigInput mcp: type: McpToolConfigInput - native_mcp: - type: NativeMcpToolConfigInput system: type: SystemToolConfigInput webhook: @@ -4975,8 +4941,6 @@ types: type: ClientToolConfigOutput mcp: type: McpToolConfigOutput - native_mcp: - type: NativeMcpToolConfigOutput system: type: SystemToolConfigOutput webhook: @@ -4992,8 +4956,6 @@ types: type: ClientToolConfigInput mcp: type: McpToolConfigInput - native_mcp: - type: NativeMcpToolConfigInput system: type: SystemToolConfigInput webhook: @@ -5045,6 +5007,8 @@ types: docs: Configuration for RAG knowledge_base_document_ids: type: optional> + built_in_tools: + type: optional source: openapi: openapi.json PromptAgentOverride: @@ -5627,23 +5591,6 @@ types: 'key'). source: openapi: openapi.json - SharedSoundGenerationResponseModel: - properties: - public_user_id: string - history_item_id: string - generation_id: string - text: string - category: string - labels: - type: map - purchased_count: integer - like_count: integer - featured: boolean - preview_url: string - purchased: boolean - icon_url: string - source: - openapi: openapi.json SimilarVoiceCategory: enum: - premade @@ -6179,6 +6126,23 @@ types: type: optional model_family: type: optional + optimize_streaming_latency: + type: optional + stability: + type: optional + validation: + min: 0 + max: 1 + speed: + type: optional + validation: + min: 0.7 + max: 1.2 + similarity_boost: + type: optional + validation: + min: 0 + max: 1 source: openapi: openapi.json SystemToolConfigInputParams: @@ -6421,6 +6385,12 @@ types: properties: transfers: type: list + enable_client_message: + type: optional + docs: >- + Whether to play a message to the client while they wait for transfer. + Defaults to true for backward compatibility. + default: true source: openapi: openapi.json TurnConfig: @@ -7324,6 +7294,9 @@ types: text_contents: type: optional docs: Text contents of the widget + styles: + type: optional + docs: Styles for the widget language_selector: type: optional docs: Whether to show the language selector @@ -7474,6 +7447,9 @@ types: text_contents: type: optional docs: Text contents of the widget + styles: + type: optional + docs: Styles for the widget language: string supported_language_overrides: type: optional> @@ -7537,6 +7513,70 @@ types: name: BottomRight source: openapi: openapi.json + WidgetStyles: + properties: + base: + type: optional + docs: The base background color. + base_hover: + type: optional + docs: The color of the base background when hovered. + base_active: + type: optional + docs: The color of the base background when active (clicked). + base_border: + type: optional + docs: The color of the border against the base background. + base_subtle: + type: optional + docs: The color of subtle text against the base background. + base_primary: + type: optional + docs: The color of primary text against the base background. + base_error: + type: optional + docs: The color of error text against the base background. + accent: + type: optional + docs: The accent background color. + accent_hover: + type: optional + docs: The color of the accent background when hovered. + accent_active: + type: optional + docs: The color of the accent background when active (clicked). + accent_border: + type: optional + docs: The color of the border against the accent background. + accent_subtle: + type: optional + docs: The color of subtle text against the accent background. + accent_primary: + type: optional + docs: The color of primary text against the accent background. + overlay_padding: + type: optional + docs: The padding around the edges of the viewport. + button_radius: + type: optional + docs: The radius of the buttons. + input_radius: + type: optional + docs: The radius of the input fields. + bubble_radius: + type: optional + docs: The radius of the chat bubbles. + sheet_radius: + type: optional + docs: The default radius of sheets. + compact_sheet_radius: + type: optional + docs: The radius of the sheet in compact mode. + dropdown_sheet_radius: + type: optional + docs: The radius of the dropdown sheet. + source: + openapi: openapi.json WidgetTextContents: properties: main_label: @@ -7646,7 +7686,7 @@ types: - convai_secrets - music_latent - convai_phone_numbers - - convai_mcps + - convai_mcp_servers - convai_batch_calls docs: >- Resource types that can be shared in the workspace. The name always need diff --git a/.mock/definition/conversationalAi/agents/widget.yml b/.mock/definition/conversationalAi/agents/widget.yml index 744ae514..8b946255 100644 --- a/.mock/definition/conversationalAi/agents/widget.yml +++ b/.mock/definition/conversationalAi/agents/widget.yml @@ -93,6 +93,27 @@ service: conversation_id: conversation_id error_occurred: error_occurred copy_id: copy_id + styles: + base: base + base_hover: base_hover + base_active: base_active + base_border: base_border + base_subtle: base_subtle + base_primary: base_primary + base_error: base_error + accent: accent + accent_hover: accent_hover + accent_active: accent_active + accent_border: accent_border + accent_subtle: accent_subtle + accent_primary: accent_primary + overlay_padding: 1.1 + button_radius: 1.1 + input_radius: 1.1 + bubble_radius: 1.1 + sheet_radius: 1.1 + compact_sheet_radius: 1.1 + dropdown_sheet_radius: 1.1 language: language supported_language_overrides: - supported_language_overrides diff --git a/.mock/definition/speechToText.yml b/.mock/definition/speechToText.yml index 57d95d44..17e02db2 100644 --- a/.mock/definition/speechToText.yml +++ b/.mock/definition/speechToText.yml @@ -130,9 +130,19 @@ service: Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via - webhook. Webhooks can be created and assigned to a transcription - task in webhook settings page in the UI. + webhook. default: false + temperature: + type: optional + docs: >- + Controls the randomness of the transcription output. Accepts + values between 0.0 and 2.0, where higher values result in more + diverse and less deterministic results. If omitted, we will use + a temperature based on the model you selected which is usually + 0. + validation: + min: 0 + max: 2 content-type: multipart/form-data response: docs: Synchronous transcription result diff --git a/.mock/definition/voices.yml b/.mock/definition/voices.yml index e287b1e6..b49458e5 100644 --- a/.mock/definition/voices.yml +++ b/.mock/definition/voices.yml @@ -194,7 +194,7 @@ service: docs: >- Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to - 'personal' plus 'community'. + all but 'default'. category: type: optional docs: >- @@ -895,7 +895,7 @@ service: source: openapi: openapi.json display-name: Voices -docs: Access to voices created either by you or us. +docs: Access to voices created either by you or ElevenLabs. types: VoicesGetSharedRequestCategory: enum: diff --git a/.mock/definition/workspace.yml b/.mock/definition/workspace.yml new file mode 100644 index 00000000..c382241c --- /dev/null +++ b/.mock/definition/workspace.yml @@ -0,0 +1,34 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + updateUserAutoProvisioning: + path: /v1/workspace/user-auto-provisioning + method: POST + auth: false + docs: Update user auto provisioning settings for the workspace. + source: + openapi: openapi.json + display-name: Update User Auto Provisioning + request: + name: BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost + body: + properties: + enabled: boolean + content-type: application/json + response: + docs: Successful Response + type: unknown + status-code: 200 + errors: + - root.UnprocessableEntityError + examples: + - request: + enabled: true + response: + body: + key: value + source: + openapi: openapi.json diff --git a/.mock/fern.config.json b/.mock/fern.config.json index 914e3a96..0fb68ddb 100644 --- a/.mock/fern.config.json +++ b/.mock/fern.config.json @@ -1,4 +1,4 @@ { "organization" : "elevenlabs", - "version" : "0.63.19" + "version" : "0.63.38" } \ No newline at end of file diff --git a/.mock/openapi.json b/.mock/openapi.json index 938237d9..48d80081 100644 --- a/.mock/openapi.json +++ b/.mock/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "ElevenLabs API Documentation", - "description": "This is the documentation for the ElevenLabs API. You can use this API to use our service programmatically, this is done by using your xi-api-key.
You can view your xi-api-key using the 'Profile' tab on https://elevenlabs.io. Our API is experimental so all endpoints are subject to change.", + "description": "This is the documentation for the ElevenLabs API. You can use this API to use our service programmatically, this is done by using your API key. You can find your API key in the dashboard at https://elevenlabs.io/app/settings/api-keys.", "version": "1.0" }, "paths": { @@ -661,267 +661,6 @@ "x-fern-streaming": true } }, - "/v1/shared-sound-generations": { - "get": { - "operationId": "Get_shared_sound_effects_v1_shared_sound_generations_get", - "summary": "Get Shared Sound Effects", - "description": "Returns a list of shared sound effects.", - "parameters": [ - { - "name": "page_size", - "in": "query", - "description": "How many sound effects to return at maximum. Can not exceed 100, defaults to 30.", - "required": false, - "schema": { - "description": "How many sound effects to return at maximum. Can not exceed 100, defaults to 30.", - "type": "integer", - "default": 30, - "title": "Page Size" - } - }, - { - "name": "category", - "in": "query", - "description": "Sound effect category used for filtering.", - "required": false, - "schema": { - "description": "Sound effect category used for filtering.", - "anyOf": [ - { - "enum": [ - "restaurant", - "park", - "industrial", - "school", - "office", - "urban", - "ocean", - "nature", - "weather", - "foley", - "fantasy", - "human", - "device", - "sci-fi", - "horror", - "animal", - "boom", - "braam", - "riser", - "whoosh", - "drone", - "impact", - "weapon", - "transport", - "household", - "percussion", - "cymbal", - "synth", - "bass", - "guitar", - "key", - "string", - "brass", - "woodwind", - "ui element", - "sport", - "vehicle", - "misc" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "examples": [ - "Nature" - ], - "title": "Category" - } - }, - { - "name": "search", - "in": "query", - "description": "Search term used for filtering", - "required": false, - "schema": { - "description": "Search term used for filtering", - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "examples": [ - "Cold water" - ], - "title": "Search" - } - }, - { - "name": "sort", - "in": "query", - "description": "Sort criteria. Can be one of: created_date, download_count, like_count, trending_score. Defaults to trending_score.", - "required": false, - "schema": { - "description": "Sort criteria. Can be one of: created_date, download_count, like_count, trending_score. Defaults to trending_score.", - "default": "trending_score", - "anyOf": [ - { - "enum": [ - "sharing_date_unix", - "purchased_count", - "like_count", - "trending_score" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "examples": [ - "trending_score" - ], - "title": "Sort" - } - }, - { - "name": "featured", - "in": "query", - "description": "Filter featured sound effects.", - "required": false, - "schema": { - "description": "Filter featured sound effects.", - "type": "boolean", - "default": false, - "examples": [ - true - ], - "title": "Featured" - } - }, - { - "name": "page", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 0, - "title": "Page" - } - }, - { - "name": "xi-api-key", - "in": "header", - "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", - "required": false, - "schema": { - "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Xi-Api-Key" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetSharedSoundGenerationsResponseModel" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "tags": [ - "sound-effects-explore" - ] - } - }, - "/v1/shared-sound-generations/{sound_effect_generation_id}/purchase": { - "post": { - "operationId": "Purchases_shared_sound_effect_v1_shared_sound_generations__sound_effect_generation_id__purchase_post", - "summary": "Purchases Shared Sound Effect", - "description": "Purchases shared sound effect and charges user for the purchase.", - "parameters": [ - { - "name": "sound_effect_generation_id", - "in": "path", - "description": "sound_effect_generation_id to be used, you can use GET https://api.elevenlabs.io/v1/sound-effects-history to receive a list of history items and their sound_effect_generation_ids.", - "required": true, - "schema": { - "description": "sound_effect_generation_id to be used, you can use GET https://api.elevenlabs.io/v1/sound-effects-history to receive a list of history items and their sound_effect_generation_ids.", - "type": "string", - "examples": [ - "VW7YKqPnjY4h39yTbx2L" - ], - "title": "Sound Effect Generation Id" - } - }, - { - "name": "xi-api-key", - "in": "header", - "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", - "required": false, - "schema": { - "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Xi-Api-Key" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "audio/mpeg": {} - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "tags": [ - "sound-effects-explore" - ] - } - }, "/v1/voices/{voice_id}/samples/{sample_id}": { "delete": { "operationId": "Delete_sample_v1_voices__voice_id__samples__sample_id__delete", @@ -1757,8 +1496,7 @@ "text-to-dialogue" ], "x-fern-sdk-group-name": "text_to_dialogue", - "x-fern-sdk-method-name": "convert", - "x-fern-streaming": true + "x-fern-sdk-method-name": "convert" } }, "/v1/text-to-dialogue/stream": { @@ -2747,10 +2485,10 @@ { "name": "voice_type", "in": "query", - "description": "Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to 'personal' plus 'community'.", + "description": "Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to all but 'default'.", "required": false, "schema": { - "description": "Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to 'personal' plus 'community'.", + "description": "Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to all but 'default'.", "anyOf": [ { "type": "string" @@ -9533,54 +9271,27 @@ "x-fern-sdk-method-name": "list" } }, - "/v1/workspace/groups/search": { - "get": { - "operationId": "Search_user_groups_v1_workspace_groups_search_get", - "summary": "Search User Groups", - "description": "Searches for user groups in the workspace. Multiple or no groups may be returned.", - "parameters": [ - { - "name": "name", - "in": "query", - "description": "Name of the target group.", - "required": true, - "schema": { - "description": "Name of the target group.", - "type": "string", - "title": "Name" - } - }, - { - "name": "xi-api-key", - "in": "header", - "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", - "required": false, - "schema": { - "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Xi-Api-Key" + "/v1/workspace/user-auto-provisioning": { + "post": { + "operationId": "update_user_auto_provisioning_v1_workspace_user_auto_provisioning_post", + "summary": "Update User Auto Provisioning", + "description": "Update user auto provisioning settings for the workspace.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_update_user_auto_provisioning_v1_workspace_user_auto_provisioning_post" + } } } - ], + }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/WorkspaceGroupByNameResponseModel" - }, - "title": "Response Search User Groups V1 Workspace Groups Search Get" - } + "schema": {} } } }, @@ -9596,30 +9307,98 @@ } }, "tags": [ - "workspace" - ], - "x-fern-sdk-group-name": [ "workspace", - "groups" - ], - "x-fern-sdk-method-name": "search" + "workspace" + ] } }, - "/v1/workspace/groups/{group_id}/members/remove": { - "post": { - "operationId": "Delete_member_from_user_group_v1_workspace_groups__group_id__members_remove_post", - "summary": "Delete Member From User Group", - "description": "Removes a member from the specified group. This endpoint may only be called by workspace administrators.", + "/v1/workspace/groups/search": { + "get": { + "operationId": "Search_user_groups_v1_workspace_groups_search_get", + "summary": "Search User Groups", + "description": "Searches for user groups in the workspace. Multiple or no groups may be returned.", "parameters": [ { - "name": "group_id", - "in": "path", - "description": "The ID of the target group.", + "name": "name", + "in": "query", + "description": "Name of the target group.", "required": true, "schema": { - "description": "The ID of the target group.", + "description": "Name of the target group.", "type": "string", - "title": "Group Id" + "title": "Name" + } + }, + { + "name": "xi-api-key", + "in": "header", + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "required": false, + "schema": { + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Xi-Api-Key" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WorkspaceGroupByNameResponseModel" + }, + "title": "Response Search User Groups V1 Workspace Groups Search Get" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "tags": [ + "workspace" + ], + "x-fern-sdk-group-name": [ + "workspace", + "groups" + ], + "x-fern-sdk-method-name": "search" + } + }, + "/v1/workspace/groups/{group_id}/members/remove": { + "post": { + "operationId": "Delete_member_from_user_group_v1_workspace_groups__group_id__members_remove_post", + "summary": "Delete Member From User Group", + "description": "Removes a member from the specified group. This endpoint may only be called by workspace administrators.", + "parameters": [ + { + "name": "group_id", + "in": "path", + "description": "The ID of the target group.", + "required": true, + "schema": { + "description": "The ID of the target group.", + "type": "string", + "title": "Group Id" } }, { @@ -20970,10 +20749,24 @@ "title": "Cloud Storage Url" }, "webhook": { - "description": "Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. Webhooks can be created and assigned to a transcription task in webhook settings page in the UI.", + "description": "Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook.", "type": "boolean", "default": false, "title": "Webhook" + }, + "temperature": { + "description": "Controls the randomness of the transcription output. Accepts values between 0.0 and 2.0, where higher values result in more diverse and less deterministic results. If omitted, we will use a temperature based on the model you selected which is usually 0.", + "anyOf": [ + { + "type": "number", + "maximum": 2, + "minimum": 0 + }, + { + "type": "null" + } + ], + "title": "Temperature" } }, "required": [ @@ -22479,6 +22272,19 @@ ], "title": "Body_Verify_PVC_voice_captcha_v1_voices_pvc__voice_id__captcha_post" }, + "Body_update_user_auto_provisioning_v1_workspace_user_auto_provisioning_post": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "title": "Enabled" + } + }, + "required": [ + "enabled" + ], + "title": "Body_update_user_auto_provisioning_v1_workspace_user_auto_provisioning_post" + }, "BreakdownTypes": { "description": "How to break down the information. Cannot be \"user\" or \"api_key\" if include_workspace_metrics is False.", "type": "string", @@ -22497,6 +22303,67 @@ ], "title": "BreakdownTypes" }, + "BuiltInTools": { + "type": "object", + "properties": { + "end_call": { + "description": "The end call tool", + "anyOf": [ + { + "$ref": "#/components/schemas/SystemToolConfig-Input" + }, + { + "type": "null" + } + ] + }, + "language_detection": { + "description": "The language detection tool", + "anyOf": [ + { + "$ref": "#/components/schemas/SystemToolConfig-Input" + }, + { + "type": "null" + } + ] + }, + "transfer_to_agent": { + "description": "The transfer to agent tool", + "anyOf": [ + { + "$ref": "#/components/schemas/SystemToolConfig-Input" + }, + { + "type": "null" + } + ] + }, + "transfer_to_number": { + "description": "The transfer to number tool", + "anyOf": [ + { + "$ref": "#/components/schemas/SystemToolConfig-Input" + }, + { + "type": "null" + } + ] + }, + "skip_turn": { + "description": "The skip turn tool", + "anyOf": [ + { + "$ref": "#/components/schemas/SystemToolConfig-Input" + }, + { + "type": "null" + } + ] + } + }, + "title": "BuiltInTools" + }, "ChapterContentBlockExtendableNodeResponseModel": { "description": "Not used. Make sure you anticipate new types in the future.", "type": "object", @@ -23104,10 +22971,11 @@ "agent_response", "agent_response_correction", "client_tool_call", + "mcp_tool_call", + "agent_tool_response", "vad_score", "internal_turn_probability", - "internal_tentative_agent_response", - "internal_native_mcp_tool_call" + "internal_tentative_agent_response" ], "title": "ClientEvent" }, @@ -27995,39 +27863,6 @@ ], "title": "GetPronunciationDictionaryMetadataResponseModel" }, - "GetSharedSoundGenerationsResponseModel": { - "type": "object", - "properties": { - "shared_sound_generations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SharedSoundGenerationResponseModel" - }, - "title": "Shared Sound Generations" - }, - "last_sort_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Last Sort Id" - }, - "has_more": { - "type": "boolean", - "title": "Has More" - } - }, - "required": [ - "shared_sound_generations", - "last_sort_id", - "has_more" - ], - "title": "GetSharedSoundGenerationsResponseModel" - }, "GetSpeechHistoryResponseModel": { "type": "object", "properties": { @@ -28437,6 +28272,14 @@ }, "title": "ImageAvatar" }, + "IntegrationType": { + "type": "string", + "enum": [ + "mcp_server", + "mcp_integration" + ], + "title": "IntegrationType" + }, "InvoiceResponseModel": { "type": "object", "properties": { @@ -29276,18 +29119,18 @@ ], "title": "LiteralJsonSchemaProperty" }, - "MCPApprovalRequiredModel": { - "description": "Defines the approval model for an MCP tool", + "MCPApprovalPolicy": { + "description": "Defines the MCP server-level approval policy for tool execution.", "type": "string", "enum": [ - "user_approval_always_given", - "user_approval_never_given", - "user_approval_required_per_tool" + "auto_approve_all", + "require_approval_all", + "require_approval_per_tool" ], - "title": "MCPApprovalRequiredModel" + "title": "MCPApprovalPolicy" }, "MCPToolConfig-Input": { - "description": "A MCP tool is a tool that is used to call a MCP server", + "description": "An MCP tool configuration that can be used to call MCP servers", "type": "object", "properties": { "id": { @@ -29313,12 +29156,15 @@ "title": "Response Timeout Secs" }, "type": { - "description": "The type of tool", "type": "string", "default": "mcp", "const": "mcp", "title": "Type" }, + "integration_type": { + "description": "The type of MCP tool", + "$ref": "#/components/schemas/IntegrationType" + }, "parameters": { "description": "Schema for any parameters the LLM needs to provide to the MCP tool.", "anyOf": [ @@ -29330,32 +29176,57 @@ } ] }, + "approval_policy": { + "description": "The approval policy for the MCP tool", + "default": "require_approval_all", + "$ref": "#/components/schemas/MCPApprovalPolicy" + }, "mcp_tool_name": { "description": "The name of the MCP tool to call", "type": "string", "title": "Mcp Tool Name" }, + "mcp_tool_description": { + "description": "The description of the MCP tool to call", + "type": "string", + "title": "Mcp Tool Description" + }, "mcp_server_id": { "description": "The id of the MCP server to call", "type": "string", "title": "Mcp Server Id" }, - "approval_mode": { - "description": "If set to approved, the tool will be pre-approved and not require user approval before executing", - "default": "user_approval_never_given", - "$ref": "#/components/schemas/MCPApprovalRequiredModel" + "mcp_server_name": { + "description": "The name of the MCP server to call", + "type": "string", + "title": "Mcp Server Name" + }, + "mcp_input_schema": { + "description": "Original inputSchema dict for consistent hashing (pure MCP format)", + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Mcp Input Schema" } }, "required": [ "name", "description", + "integration_type", "mcp_tool_name", - "mcp_server_id" + "mcp_tool_description", + "mcp_server_id", + "mcp_server_name" ], "title": "MCPToolConfig" }, "MCPToolConfig-Output": { - "description": "A MCP tool is a tool that is used to call a MCP server", + "description": "An MCP tool configuration that can be used to call MCP servers", "type": "object", "properties": { "id": { @@ -29381,12 +29252,15 @@ "title": "Response Timeout Secs" }, "type": { - "description": "The type of tool", "type": "string", "default": "mcp", "const": "mcp", "title": "Type" }, + "integration_type": { + "description": "The type of MCP tool", + "$ref": "#/components/schemas/IntegrationType" + }, "parameters": { "description": "Schema for any parameters the LLM needs to provide to the MCP tool.", "anyOf": [ @@ -29398,27 +29272,52 @@ } ] }, + "approval_policy": { + "description": "The approval policy for the MCP tool", + "default": "require_approval_all", + "$ref": "#/components/schemas/MCPApprovalPolicy" + }, "mcp_tool_name": { "description": "The name of the MCP tool to call", "type": "string", "title": "Mcp Tool Name" }, + "mcp_tool_description": { + "description": "The description of the MCP tool to call", + "type": "string", + "title": "Mcp Tool Description" + }, "mcp_server_id": { "description": "The id of the MCP server to call", "type": "string", "title": "Mcp Server Id" }, - "approval_mode": { - "description": "If set to approved, the tool will be pre-approved and not require user approval before executing", - "default": "user_approval_never_given", - "$ref": "#/components/schemas/MCPApprovalRequiredModel" + "mcp_server_name": { + "description": "The name of the MCP server to call", + "type": "string", + "title": "Mcp Server Name" + }, + "mcp_input_schema": { + "description": "Original inputSchema dict for consistent hashing (pure MCP format)", + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Mcp Input Schema" } }, "required": [ "name", "description", + "integration_type", "mcp_tool_name", - "mcp_server_id" + "mcp_tool_description", + "mcp_server_id", + "mcp_server_name" ], "title": "MCPToolConfig" }, @@ -29819,142 +29718,6 @@ ], "title": "ModerationStatusResponseModel" }, - "NativeMCPToolConfig-Input": { - "description": "A Native MCP tool is a tool that is used to call a Native MCP server", - "type": "object", - "properties": { - "id": { - "type": "string", - "default": "", - "title": "Id" - }, - "name": { - "type": "string", - "minLength": 0, - "pattern": "^[a-zA-Z0-9_-]{1,64}$", - "title": "Name" - }, - "description": { - "type": "string", - "minLength": 0, - "title": "Description" - }, - "response_timeout_secs": { - "description": "The maximum time in seconds to wait for the tool call to complete.", - "type": "integer", - "default": 20, - "title": "Response Timeout Secs" - }, - "type": { - "description": "The type of tool", - "type": "string", - "default": "native_mcp", - "const": "native_mcp", - "title": "Type" - }, - "parameters": { - "description": "Schema for any parameters the LLM needs to provide to the MCP tool.", - "anyOf": [ - { - "$ref": "#/components/schemas/ObjectJsonSchemaProperty-Input" - }, - { - "type": "null" - } - ] - }, - "mcp_tool_name": { - "description": "The name of the MCP tool to call", - "type": "string", - "title": "Mcp Tool Name" - }, - "mcp_server_id": { - "description": "The id of the MCP server to call", - "type": "string", - "title": "Mcp Server Id" - }, - "approval_mode": { - "description": "If set to always accept, the tool will be pre-approved and not require user approval before executing", - "default": "user_approval_never_given", - "$ref": "#/components/schemas/MCPApprovalRequiredModel" - } - }, - "required": [ - "name", - "description", - "mcp_tool_name", - "mcp_server_id" - ], - "title": "NativeMCPToolConfig" - }, - "NativeMCPToolConfig-Output": { - "description": "A Native MCP tool is a tool that is used to call a Native MCP server", - "type": "object", - "properties": { - "id": { - "type": "string", - "default": "", - "title": "Id" - }, - "name": { - "type": "string", - "minLength": 0, - "pattern": "^[a-zA-Z0-9_-]{1,64}$", - "title": "Name" - }, - "description": { - "type": "string", - "minLength": 0, - "title": "Description" - }, - "response_timeout_secs": { - "description": "The maximum time in seconds to wait for the tool call to complete.", - "type": "integer", - "default": 20, - "title": "Response Timeout Secs" - }, - "type": { - "description": "The type of tool", - "type": "string", - "default": "native_mcp", - "const": "native_mcp", - "title": "Type" - }, - "parameters": { - "description": "Schema for any parameters the LLM needs to provide to the MCP tool.", - "anyOf": [ - { - "$ref": "#/components/schemas/ObjectJsonSchemaProperty-Output" - }, - { - "type": "null" - } - ] - }, - "mcp_tool_name": { - "description": "The name of the MCP tool to call", - "type": "string", - "title": "Mcp Tool Name" - }, - "mcp_server_id": { - "description": "The id of the MCP server to call", - "type": "string", - "title": "Mcp Server Id" - }, - "approval_mode": { - "description": "If set to always accept, the tool will be pre-approved and not require user approval before executing", - "default": "user_approval_never_given", - "$ref": "#/components/schemas/MCPApprovalRequiredModel" - } - }, - "required": [ - "name", - "description", - "mcp_tool_name", - "mcp_server_id" - ], - "title": "NativeMCPToolConfig" - }, "ObjectJsonSchemaProperty-Input": { "type": "object", "properties": { @@ -31603,9 +31366,6 @@ }, { "$ref": "#/components/schemas/MCPToolConfig-Input" - }, - { - "$ref": "#/components/schemas/NativeMCPToolConfig-Input" } ], "description": "The type of tool", @@ -31614,7 +31374,6 @@ "mapping": { "client": "#/components/schemas/ClientToolConfig-Input", "mcp": "#/components/schemas/MCPToolConfig-Input", - "native_mcp": "#/components/schemas/NativeMCPToolConfig-Input", "system": "#/components/schemas/SystemToolConfig-Input", "webhook": "#/components/schemas/WebhookToolConfig-Input" } @@ -31739,9 +31498,6 @@ }, { "$ref": "#/components/schemas/MCPToolConfig-Output" - }, - { - "$ref": "#/components/schemas/NativeMCPToolConfig-Output" } ], "description": "The type of tool", @@ -31750,7 +31506,6 @@ "mapping": { "client": "#/components/schemas/ClientToolConfig-Output", "mcp": "#/components/schemas/MCPToolConfig-Output", - "native_mcp": "#/components/schemas/NativeMCPToolConfig-Output", "system": "#/components/schemas/SystemToolConfig-Output", "webhook": "#/components/schemas/WebhookToolConfig-Output" } @@ -31875,9 +31630,6 @@ }, { "$ref": "#/components/schemas/MCPToolConfig-Input" - }, - { - "$ref": "#/components/schemas/NativeMCPToolConfig-Input" } ], "description": "The type of tool", @@ -31886,7 +31638,6 @@ "mapping": { "client": "#/components/schemas/ClientToolConfig-Input", "mcp": "#/components/schemas/MCPToolConfig-Input", - "native_mcp": "#/components/schemas/NativeMCPToolConfig-Input", "system": "#/components/schemas/SystemToolConfig-Input", "webhook": "#/components/schemas/WebhookToolConfig-Input" } @@ -31962,6 +31713,9 @@ "type": "string" }, "title": "Knowledge Base Document Ids" + }, + "built_in_tools": { + "$ref": "#/components/schemas/BuiltInTools" } }, "example": { @@ -33473,77 +33227,6 @@ ], "title": "ShareOptionResponseModel" }, - "SharedSoundGenerationResponseModel": { - "type": "object", - "properties": { - "public_user_id": { - "type": "string", - "title": "Public User Id" - }, - "history_item_id": { - "type": "string", - "title": "History Item Id" - }, - "generation_id": { - "type": "string", - "title": "Generation Id" - }, - "text": { - "type": "string", - "title": "Text" - }, - "category": { - "type": "string", - "title": "Category" - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "title": "Labels" - }, - "purchased_count": { - "type": "integer", - "title": "Purchased Count" - }, - "like_count": { - "type": "integer", - "title": "Like Count" - }, - "featured": { - "type": "boolean", - "title": "Featured" - }, - "preview_url": { - "type": "string", - "title": "Preview Url" - }, - "purchased": { - "type": "boolean", - "title": "Purchased" - }, - "icon_url": { - "type": "string", - "title": "Icon Url" - } - }, - "required": [ - "public_user_id", - "history_item_id", - "generation_id", - "text", - "category", - "labels", - "purchased_count", - "like_count", - "featured", - "preview_url", - "purchased", - "icon_url" - ], - "title": "SharedSoundGenerationResponseModel" - }, "SimilarVoice": { "type": "object", "properties": { @@ -34954,6 +34637,55 @@ "type": "null" } ] + }, + "optimize_streaming_latency": { + "anyOf": [ + { + "$ref": "#/components/schemas/TTSOptimizeStreamingLatency" + }, + { + "type": "null" + } + ] + }, + "stability": { + "anyOf": [ + { + "type": "number", + "maximum": 1, + "minimum": 0 + }, + { + "type": "null" + } + ], + "title": "Stability" + }, + "speed": { + "anyOf": [ + { + "type": "number", + "maximum": 1.2, + "minimum": 0.7 + }, + { + "type": "null" + } + ], + "title": "Speed" + }, + "similarity_boost": { + "anyOf": [ + { + "type": "number", + "maximum": 1, + "minimum": 0 + }, + { + "type": "null" + } + ], + "title": "Similarity Boost" } }, "required": [ @@ -35409,6 +35141,12 @@ "$ref": "#/components/schemas/PhoneNumberTransfer" }, "title": "Transfers" + }, + "enable_client_message": { + "description": "Whether to play a message to the client while they wait for transfer. Defaults to true for backward compatibility.", + "type": "boolean", + "default": true, + "title": "Enable Client Message" } }, "required": [ @@ -38002,6 +37740,10 @@ "description": "Text contents of the widget", "$ref": "#/components/schemas/WidgetTextContents" }, + "styles": { + "description": "Styles for the widget", + "$ref": "#/components/schemas/WidgetStyles" + }, "language_selector": { "description": "Whether to show the language selector", "type": "boolean", @@ -38318,6 +38060,10 @@ "description": "Text contents of the widget", "$ref": "#/components/schemas/WidgetTextContents" }, + "styles": { + "description": "Styles for the widget", + "$ref": "#/components/schemas/WidgetStyles" + }, "language_selector": { "description": "Whether to show the language selector", "type": "boolean", @@ -38634,6 +38380,10 @@ "description": "Text contents of the widget", "$ref": "#/components/schemas/WidgetTextContents" }, + "styles": { + "description": "Styles for the widget", + "$ref": "#/components/schemas/WidgetStyles" + }, "language": { "type": "string", "title": "Language" @@ -38791,6 +38541,252 @@ ], "title": "WidgetPlacement" }, + "WidgetStyles": { + "type": "object", + "properties": { + "base": { + "description": "The base background color.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Base" + }, + "base_hover": { + "description": "The color of the base background when hovered.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Base Hover" + }, + "base_active": { + "description": "The color of the base background when active (clicked).", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Base Active" + }, + "base_border": { + "description": "The color of the border against the base background.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Base Border" + }, + "base_subtle": { + "description": "The color of subtle text against the base background.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Base Subtle" + }, + "base_primary": { + "description": "The color of primary text against the base background.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Base Primary" + }, + "base_error": { + "description": "The color of error text against the base background.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Base Error" + }, + "accent": { + "description": "The accent background color.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Accent" + }, + "accent_hover": { + "description": "The color of the accent background when hovered.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Accent Hover" + }, + "accent_active": { + "description": "The color of the accent background when active (clicked).", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Accent Active" + }, + "accent_border": { + "description": "The color of the border against the accent background.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Accent Border" + }, + "accent_subtle": { + "description": "The color of subtle text against the accent background.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Accent Subtle" + }, + "accent_primary": { + "description": "The color of primary text against the accent background.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Accent Primary" + }, + "overlay_padding": { + "description": "The padding around the edges of the viewport.", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Overlay Padding" + }, + "button_radius": { + "description": "The radius of the buttons.", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Button Radius" + }, + "input_radius": { + "description": "The radius of the input fields.", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Input Radius" + }, + "bubble_radius": { + "description": "The radius of the chat bubbles.", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Bubble Radius" + }, + "sheet_radius": { + "description": "The default radius of sheets.", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Sheet Radius" + }, + "compact_sheet_radius": { + "description": "The radius of the sheet in compact mode.", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Compact Sheet Radius" + }, + "dropdown_sheet_radius": { + "description": "The radius of the dropdown sheet.", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Dropdown Sheet Radius" + } + }, + "title": "WidgetStyles" + }, "WidgetTextContents": { "type": "object", "properties": { @@ -39136,7 +39132,7 @@ "convai_secrets", "music_latent", "convai_phone_numbers", - "convai_mcps", + "convai_mcp_servers", "convai_batch_calls" ], "title": "WorkspaceResourceType" @@ -39154,7 +39150,7 @@ }, { "name": "speech-to-text", - "description": "Transcribe your audio files with detailed speaker annotations and precise timestamps using our cutting-edge model. Speech-to-text is currently in alpha and available to a select group of users. We plan to roll it out more broadly soon." + "description": "Transcribe your audio files with detailed speaker annotations and precise timestamps using our cutting-edge model." }, { "name": "forced-alignment", @@ -39166,7 +39162,7 @@ }, { "name": "voices", - "description": "Access to voices created either by you or us." + "description": "Access to voices created either by you or ElevenLabs." }, { "name": "samples", @@ -39177,8 +39173,8 @@ "description": "Accesses your speech history. Your speech history is a list of all your created audio including its metadata using our text-to-speech and speech-to-speech models." }, { - "name": "projects", - "description": "Access, create and convert Projects programmatically, only specifically whitelisted accounts can access the Projects API. If you need access please contact our sales team." + "name": "studios", + "description": "Access, create and convert Studio Projects programmatically, only specifically whitelisted accounts can access the Projects API. If you need access please contact our sales team." } ] } \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index f9668e89..b5b8add7 100644 --- a/poetry.lock +++ b/poetry.lock @@ -560,18 +560,18 @@ six = ">=1.5" [[package]] name = "requests" -version = "2.32.3" +version = "2.32.4" description = "Python HTTP for Humans." optional = false python-versions = ">=3.8" files = [ - {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, - {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, + {file = "requests-2.32.4-py3-none-any.whl", hash = "sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c"}, + {file = "requests-2.32.4.tar.gz", hash = "sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422"}, ] [package.dependencies] certifi = ">=2017.4.17" -charset-normalizer = ">=2,<4" +charset_normalizer = ">=2,<4" idna = ">=2.5,<4" urllib3 = ">=1.21.1,<3" diff --git a/pyproject.toml b/pyproject.toml index deeaeb4b..693641c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "elevenlabs" [tool.poetry] name = "elevenlabs" -version = "v2.3.0" +version = "v2.4.0" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md deleted file mode 100644 index 06a20977..00000000 --- a/reference.md +++ /dev/null @@ -1,14220 +0,0 @@ -# Reference -## History -
client.history.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of your generated audio. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.history.list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — How many history items to return at maximum. Can not exceed 1000, defaults to 100. - -
-
- -
-
- -**start_after_history_item_id:** `typing.Optional[str]` — After which ID to start fetching, use this parameter to paginate across a large collection of history items. In case this parameter is not provided history items will be fetched starting from the most recently created one ordered descending by their creation date. - -
-
- -
-
- -**voice_id:** `typing.Optional[str]` — ID of the voice to be filtered for. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. - -
-
- -
-
- -**search:** `typing.Optional[str]` — Search term used for filtering history items. If provided, source becomes required. - -
-
- -
-
- -**source:** `typing.Optional[HistoryListRequestSource]` — Source of the generated history item - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.history.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves a history item. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.history.get( - history_item_id="VW7YKqPnjY4h39yTbx2L", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**history_item_id:** `str` — ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/get-all) endpoint to retrieve a list of history items. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.history.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete a history item by its ID -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.history.delete( - history_item_id="VW7YKqPnjY4h39yTbx2L", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**history_item_id:** `str` — ID of the history item to be used. You can use the [Get generated items](/docs/api-reference/history/get-all) endpoint to retrieve a list of history items. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## TextToSoundEffects -
client.text_to_sound_effects.convert(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Turn text into sound effects for your videos, voice-overs or video games using the most advanced sound effects model in the world. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.text_to_sound_effects.convert( - text="Spacious braam suitable for high-impact movie trailer moments", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**text:** `str` — The text that will get converted into a sound effect. - -
-
- -
-
- -**output_format:** `typing.Optional[TextToSoundEffectsConvertRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. - -
-
- -
-
- -**duration_seconds:** `typing.Optional[float]` — The duration of the sound which will be generated in seconds. Must be at least 0.5 and at most 22. If set to None we will guess the optimal duration using the prompt. Defaults to None. - -
-
- -
-
- -**prompt_influence:** `typing.Optional[float]` — A higher prompt influence makes your generation follow the prompt more closely while also making generations less variable. Must be a value between 0 and 1. Defaults to 0.3. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. - -
-
-
-
- - -
-
-
- -## AudioIsolation -## Samples -
client.samples.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Removes a sample by its ID. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.samples.delete( - voice_id="21m00Tcm4TlvDq8ikWAM", - sample_id="VW7YKqPnjY4h39yTbx2L", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. - -
-
- -
-
- -**sample_id:** `str` — ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## TextToSpeech -
client.text_to_speech.convert(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Converts text into speech using a voice of your choice and returns audio. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.text_to_speech.convert( - voice_id="JBFqnCBsd6RMkjVDRZzb", - output_format="mp3_44100_128", - text="The first move is what sets everything in motion.", - model_id="eleven_multilingual_v2", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. - -
-
- -
-
- -**text:** `str` — The text that will get converted into speech. - -
-
- -
-
- -**enable_logging:** `typing.Optional[bool]` — When enable_logging is set to false zero retention mode will be used for the request. This will mean history features are unavailable for this request, including request stitching. Zero retention mode may only be used by enterprise customers. - -
-
- -
-
- -**optimize_streaming_latency:** `typing.Optional[int]` - -You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: -0 - default mode (no latency optimizations) -1 - normal latency optimizations (about 50% of possible latency improvement of option 3) -2 - strong latency optimizations (about 75% of possible latency improvement of option 3) -3 - max latency optimizations -4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). - -Defaults to None. - -
-
- -
-
- -**output_format:** `typing.Optional[TextToSpeechConvertRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. - -
-
- -
-
- -**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. - -
-
- -
-
- -**language_code:** `typing.Optional[str]` — Language code (ISO 639-1) used to enforce a language for the model. Currently only Turbo v2.5 and Flash v2.5 support language enforcement. For other models, an error will be returned if language code is provided. - -
-
- -
-
- -**voice_settings:** `typing.Optional[VoiceSettings]` — Voice settings overriding stored settings for the given voice. They are applied only on the given request. - -
-
- -
-
- -**pronunciation_dictionary_locators:** `typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]]` — A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request - -
-
- -
-
- -**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. - -
-
- -
-
- -**previous_text:** `typing.Optional[str]` — The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. - -
-
- -
-
- -**next_text:** `typing.Optional[str]` — The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. - -
-
- -
-
- -**previous_request_ids:** `typing.Optional[typing.Sequence[str]]` — A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. - -
-
- -
-
- -**next_request_ids:** `typing.Optional[typing.Sequence[str]]` — A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. - -
-
- -
-
- -**use_pvc_as_ivc:** `typing.Optional[bool]` — If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. - -
-
- -
-
- -**apply_text_normalization:** `typing.Optional[BodyTextToSpeechV1TextToSpeechVoiceIdPostApplyTextNormalization]` — This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. Cannot be turned on for 'eleven_turbo_v2_5' or 'eleven_flash_v2_5' models. - -
-
- -
-
- -**apply_language_text_normalization:** `typing.Optional[bool]` — This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. - -
-
-
-
- - -
-
-
- -
client.text_to_speech.convert_with_timestamps(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Generate speech from text with precise character-level timing information for audio-text synchronization. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.text_to_speech.convert_with_timestamps( - voice_id="21m00Tcm4TlvDq8ikWAM", - text="This is a test for the API of ElevenLabs.", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**text:** `str` — The text that will get converted into speech. - -
-
- -
-
- -**enable_logging:** `typing.Optional[bool]` — When enable_logging is set to false zero retention mode will be used for the request. This will mean history features are unavailable for this request, including request stitching. Zero retention mode may only be used by enterprise customers. - -
-
- -
-
- -**optimize_streaming_latency:** `typing.Optional[int]` - -You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: -0 - default mode (no latency optimizations) -1 - normal latency optimizations (about 50% of possible latency improvement of option 3) -2 - strong latency optimizations (about 75% of possible latency improvement of option 3) -3 - max latency optimizations -4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). - -Defaults to None. - -
-
- -
-
- -**output_format:** `typing.Optional[TextToSpeechConvertWithTimestampsRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. - -
-
- -
-
- -**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. - -
-
- -
-
- -**language_code:** `typing.Optional[str]` — Language code (ISO 639-1) used to enforce a language for the model. Currently only Turbo v2.5 and Flash v2.5 support language enforcement. For other models, an error will be returned if language code is provided. - -
-
- -
-
- -**voice_settings:** `typing.Optional[VoiceSettings]` — Voice settings overriding stored settings for the given voice. They are applied only on the given request. - -
-
- -
-
- -**pronunciation_dictionary_locators:** `typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]]` — A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request - -
-
- -
-
- -**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. - -
-
- -
-
- -**previous_text:** `typing.Optional[str]` — The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. - -
-
- -
-
- -**next_text:** `typing.Optional[str]` — The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. - -
-
- -
-
- -**previous_request_ids:** `typing.Optional[typing.Sequence[str]]` — A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. - -
-
- -
-
- -**next_request_ids:** `typing.Optional[typing.Sequence[str]]` — A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. - -
-
- -
-
- -**use_pvc_as_ivc:** `typing.Optional[bool]` — If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. - -
-
- -
-
- -**apply_text_normalization:** `typing.Optional[ - BodyTextToSpeechWithTimestampsV1TextToSpeechVoiceIdWithTimestampsPostApplyTextNormalization -]` — This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. Cannot be turned on for 'eleven_turbo_v2_5' or 'eleven_flash_v2_5' models. - -
-
- -
-
- -**apply_language_text_normalization:** `typing.Optional[bool]` — This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.text_to_speech.stream(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Converts text into speech using a voice of your choice and returns audio as an audio stream. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.text_to_speech.stream( - voice_id="JBFqnCBsd6RMkjVDRZzb", - output_format="mp3_44100_128", - text="The first move is what sets everything in motion.", - model_id="eleven_multilingual_v2", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. - -
-
- -
-
- -**text:** `str` — The text that will get converted into speech. - -
-
- -
-
- -**enable_logging:** `typing.Optional[bool]` — When enable_logging is set to false zero retention mode will be used for the request. This will mean history features are unavailable for this request, including request stitching. Zero retention mode may only be used by enterprise customers. - -
-
- -
-
- -**optimize_streaming_latency:** `typing.Optional[int]` - -You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: -0 - default mode (no latency optimizations) -1 - normal latency optimizations (about 50% of possible latency improvement of option 3) -2 - strong latency optimizations (about 75% of possible latency improvement of option 3) -3 - max latency optimizations -4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). - -Defaults to None. - -
-
- -
-
- -**output_format:** `typing.Optional[TextToSpeechStreamRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. - -
-
- -
-
- -**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. - -
-
- -
-
- -**language_code:** `typing.Optional[str]` — Language code (ISO 639-1) used to enforce a language for the model. Currently only Turbo v2.5 and Flash v2.5 support language enforcement. For other models, an error will be returned if language code is provided. - -
-
- -
-
- -**voice_settings:** `typing.Optional[VoiceSettings]` — Voice settings overriding stored settings for the given voice. They are applied only on the given request. - -
-
- -
-
- -**pronunciation_dictionary_locators:** `typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]]` — A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request - -
-
- -
-
- -**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. - -
-
- -
-
- -**previous_text:** `typing.Optional[str]` — The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. - -
-
- -
-
- -**next_text:** `typing.Optional[str]` — The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. - -
-
- -
-
- -**previous_request_ids:** `typing.Optional[typing.Sequence[str]]` — A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. - -
-
- -
-
- -**next_request_ids:** `typing.Optional[typing.Sequence[str]]` — A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. - -
-
- -
-
- -**use_pvc_as_ivc:** `typing.Optional[bool]` — If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. - -
-
- -
-
- -**apply_text_normalization:** `typing.Optional[ - BodyTextToSpeechStreamingV1TextToSpeechVoiceIdStreamPostApplyTextNormalization -]` — This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. Cannot be turned on for 'eleven_turbo_v2_5' or 'eleven_flash_v2_5' models. - -
-
- -
-
- -**apply_language_text_normalization:** `typing.Optional[bool]` — This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. - -
-
-
-
- - -
-
-
- -
client.text_to_speech.stream_with_timestamps(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Converts text into speech using a voice of your choice and returns a stream of JSONs containing audio as a base64 encoded string together with information on when which character was spoken. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -response = client.text_to_speech.stream_with_timestamps( - voice_id="JBFqnCBsd6RMkjVDRZzb", - output_format="mp3_44100_128", - text="The first move is what sets everything in motion.", - model_id="eleven_multilingual_v2", -) -for chunk in response.data: - yield chunk - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. - -
-
- -
-
- -**text:** `str` — The text that will get converted into speech. - -
-
- -
-
- -**enable_logging:** `typing.Optional[bool]` — When enable_logging is set to false zero retention mode will be used for the request. This will mean history features are unavailable for this request, including request stitching. Zero retention mode may only be used by enterprise customers. - -
-
- -
-
- -**optimize_streaming_latency:** `typing.Optional[int]` - -You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: -0 - default mode (no latency optimizations) -1 - normal latency optimizations (about 50% of possible latency improvement of option 3) -2 - strong latency optimizations (about 75% of possible latency improvement of option 3) -3 - max latency optimizations -4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). - -Defaults to None. - -
-
- -
-
- -**output_format:** `typing.Optional[TextToSpeechStreamWithTimestampsRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. - -
-
- -
-
- -**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. - -
-
- -
-
- -**language_code:** `typing.Optional[str]` — Language code (ISO 639-1) used to enforce a language for the model. Currently only Turbo v2.5 and Flash v2.5 support language enforcement. For other models, an error will be returned if language code is provided. - -
-
- -
-
- -**voice_settings:** `typing.Optional[VoiceSettings]` — Voice settings overriding stored settings for the given voice. They are applied only on the given request. - -
-
- -
-
- -**pronunciation_dictionary_locators:** `typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]]` — A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request - -
-
- -
-
- -**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. - -
-
- -
-
- -**previous_text:** `typing.Optional[str]` — The text that came before the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. - -
-
- -
-
- -**next_text:** `typing.Optional[str]` — The text that comes after the text of the current request. Can be used to improve the speech's continuity when concatenating together multiple generations or to influence the speech's continuity in the current generation. - -
-
- -
-
- -**previous_request_ids:** `typing.Optional[typing.Sequence[str]]` — A list of request_id of the samples that were generated before this generation. Can be used to improve the speech's continuity when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send. - -
-
- -
-
- -**next_request_ids:** `typing.Optional[typing.Sequence[str]]` — A list of request_id of the samples that come after this generation. next_request_ids is especially useful for maintaining the speech's continuity when regenerating a sample that has had some audio quality issues. For example, if you have generated 3 speech clips, and you want to improve clip 2, passing the request id of clip 3 as a next_request_id (and that of clip 1 as a previous_request_id) will help maintain natural flow in the combined speech. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send. - -
-
- -
-
- -**use_pvc_as_ivc:** `typing.Optional[bool]` — If true, we won't use PVC version of the voice for the generation but the IVC version. This is a temporary workaround for higher latency in PVC versions. - -
-
- -
-
- -**apply_text_normalization:** `typing.Optional[ - BodyTextToSpeechStreamingWithTimestampsV1TextToSpeechVoiceIdStreamWithTimestampsPostApplyTextNormalization -]` — This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. Cannot be turned on for 'eleven_turbo_v2_5' or 'eleven_flash_v2_5' models. - -
-
- -
-
- -**apply_language_text_normalization:** `typing.Optional[bool]` — This parameter controls language text normalization. This helps with proper pronunciation of text in some supported languages. WARNING: This parameter can heavily increase the latency of the request. Currently only supported for Japanese. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## TextToDialogue -
client.text_to_dialogue.convert(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Eleven v3 API access is currently not publicly available, but will be soon.
Converts a list of text and voice ID pairs into speech (dialogue) and returns audio. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import DialogueInput, ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.text_to_dialogue.convert( - inputs=[ - DialogueInput( - text="Knock knock", - voice_id="JBFqnCBsd6RMkjVDRZzb", - ), - DialogueInput( - text="Who is there?", - voice_id="Aw4FAjKCGjjNkVhN1Xmq", - ), - ], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**inputs:** `typing.Sequence[DialogueInput]` — A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. - -
-
- -
-
- -**output_format:** `typing.Optional[TextToDialogueConvertRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. - -
-
- -
-
- -**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. - -
-
- -
-
- -**settings:** `typing.Optional[ModelSettingsResponseModel]` — Settings controlling the dialogue generation. - -
-
- -
-
- -**pronunciation_dictionary_locators:** `typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]]` — A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request - -
-
- -
-
- -**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. - -
-
-
-
- - -
-
-
- -
client.text_to_dialogue.stream(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Eleven v3 API access is currently not publicly available, but will be soon.
Converts a list of text and voice ID pairs into speech (dialogue) and returns an audio stream. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import DialogueInput, ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.text_to_dialogue.stream( - inputs=[ - DialogueInput( - text="Knock knock", - voice_id="JBFqnCBsd6RMkjVDRZzb", - ), - DialogueInput( - text="Who is there?", - voice_id="Aw4FAjKCGjjNkVhN1Xmq", - ), - ], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**inputs:** `typing.Sequence[DialogueInput]` — A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. - -
-
- -
-
- -**output_format:** `typing.Optional[TextToDialogueStreamRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. - -
-
- -
-
- -**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. - -
-
- -
-
- -**settings:** `typing.Optional[ModelSettingsResponseModel]` — Settings controlling the dialogue generation. - -
-
- -
-
- -**pronunciation_dictionary_locators:** `typing.Optional[typing.Sequence[PronunciationDictionaryVersionLocator]]` — A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request - -
-
- -
-
- -**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. - -
-
-
-
- - -
-
-
- -## SpeechToSpeech -
client.speech_to_speech.convert(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Transform audio from one voice to another. Maintain full control over emotion, timing and delivery. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.speech_to_speech.convert( - voice_id="JBFqnCBsd6RMkjVDRZzb", - output_format="mp3_44100_128", - model_id="eleven_multilingual_sts_v2", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. - -
-
- -
-
- -**audio:** `from __future__ import annotations - -core.File` — See core.File for more documentation - -
-
- -
-
- -**enable_logging:** `typing.Optional[bool]` — When enable_logging is set to false zero retention mode will be used for the request. This will mean history features are unavailable for this request, including request stitching. Zero retention mode may only be used by enterprise customers. - -
-
- -
-
- -**optimize_streaming_latency:** `typing.Optional[int]` - -You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: -0 - default mode (no latency optimizations) -1 - normal latency optimizations (about 50% of possible latency improvement of option 3) -2 - strong latency optimizations (about 75% of possible latency improvement of option 3) -3 - max latency optimizations -4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). - -Defaults to None. - -
-
- -
-
- -**output_format:** `typing.Optional[SpeechToSpeechConvertRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. - -
-
- -
-
- -**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for speech to speech, you can check this using the can_do_voice_conversion property. - -
-
- -
-
- -**voice_settings:** `typing.Optional[str]` — Voice settings overriding stored settings for the given voice. They are applied only on the given request. Needs to be send as a JSON encoded string. - -
-
- -
-
- -**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. - -
-
- -
-
- -**remove_background_noise:** `typing.Optional[bool]` — If set, will remove the background noise from your audio input using our audio isolation model. Only applies to Voice Changer. - -
-
- -
-
- -**file_format:** `typing.Optional[SpeechToSpeechConvertRequestFileFormat]` — The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. - -
-
-
-
- - -
-
-
- -
client.speech_to_speech.stream(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Stream audio from one voice to another. Maintain full control over emotion, timing and delivery. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.speech_to_speech.stream( - voice_id="JBFqnCBsd6RMkjVDRZzb", - output_format="mp3_44100_128", - model_id="eleven_multilingual_sts_v2", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — ID of the voice to be used. Use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. - -
-
- -
-
- -**audio:** `from __future__ import annotations - -core.File` — See core.File for more documentation - -
-
- -
-
- -**enable_logging:** `typing.Optional[bool]` — When enable_logging is set to false zero retention mode will be used for the request. This will mean history features are unavailable for this request, including request stitching. Zero retention mode may only be used by enterprise customers. - -
-
- -
-
- -**optimize_streaming_latency:** `typing.Optional[int]` - -You can turn on latency optimizations at some cost of quality. The best possible final latency varies by model. Possible values: -0 - default mode (no latency optimizations) -1 - normal latency optimizations (about 50% of possible latency improvement of option 3) -2 - strong latency optimizations (about 75% of possible latency improvement of option 3) -3 - max latency optimizations -4 - max latency optimizations, but also with text normalizer turned off for even more latency savings (best latency, but can mispronounce eg numbers and dates). - -Defaults to None. - -
-
- -
-
- -**output_format:** `typing.Optional[SpeechToSpeechStreamRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs. - -
-
- -
-
- -**model_id:** `typing.Optional[str]` — Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for speech to speech, you can check this using the can_do_voice_conversion property. - -
-
- -
-
- -**voice_settings:** `typing.Optional[str]` — Voice settings overriding stored settings for the given voice. They are applied only on the given request. Needs to be send as a JSON encoded string. - -
-
- -
-
- -**seed:** `typing.Optional[int]` — If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295. - -
-
- -
-
- -**remove_background_noise:** `typing.Optional[bool]` — If set, will remove the background noise from your audio input using our audio isolation model. Only applies to Voice Changer. - -
-
- -
-
- -**file_format:** `typing.Optional[SpeechToSpeechStreamRequestFileFormat]` — The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. - -
-
-
-
- - -
-
-
- -## TextToVoice -
client.text_to_voice.create_previews(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a voice from a text prompt. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.text_to_voice.create_previews( - voice_description="A sassy squeaky mouse", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_description:** `str` — Description to use for the created voice. - -
-
- -
-
- -**output_format:** `typing.Optional[TextToVoiceCreatePreviewsRequestOutputFormat]` — The output format of the generated audio. - -
-
- -
-
- -**text:** `typing.Optional[str]` — Text to generate, text length has to be between 100 and 1000. - -
-
- -
-
- -**auto_generate_text:** `typing.Optional[bool]` — Whether to automatically generate a text suitable for the voice description. - -
-
- -
-
- -**loudness:** `typing.Optional[float]` — Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. - -
-
- -
-
- -**quality:** `typing.Optional[float]` — Higher quality results in better voice output but less variety. - -
-
- -
-
- -**seed:** `typing.Optional[int]` — Random number that controls the voice generation. Same seed with same inputs produces same voice. - -
-
- -
-
- -**guidance_scale:** `typing.Optional[float]` — Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.text_to_voice.create_voice_from_preview(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Add a generated voice to the voice library. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.text_to_voice.create_voice_from_preview( - voice_name="Sassy squeaky mouse", - voice_description="A sassy squeaky mouse", - generated_voice_id="37HceQefKmEi3bGovXjL", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_name:** `str` — Name to use for the created voice. - -
-
- -
-
- -**voice_description:** `str` — Description to use for the created voice. - -
-
- -
-
- -**generated_voice_id:** `str` — The generated_voice_id to create, call POST /v1/text-to-voice/create-previews and fetch the generated_voice_id from the response header if don't have one yet. - -
-
- -
-
- -**labels:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]` — Optional, metadata to add to the created voice. Defaults to None. - -
-
- -
-
- -**played_not_selected_voice_ids:** `typing.Optional[typing.Sequence[str]]` — List of voice ids that the user has played but not selected. Used for RLHF. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## User -
client.user.get() -
-
- -#### 📝 Description - -
-
- -
-
- -Gets information about the user -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.user.get() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Voices -
client.voices.get_all(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of all available voices for a user. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.get_all() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**show_legacy:** `typing.Optional[bool]` — If set to true, legacy premade voices will be included in responses from /v1/voices - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.search(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Gets a list of all available voices for a user with search, filtering and pagination. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.search( - include_total_count=True, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**next_page_token:** `typing.Optional[str]` — The next page token to use for pagination. Returned from the previous request. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — How many voices to return at maximum. Can not exceed 100, defaults to 10. Page 0 may include more voices due to default voices being included. - -
-
- -
-
- -**search:** `typing.Optional[str]` — Search term to filter voices by. Searches in name, description, labels, category. - -
-
- -
-
- -**sort:** `typing.Optional[str]` — Which field to sort by, one of 'created_at_unix' or 'name'. 'created_at_unix' may not be available for older voices. - -
-
- -
-
- -**sort_direction:** `typing.Optional[str]` — Which direction to sort the voices in. 'asc' or 'desc'. - -
-
- -
-
- -**voice_type:** `typing.Optional[str]` — Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to 'personal' plus 'community'. - -
-
- -
-
- -**category:** `typing.Optional[str]` — Category of the voice to filter by. One of 'premade', 'cloned', 'generated', 'professional' - -
-
- -
-
- -**fine_tuning_state:** `typing.Optional[str]` — State of the voice's fine tuning to filter by. Applicable only to professional voices clones. One of 'draft', 'not_verified', 'not_started', 'queued', 'fine_tuning', 'fine_tuned', 'failed', 'delayed' - -
-
- -
-
- -**collection_id:** `typing.Optional[str]` — Collection ID to filter voices by. - -
-
- -
-
- -**include_total_count:** `typing.Optional[bool]` — Whether to include the total count of voices found in the response. Incurs a performance cost. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns metadata about a specific voice. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.get( - voice_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. - -
-
- -
-
- -**with_settings:** `typing.Optional[bool]` — This parameter is now deprecated. It is ignored and will be removed in a future version. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Deletes a voice by its ID. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.delete( - voice_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Edit a voice created by you. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.update( - voice_id="21m00Tcm4TlvDq8ikWAM", - name="name", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. - -
-
- -
-
- -**name:** `str` — The name that identifies this voice. This will be displayed in the dropdown of the website. - -
-
- -
-
- -**files:** `from __future__ import annotations - -typing.Optional[typing.List[core.File]]` — See core.File for more documentation - -
-
- -
-
- -**remove_background_noise:** `typing.Optional[bool]` — If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. - -
-
- -
-
- -**description:** `typing.Optional[str]` — A description of the voice. - -
-
- -
-
- -**labels:** `typing.Optional[str]` — Serialized labels dictionary for the voice. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.share(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Add a shared voice to your collection of Voices -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.share( - public_user_id="63e06b7e7cafdc46be4d2e0b3f045940231ae058d508589653d74d1265a574ca", - voice_id="21m00Tcm4TlvDq8ikWAM", - new_name="John Smith", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**public_user_id:** `str` — Public user ID used to publicly identify ElevenLabs users. - -
-
- -
-
- -**voice_id:** `str` — ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. - -
-
- -
-
- -**new_name:** `str` — The name that identifies this voice. This will be displayed in the dropdown of the website. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.get_shared(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves a list of shared voices. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.get_shared( - featured=True, - reader_app_enabled=True, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — How many shared voices to return at maximum. Can not exceed 100, defaults to 30. - -
-
- -
-
- -**category:** `typing.Optional[VoicesGetSharedRequestCategory]` — Voice category used for filtering - -
-
- -
-
- -**gender:** `typing.Optional[str]` — Gender used for filtering - -
-
- -
-
- -**age:** `typing.Optional[str]` — Age used for filtering - -
-
- -
-
- -**accent:** `typing.Optional[str]` — Accent used for filtering - -
-
- -
-
- -**language:** `typing.Optional[str]` — Language used for filtering - -
-
- -
-
- -**locale:** `typing.Optional[str]` — Locale used for filtering - -
-
- -
-
- -**search:** `typing.Optional[str]` — Search term used for filtering - -
-
- -
-
- -**use_cases:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Use-case used for filtering - -
-
- -
-
- -**descriptives:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Search term used for filtering - -
-
- -
-
- -**featured:** `typing.Optional[bool]` — Filter featured voices - -
-
- -
-
- -**min_notice_period_days:** `typing.Optional[int]` — Filter voices with a minimum notice period of the given number of days. - -
-
- -
-
- -**include_custom_rates:** `typing.Optional[bool]` — Include/exclude voices with custom rates - -
-
- -
-
- -**include_live_moderated:** `typing.Optional[bool]` — Include/exclude voices that are live moderated - -
-
- -
-
- -**reader_app_enabled:** `typing.Optional[bool]` — Filter voices that are enabled for the reader app - -
-
- -
-
- -**owner_id:** `typing.Optional[str]` — Filter voices by public owner ID - -
-
- -
-
- -**sort:** `typing.Optional[str]` — Sort criteria - -
-
- -
-
- -**page:** `typing.Optional[int]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.find_similar_voices(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of shared voices similar to the provided audio sample. If neither similarity_threshold nor top_k is provided, we will apply default values. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.find_similar_voices() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**audio_file:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**similarity_threshold:** `typing.Optional[float]` — Threshold for voice similarity between provided sample and library voices. Values range from 0 to 2. The smaller the value the more similar voices will be returned. - -
-
- -
-
- -**top_k:** `typing.Optional[int]` — Number of most similar voices to return. If similarity_threshold is provided, less than this number of voices may be returned. Values range from 1 to 100. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Studio -
client.studio.create_podcast(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create and auto-convert a podcast project. Currently, the LLM cost is covered by us but you will still be charged for the audio generation. In the future, you will be charged for both the LLM and audio generation costs. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ( - ElevenLabs, - PodcastConversationModeData, - PodcastTextSource, -) -from elevenlabs.studio import ( - BodyCreatePodcastV1StudioPodcastsPostMode_Conversation, -) - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.create_podcast( - model_id="21m00Tcm4TlvDq8ikWAM", - mode=BodyCreatePodcastV1StudioPodcastsPostMode_Conversation( - conversation=PodcastConversationModeData( - host_voice_id="aw1NgEzBg83R7vgmiJt6", - guest_voice_id="aw1NgEzBg83R7vgmiJt7", - ), - ), - source=PodcastTextSource( - text="This is a test podcast.", - ), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**model_id:** `str` — The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models. - -
-
- -
-
- -**mode:** `BodyCreatePodcastV1StudioPodcastsPostMode` — The type of podcast to generate. Can be 'conversation', an interaction between two voices, or 'bulletin', a monologue. - -
-
- -
-
- -**source:** `BodyCreatePodcastV1StudioPodcastsPostSource` — The source content for the Podcast. - -
-
- -
-
- -**quality_preset:** `typing.Optional[BodyCreatePodcastV1StudioPodcastsPostQualityPreset]` - -Output quality of the generated audio. Must be one of: -standard - standard output format, 128kbps with 44.1kHz sample rate. -high - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. Using this setting increases the credit cost by 20%. -ultra - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. Using this setting increases the credit cost by 50%. -ultra lossless - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. Using this setting increases the credit cost by 100%. - -
-
- -
-
- -**duration_scale:** `typing.Optional[BodyCreatePodcastV1StudioPodcastsPostDurationScale]` - -Duration of the generated podcast. Must be one of: -short - produces podcasts shorter than 3 minutes. -default - produces podcasts roughly between 3-7 minutes. -long - prodces podcasts longer than 7 minutes. - -
-
- -
-
- -**language:** `typing.Optional[str]` — An optional language of the Studio project. Two-letter language code (ISO 639-1). - -
-
- -
-
- -**highlights:** `typing.Optional[typing.Sequence[str]]` — A brief summary or highlights of the Studio project's content, providing key points or themes. This should be between 10 and 70 characters. - -
-
- -
-
- -**callback_url:** `typing.Optional[str]` — A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Dubbing -
client.dubbing.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Dubs a provided audio or video file into given language. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.create() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**file:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**csv_file:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**foreground_audio_file:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**background_audio_file:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**name:** `typing.Optional[str]` — Name of the dubbing project. - -
-
- -
-
- -**source_url:** `typing.Optional[str]` — URL of the source video/audio file. - -
-
- -
-
- -**source_lang:** `typing.Optional[str]` — Source language. - -
-
- -
-
- -**target_lang:** `typing.Optional[str]` — The Target language to dub the content into. - -
-
- -
-
- -**num_speakers:** `typing.Optional[int]` — Number of speakers to use for the dubbing. Set to 0 to automatically detect the number of speakers - -
-
- -
-
- -**watermark:** `typing.Optional[bool]` — Whether to apply watermark to the output video. - -
-
- -
-
- -**start_time:** `typing.Optional[int]` — Start time of the source video/audio file. - -
-
- -
-
- -**end_time:** `typing.Optional[int]` — End time of the source video/audio file. - -
-
- -
-
- -**highest_resolution:** `typing.Optional[bool]` — Whether to use the highest resolution available. - -
-
- -
-
- -**drop_background_audio:** `typing.Optional[bool]` — An advanced setting. Whether to drop background audio from the final dub. This can improve dub quality where it's known that audio shouldn't have a background track such as for speeches or monologues. - -
-
- -
-
- -**use_profanity_filter:** `typing.Optional[bool]` — [BETA] Whether transcripts should have profanities censored with the words '[censored]' - -
-
- -
-
- -**dubbing_studio:** `typing.Optional[bool]` — Whether to prepare dub for edits in dubbing studio or edits as a dubbing resource. - -
-
- -
-
- -**disable_voice_cloning:** `typing.Optional[bool]` — [BETA] Instead of using a voice clone in dubbing, use a similar voice from the ElevenLabs Voice Library. - -
-
- -
-
- -**mode:** `typing.Optional[str]` — automatic or manual. Manual mode is only supported when creating a dubbing studio project - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns metadata about a dubbing project, including whether it's still in progress or not -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.get( - dubbing_id="dubbing_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Deletes a dubbing project. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.delete( - dubbing_id="dubbing_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Models -
client.models.list() -
-
- -#### 📝 Description - -
-
- -
-
- -Gets a list of available models. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.models.list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## AudioNative -
client.audio_native.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.audio_native.create( - name="name", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `str` — Project name. - -
-
- -
-
- -**image:** `typing.Optional[str]` — (Deprecated) Image URL used in the player. If not provided, default image set in the Player settings is used. - -
-
- -
-
- -**author:** `typing.Optional[str]` — Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used. - -
-
- -
-
- -**title:** `typing.Optional[str]` — Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used. - -
-
- -
-
- -**small:** `typing.Optional[bool]` — (Deprecated) Whether to use small player or not. If not provided, default value set in the Player settings is used. - -
-
- -
-
- -**text_color:** `typing.Optional[str]` — Text color used in the player. If not provided, default text color set in the Player settings is used. - -
-
- -
-
- -**background_color:** `typing.Optional[str]` — Background color used in the player. If not provided, default background color set in the Player settings is used. - -
-
- -
-
- -**sessionization:** `typing.Optional[int]` — (Deprecated) Specifies for how many minutes to persist the session across page reloads. If not provided, default sessionization set in the Player settings is used. - -
-
- -
-
- -**voice_id:** `typing.Optional[str]` — Voice ID used to voice the content. If not provided, default voice ID set in the Player settings is used. - -
-
- -
-
- -**model_id:** `typing.Optional[str]` — TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used. - -
-
- -
-
- -**file:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**auto_convert:** `typing.Optional[bool]` — Whether to auto convert the project to audio or not. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.audio_native.get_settings(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get player settings for the specific project. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.audio_native.get_settings( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.audio_native.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Updates content for the specific AudioNative Project. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.audio_native.update( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. - -
-
- -
-
- -**file:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**auto_convert:** `typing.Optional[bool]` — Whether to auto convert the project to audio or not. - -
-
- -
-
- -**auto_publish:** `typing.Optional[bool]` — Whether to auto publish the new project snapshot after it's converted. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Usage -
client.usage.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns the usage metrics for the current user or the entire workspace they are part of. The response provides a time axis based on the specified aggregation interval (default: day), with usage values for each interval along that axis. Usage is broken down by the selected breakdown type. For example, breakdown type "voice" will return the usage of each voice for each interval along the time axis. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.usage.get( - start_unix=1, - end_unix=1, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**start_unix:** `int` — UTC Unix timestamp for the start of the usage window, in milliseconds. To include the first day of the window, the timestamp should be at 00:00:00 of that day. - -
-
- -
-
- -**end_unix:** `int` — UTC Unix timestamp for the end of the usage window, in milliseconds. To include the last day of the window, the timestamp should be at 23:59:59 of that day. - -
-
- -
-
- -**include_workspace_metrics:** `typing.Optional[bool]` — Whether or not to include the statistics of the entire workspace. - -
-
- -
-
- -**breakdown_type:** `typing.Optional[BreakdownTypes]` — How to break down the information. Cannot be "user" if include_workspace_metrics is False. - -
-
- -
-
- -**aggregation_interval:** `typing.Optional[UsageAggregationInterval]` — How to aggregate usage data over time. Can be "hour", "day", "week", "month", or "cumulative". - -
-
- -
-
- -**metric:** `typing.Optional[MetricType]` — Which metric to aggregate. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## PronunciationDictionaries -
client.pronunciation_dictionaries.create_from_file(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new pronunciation dictionary from a lexicon .PLS file -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.pronunciation_dictionaries.create_from_file( - name="name", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `str` — The name of the pronunciation dictionary, used for identification only. - -
-
- -
-
- -**file:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**description:** `typing.Optional[str]` — A description of the pronunciation dictionary, used for identification only. - -
-
- -
-
- -**workspace_access:** `typing.Optional[PronunciationDictionariesCreateFromFileRequestWorkspaceAccess]` — Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.pronunciation_dictionaries.create_from_rules(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new pronunciation dictionary from provided rules. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs -from elevenlabs.pronunciation_dictionaries import ( - BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias, -) - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.pronunciation_dictionaries.create_from_rules( - rules=[ - BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias( - string_to_replace="Thailand", - alias="tie-land", - ) - ], - name="My Dictionary", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**rules:** `typing.Sequence[ - BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem -]` - -List of pronunciation rules. Rule can be either: - an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } - or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } - -
-
- -
-
- -**name:** `str` — The name of the pronunciation dictionary, used for identification only. - -
-
- -
-
- -**description:** `typing.Optional[str]` — A description of the pronunciation dictionary, used for identification only. - -
-
- -
-
- -**workspace_access:** `typing.Optional[ - BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostWorkspaceAccess -]` — Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.pronunciation_dictionaries.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get metadata for a pronunciation dictionary -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.pronunciation_dictionaries.get( - pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**pronunciation_dictionary_id:** `str` — The id of the pronunciation dictionary - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.pronunciation_dictionaries.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get a list of the pronunciation dictionaries you have access to and their metadata -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.pronunciation_dictionaries.list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — How many pronunciation dictionaries to return at maximum. Can not exceed 100, defaults to 30. - -
-
- -
-
- -**sort:** `typing.Optional[PronunciationDictionariesListRequestSort]` — Which field to sort by, one of 'created_at_unix' or 'name'. - -
-
- -
-
- -**sort_direction:** `typing.Optional[str]` — Which direction to sort the voices in. 'ascending' or 'descending'. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## SpeechToText -
client.speech_to_text.convert(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Transcribe an audio or video file. If webhook is set to true, the request will be processed asynchronously and results sent to configured webhooks. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.speech_to_text.convert( - model_id="model_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**model_id:** `str` — The ID of the model to use for transcription, currently only 'scribe_v1' and 'scribe_v1_experimental' are available. - -
-
- -
-
- -**enable_logging:** `typing.Optional[bool]` — When enable_logging is set to false zero retention mode will be used for the request. This will mean history features are unavailable for this request, including request stitching. Zero retention mode may only be used by enterprise customers. - -
-
- -
-
- -**file:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**language_code:** `typing.Optional[str]` — An ISO-639-1 or ISO-639-3 language_code corresponding to the language of the audio file. Can sometimes improve transcription performance if known beforehand. Defaults to null, in this case the language is predicted automatically. - -
-
- -
-
- -**tag_audio_events:** `typing.Optional[bool]` — Whether to tag audio events like (laughter), (footsteps), etc. in the transcription. - -
-
- -
-
- -**num_speakers:** `typing.Optional[int]` — The maximum amount of speakers talking in the uploaded file. Can help with predicting who speaks when. The maximum amount of speakers that can be predicted is 32. Defaults to null, in this case the amount of speakers is set to the maximum value the model supports. - -
-
- -
-
- -**timestamps_granularity:** `typing.Optional[SpeechToTextConvertRequestTimestampsGranularity]` — The granularity of the timestamps in the transcription. 'word' provides word-level timestamps and 'character' provides character-level timestamps per word. - -
-
- -
-
- -**diarize:** `typing.Optional[bool]` — Whether to annotate which speaker is currently talking in the uploaded file. - -
-
- -
-
- -**additional_formats:** `typing.Optional[AdditionalFormats]` — A list of additional formats to export the transcript to. - -
-
- -
-
- -**file_format:** `typing.Optional[SpeechToTextConvertRequestFileFormat]` — The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. - -
-
- -
-
- -**cloud_storage_url:** `typing.Optional[str]` — The valid AWS S3, Cloudflare R2 or Google Cloud Storage URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be a valid publicly accessible cloud storage URL. The file size must be less than 2GB. URL can be pre-signed. - -
-
- -
-
- -**webhook:** `typing.Optional[bool]` — Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. Webhooks can be created and assigned to a transcription task in webhook settings page in the UI. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ForcedAlignment -
client.forced_alignment.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Force align an audio file to text. Use this endpoint to get the timing information for each character and word in an audio file based on a provided text transcript. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.forced_alignment.create( - text="text", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**file:** `from __future__ import annotations - -core.File` — See core.File for more documentation - -
-
- -
-
- -**text:** `str` — The text to align with the audio. The input text can be in any format, however diarization is not supported at this time. - -
-
- -
-
- -**enabled_spooled_file:** `typing.Optional[bool]` — If true, the file will be streamed to the server and processed in chunks. This is useful for large files that cannot be loaded into memory. The default is false. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi -
client.conversational_ai.add_to_knowledge_base(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Upload a file or webpage URL to create a knowledge base document.
After creating the document, update the agent's knowledge base by calling [Update agent](/docs/conversational-ai/api-reference/agents/update-agent). -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.add_to_knowledge_base() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `typing.Optional[str]` — A custom, human-readable name for the document. - -
-
- -
-
- -**url:** `typing.Optional[str]` — URL to a page of documentation that the agent will have access to in order to interact with users. - -
-
- -
-
- -**file:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.get_document_rag_indexes(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Provides information about all RAG indexes of the specified knowledgebase document. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.get_document_rag_indexes( - documentation_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.delete_document_rag_index(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete RAG index for the knowledgebase document. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.delete_document_rag_index( - documentation_id="21m00Tcm4TlvDq8ikWAM", - rag_index_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**rag_index_id:** `str` — The id of RAG index of document from the knowledge base. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.rag_index_overview() -
-
- -#### 📝 Description - -
-
- -
-
- -Provides total size and other information of RAG indexes used by knowledgebase documents -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.rag_index_overview() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.update_secret(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update an existing secret for the workspace -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.update_secret( - secret_id="secret_id", - name="name", - value="value", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**secret_id:** `str` - -
-
- -
-
- -**name:** `str` - -
-
- -
-
- -**value:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi Conversations -
client.conversational_ai.conversations.get_signed_url(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get a signed url to start a conversation with an agent with an agent that requires authorization -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.conversations.get_signed_url( - agent_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of the agent you're taking the action on. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.conversations.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get all conversations of agents that user owns. With option to restrict to a specific agent. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.conversations.list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response. - -
-
- -
-
- -**agent_id:** `typing.Optional[str]` — The id of the agent you're taking the action on. - -
-
- -
-
- -**call_successful:** `typing.Optional[EvaluationSuccessResult]` — The result of the success evaluation - -
-
- -
-
- -**call_start_before_unix:** `typing.Optional[int]` — Unix timestamp (in seconds) to filter conversations up to this start date. - -
-
- -
-
- -**call_start_after_unix:** `typing.Optional[int]` — Unix timestamp (in seconds) to filter conversations after to this start date. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — How many conversations to return at maximum. Can not exceed 100, defaults to 30. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.conversations.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get the details of a particular conversation -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.conversations.get( - conversation_id="123", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**conversation_id:** `str` — The id of the conversation you're taking the action on. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.conversations.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete a particular conversation -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.conversations.delete( - conversation_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**conversation_id:** `str` — The id of the conversation you're taking the action on. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi Twilio -
client.conversational_ai.twilio.outbound_call(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Handle an outbound call via Twilio -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.twilio.outbound_call( - agent_id="agent_id", - agent_phone_number_id="agent_phone_number_id", - to_number="to_number", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` - -
-
- -
-
- -**agent_phone_number_id:** `str` - -
-
- -
-
- -**to_number:** `str` - -
-
- -
-
- -**conversation_initiation_client_data:** `typing.Optional[ConversationInitiationClientDataRequestInput]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi Agents -
client.conversational_ai.agents.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create an agent from a config object -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ConversationalConfig, ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.agents.create( - conversation_config=ConversationalConfig(), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**conversation_config:** `ConversationalConfig` — Conversation configuration for an agent - -
-
- -
-
- -**platform_settings:** `typing.Optional[AgentPlatformSettingsRequestModel]` — Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. - -
-
- -
-
- -**name:** `typing.Optional[str]` — A name to make the agent easier to find - -
-
- -
-
- -**tags:** `typing.Optional[typing.Sequence[str]]` — Tags to help classify and filter the agent - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.agents.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve config for an agent -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.agents.get( - agent_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.agents.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete an agent -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.agents.delete( - agent_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.agents.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Patches an Agent settings -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.agents.update( - agent_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**conversation_config:** `typing.Optional[ConversationalConfig]` — Conversation configuration for an agent - -
-
- -
-
- -**platform_settings:** `typing.Optional[AgentPlatformSettingsRequestModel]` — Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. - -
-
- -
-
- -**name:** `typing.Optional[str]` — A name to make the agent easier to find - -
-
- -
-
- -**tags:** `typing.Optional[typing.Sequence[str]]` — Tags to help classify and filter the agent - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.agents.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of your agents and their metadata. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.agents.list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — How many Agents to return at maximum. Can not exceed 100, defaults to 30. - -
-
- -
-
- -**search:** `typing.Optional[str]` — Search by agents name. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.agents.simulate_conversation(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Run a conversation between the agent and a simulated user. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ( - AgentConfig, - ConversationSimulationSpecification, - ElevenLabs, -) - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.agents.simulate_conversation( - agent_id="21m00Tcm4TlvDq8ikWAM", - simulation_specification=ConversationSimulationSpecification( - simulated_user_config=AgentConfig( - first_message="Hello, how can I help you today?", - language="en", - ), - ), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**simulation_specification:** `ConversationSimulationSpecification` — A specification detailing how the conversation should be simulated - -
-
- -
-
- -**extra_evaluation_criteria:** `typing.Optional[typing.Sequence[PromptEvaluationCriteria]]` — A list of evaluation criteria to test - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.agents.simulate_conversation_stream(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ( - AgentConfig, - ConversationSimulationSpecification, - ElevenLabs, -) - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.agents.simulate_conversation_stream( - agent_id="21m00Tcm4TlvDq8ikWAM", - simulation_specification=ConversationSimulationSpecification( - simulated_user_config=AgentConfig( - first_message="Hello, how can I help you today?", - language="en", - ), - ), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**simulation_specification:** `ConversationSimulationSpecification` — A specification detailing how the conversation should be simulated - -
-
- -
-
- -**extra_evaluation_criteria:** `typing.Optional[typing.Sequence[PromptEvaluationCriteria]]` — A list of evaluation criteria to test - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi PhoneNumbers -
client.conversational_ai.phone_numbers.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Import Phone Number from provider configuration (Twilio or SIP trunk) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs -from elevenlabs.conversational_ai.phone_numbers import ( - PhoneNumbersCreateRequestBody_Twilio, -) - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.phone_numbers.create( - request=PhoneNumbersCreateRequestBody_Twilio( - phone_number="phone_number", - label="label", - sid="sid", - token="token", - ), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `PhoneNumbersCreateRequestBody` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.phone_numbers.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve Phone Number details by ID -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.phone_numbers.get( - phone_number_id="TeaqRRdTcIfIu2i7BYfT", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**phone_number_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.phone_numbers.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete Phone Number by ID -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.phone_numbers.delete( - phone_number_id="TeaqRRdTcIfIu2i7BYfT", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**phone_number_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.phone_numbers.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update Phone Number details by ID -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.phone_numbers.update( - phone_number_id="TeaqRRdTcIfIu2i7BYfT", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**phone_number_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**agent_id:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.phone_numbers.list() -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve all Phone Numbers -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.phone_numbers.list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi LlmUsage -
client.conversational_ai.llm_usage.calculate(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of LLM models and the expected cost for using them based on the provided values. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.llm_usage.calculate( - prompt_length=1, - number_of_pages=1, - rag_enabled=True, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**prompt_length:** `int` — Length of the prompt in characters. - -
-
- -
-
- -**number_of_pages:** `int` — Pages of content in PDF documents or URLs in the agent's knowledge base. - -
-
- -
-
- -**rag_enabled:** `bool` — Whether RAG is enabled. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi KnowledgeBase -
client.conversational_ai.knowledge_base.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get a list of available knowledge base documents -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.knowledge_base.list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100, defaults to 30. - -
-
- -
-
- -**search:** `typing.Optional[str]` — If specified, the endpoint returns only such knowledge base documents whose names start with this string. - -
-
- -
-
- -**show_only_owned_documents:** `typing.Optional[bool]` — If set to true, the endpoint will return only documents owned by you (and not shared from somebody else). - -
-
- -
-
- -**types:** `typing.Optional[ - typing.Union[ - KnowledgeBaseDocumentType, typing.Sequence[KnowledgeBaseDocumentType] - ] -]` — If present, the endpoint will return only documents of the given types. - -
-
- -
-
- -**use_typesense:** `typing.Optional[bool]` — If set to true, the endpoint will use typesense DB to search for the documents). - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi Settings -
client.conversational_ai.settings.get() -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve Convai settings for the workspace -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.settings.get() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.settings.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update Convai settings for the workspace -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.settings.update() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**conversation_initiation_client_data_webhook:** `typing.Optional[ConversationInitiationClientDataWebhook]` - -
-
- -
-
- -**webhooks:** `typing.Optional[ConvAiWebhooks]` - -
-
- -
-
- -**can_use_mcp_servers:** `typing.Optional[bool]` — Whether the workspace can use MCP servers - -
-
- -
-
- -**rag_retention_period_days:** `typing.Optional[int]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi Secrets -
client.conversational_ai.secrets.list() -
-
- -#### 📝 Description - -
-
- -
-
- -Get all workspace secrets for the user -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.secrets.list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.secrets.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a new secret for the workspace -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.secrets.create( - name="name", - value="value", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `str` - -
-
- -
-
- -**value:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.secrets.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete a workspace secret if it's not in use -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.secrets.delete( - secret_id="secret_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**secret_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi BatchCalls -
client.conversational_ai.batch_calls.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Submit a batch call request to schedule calls for multiple recipients. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs, OutboundCallRecipient - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.batch_calls.create( - call_name="call_name", - agent_id="agent_id", - agent_phone_number_id="agent_phone_number_id", - recipients=[ - OutboundCallRecipient( - phone_number="phone_number", - ) - ], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**call_name:** `str` - -
-
- -
-
- -**agent_id:** `str` - -
-
- -
-
- -**agent_phone_number_id:** `str` - -
-
- -
-
- -**recipients:** `typing.Sequence[OutboundCallRecipient]` - -
-
- -
-
- -**scheduled_time_unix:** `typing.Optional[int]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.batch_calls.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get all batch calls for the current workspace. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.batch_calls.list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**limit:** `typing.Optional[int]` - -
-
- -
-
- -**last_doc:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.batch_calls.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get detailed information about a batch call including all recipients. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.batch_calls.get( - batch_id="batch_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**batch_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.batch_calls.cancel(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Cancel a running batch call and set all recipients to cancelled status. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.batch_calls.cancel( - batch_id="batch_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**batch_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.batch_calls.retry(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retry a batch call by setting completed recipients back to pending status. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.batch_calls.retry( - batch_id="batch_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**batch_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi SipTrunk -
client.conversational_ai.sip_trunk.outbound_call(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Handle an outbound call via SIP trunk -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.sip_trunk.outbound_call( - agent_id="agent_id", - agent_phone_number_id="agent_phone_number_id", - to_number="to_number", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` - -
-
- -
-
- -**agent_phone_number_id:** `str` - -
-
- -
-
- -**to_number:** `str` - -
-
- -
-
- -**conversation_initiation_client_data:** `typing.Optional[ConversationInitiationClientDataRequestInput]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi Agents Widget -
client.conversational_ai.agents.widget.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve the widget configuration for an agent -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.agents.widget.get( - agent_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**conversation_signature:** `typing.Optional[str]` — An expiring token that enables a websocket conversation to start. These can be generated for an agent using the /v1/convai/conversation/get-signed-url endpoint - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi Agents Link -
client.conversational_ai.agents.link.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get the current link used to share the agent with others -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.agents.link.get( - agent_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi Agents KnowledgeBase -
client.conversational_ai.agents.knowledge_base.size(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns the number of pages in the agent's knowledge base. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.agents.knowledge_base.size( - agent_id="agent_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi Agents LlmUsage -
client.conversational_ai.agents.llm_usage.calculate(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Calculates expected number of LLM tokens needed for the specified agent. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.agents.llm_usage.calculate( - agent_id="agent_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` - -
-
- -
-
- -**prompt_length:** `typing.Optional[int]` — Length of the prompt in characters. - -
-
- -
-
- -**number_of_pages:** `typing.Optional[int]` — Pages of content in pdf documents OR urls in agent's Knowledge Base. - -
-
- -
-
- -**rag_enabled:** `typing.Optional[bool]` — Whether RAG is enabled. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi Agents Widget Avatar -
client.conversational_ai.agents.widget.avatar.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Sets the avatar for an agent displayed in the widget -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.agents.widget.avatar.create( - agent_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**agent_id:** `str` — The id of an agent. This is returned on agent creation. - -
-
- -
-
- -**avatar_file:** `from __future__ import annotations - -core.File` — See core.File for more documentation - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi Conversations Audio -## ConversationalAi Conversations Feedback -
client.conversational_ai.conversations.feedback.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Send the feedback for the given conversation -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.conversations.feedback.create( - conversation_id="21m00Tcm4TlvDq8ikWAM", - feedback="like", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**conversation_id:** `str` — The id of the conversation you're taking the action on. - -
-
- -
-
- -**feedback:** `UserFeedbackScore` — Either 'like' or 'dislike' to indicate the feedback for the conversation. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi Dashboard Settings -
client.conversational_ai.dashboard.settings.get() -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve Convai dashboard settings for the workspace -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.dashboard.settings.get() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.dashboard.settings.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update Convai dashboard settings for the workspace -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.dashboard.settings.update() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**charts:** `typing.Optional[typing.Sequence[PatchConvAiDashboardSettingsRequestChartsItem]]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi KnowledgeBase Documents -
client.conversational_ai.knowledge_base.documents.create_from_url(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a knowledge base document generated by scraping the given webpage. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.knowledge_base.documents.create_from_url( - url="url", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**url:** `str` — URL to a page of documentation that the agent will have access to in order to interact with users. - -
-
- -
-
- -**name:** `typing.Optional[str]` — A custom, human-readable name for the document. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.knowledge_base.documents.create_from_file(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a knowledge base document generated form the uploaded file. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.knowledge_base.documents.create_from_file() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**file:** `from __future__ import annotations - -core.File` — See core.File for more documentation - -
-
- -
-
- -**name:** `typing.Optional[str]` — A custom, human-readable name for the document. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.knowledge_base.documents.create_from_text(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a knowledge base document containing the provided text. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.knowledge_base.documents.create_from_text( - text="text", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**text:** `str` — Text content to be added to the knowledge base. - -
-
- -
-
- -**name:** `typing.Optional[str]` — A custom, human-readable name for the document. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.knowledge_base.documents.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get details about a specific documentation making up the agent's knowledge base -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.knowledge_base.documents.get( - documentation_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.knowledge_base.documents.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete a document from the knowledge base -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.knowledge_base.documents.delete( - documentation_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**force:** `typing.Optional[bool]` — If set to true, the document will be deleted regardless of whether it is used by any agents and it will be deleted from the dependent agents. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.knowledge_base.documents.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update the name of a document -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.knowledge_base.documents.update( - documentation_id="21m00Tcm4TlvDq8ikWAM", - name="name", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**name:** `str` — A custom, human-readable name for the document. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.knowledge_base.documents.get_agents(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get a list of agents depending on this knowledge base document -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.knowledge_base.documents.get_agents( - documentation_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100, defaults to 30. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.conversational_ai.knowledge_base.documents.get_content(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get the entire content of a document from the knowledge base -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.knowledge_base.documents.get_content( - documentation_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi KnowledgeBase Document -
client.conversational_ai.knowledge_base.document.compute_rag_index(...) -
-
- -#### 📝 Description - -
-
- -
-
- -In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.knowledge_base.document.compute_rag_index( - documentation_id="21m00Tcm4TlvDq8ikWAM", - model="e5_mistral_7b_instruct", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**model:** `EmbeddingModelEnum` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## ConversationalAi KnowledgeBase Documents Chunk -
client.conversational_ai.knowledge_base.documents.chunk.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get details about a specific documentation part used by RAG. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.conversational_ai.knowledge_base.documents.chunk.get( - documentation_id="21m00Tcm4TlvDq8ikWAM", - chunk_id="chunk_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. - -
-
- -
-
- -**chunk_id:** `str` — The id of a document RAG chunk from the knowledge base. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Dubbing Resource -
client.dubbing.resource.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Given a dubbing ID generated from the '/v1/dubbing' endpoint with studio enabled, returns the dubbing resource. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.resource.get( - dubbing_id="dubbing_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.resource.transcribe(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Regenerate the transcriptions for the specified segments. Does not automatically regenerate translations or dubs. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.resource.transcribe( - dubbing_id="dubbing_id", - segments=["segments"], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**segments:** `typing.Sequence[str]` — Transcribe this specific list of segments. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.resource.translate(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Regenerate the translations for either the entire resource or the specified segments/languages. Will automatically transcribe missing transcriptions. Will not automatically regenerate the dubs. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.resource.translate( - dubbing_id="dubbing_id", - segments=["segments"], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**segments:** `typing.Sequence[str]` — Translate only this list of segments. - -
-
- -
-
- -**languages:** `typing.Optional[typing.Sequence[str]]` — Translate only these languages for each segment. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.resource.dub(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Regenerate the dubs for either the entire resource or the specified segments/languages. Will automatically transcribe and translate any missing transcriptions and translations. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.resource.dub( - dubbing_id="dubbing_id", - segments=["segments"], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**segments:** `typing.Sequence[str]` — Dub only this list of segments. - -
-
- -
-
- -**languages:** `typing.Optional[typing.Sequence[str]]` — Dub only these languages for each segment. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.resource.render(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Regenerate the output media for a language using the latest Studio state. Please ensure all segments have been dubbed before rendering, otherwise they will be omitted. Renders are generated asynchronously, and to check the status of all renders please use the 'Get Dubbing Resource' endpoint. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.resource.render( - dubbing_id="dubbing_id", - language="language", - render_type="mp4", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**language:** `str` — Render this language - -
-
- -
-
- -**render_type:** `RenderType` — The type of the render. One of ['mp4', 'aac', 'mp3', 'wav', 'aaf', 'tracks_zip', 'clips_zip'] - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Dubbing Audio -## Dubbing Transcript -
client.dubbing.transcript.get_transcript_for_dub(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns transcript for the dub as an SRT or WEBVTT file. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.transcript.get_transcript_for_dub( - dubbing_id="dubbing_id", - language_code="language_code", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**language_code:** `str` — ID of the language. - -
-
- -
-
- -**format_type:** `typing.Optional[TranscriptGetTranscriptForDubRequestFormatType]` — Format to use for the subtitle file, either 'srt' or 'webvtt' - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Dubbing Resource Language -
client.dubbing.resource.language.add(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Adds the given ElevenLab Turbo V2/V2.5 language code to the resource. Does not automatically generate transcripts/translations/audio. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.resource.language.add( - dubbing_id="dubbing_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**language:** `typing.Optional[str]` — The Target language. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Dubbing Resource Segment -
client.dubbing.resource.segment.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Modifies a single segment with new text and/or start/end times. Will update the values for only a specific language of a segment. Does not automatically regenerate the dub. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.resource.segment.update( - dubbing_id="dubbing_id", - segment_id="segment_id", - language="language", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**segment_id:** `str` — ID of the segment - -
-
- -
-
- -**language:** `str` — ID of the language. - -
-
- -
-
- -**start_time:** `typing.Optional[float]` - -
-
- -
-
- -**end_time:** `typing.Optional[float]` - -
-
- -
-
- -**text:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.resource.segment.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Deletes a single segment from the dubbing. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.resource.segment.delete( - dubbing_id="dubbing_id", - segment_id="segment_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**segment_id:** `str` — ID of the segment - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Dubbing Resource Speaker -
client.dubbing.resource.speaker.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Amend the metadata associated with a speaker, such as their voice. Both voice cloning and using voices from the ElevenLabs library are supported. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.resource.speaker.update( - dubbing_id="dubbing_id", - speaker_id="speaker_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**speaker_id:** `str` — ID of the speaker. - -
-
- -
-
- -**voice_id:** `typing.Optional[str]` — Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone']. - -
-
- -
-
- -**languages:** `typing.Optional[typing.Sequence[str]]` — Languages to apply these changes to. If empty, will apply to all languages. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.dubbing.resource.speaker.find_similar_voices(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Fetch the top 10 similar voices to a speaker, including the voice IDs, names, descriptions, and, where possible, a sample audio recording. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.resource.speaker.find_similar_voices( - dubbing_id="dubbing_id", - speaker_id="speaker_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**speaker_id:** `str` — ID of the speaker. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Dubbing Resource Speaker Segment -
client.dubbing.resource.speaker.segment.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new segment in dubbing resource with a start and end time for the speaker in every available language. Does not automatically generate transcripts/translations/audio. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.resource.speaker.segment.create( - dubbing_id="dubbing_id", - speaker_id="speaker_id", - start_time=1.1, - end_time=1.1, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**speaker_id:** `str` — ID of the speaker. - -
-
- -
-
- -**start_time:** `float` - -
-
- -
-
- -**end_time:** `float` - -
-
- -
-
- -**text:** `typing.Optional[str]` - -
-
- -
-
- -**translations:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## PronunciationDictionaries Rules -
client.pronunciation_dictionaries.rules.add(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Add rules to the pronunciation dictionary -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs -from elevenlabs.pronunciation_dictionaries.rules import ( - PronunciationDictionaryRule_Alias, -) - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.pronunciation_dictionaries.rules.add( - pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", - rules=[ - PronunciationDictionaryRule_Alias( - string_to_replace="Thailand", - alias="tie-land", - ) - ], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**pronunciation_dictionary_id:** `str` — The id of the pronunciation dictionary - -
-
- -
-
- -**rules:** `typing.Sequence[PronunciationDictionaryRule]` - -List of pronunciation rules. Rule can be either: - an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } - or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' } - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.pronunciation_dictionaries.rules.remove(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Remove rules from the pronunciation dictionary -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.pronunciation_dictionaries.rules.remove( - pronunciation_dictionary_id="21m00Tcm4TlvDq8ikWAM", - rule_strings=["rule_strings"], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**pronunciation_dictionary_id:** `str` — The id of the pronunciation dictionary - -
-
- -
-
- -**rule_strings:** `typing.Sequence[str]` — List of strings to remove from the pronunciation dictionary. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Studio Projects -
client.studio.projects.list() -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of your Studio projects with metadata. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new Studio project, it can be either initialized as blank, from a document or from a URL. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.create( - name="name", - default_title_voice_id="default_title_voice_id", - default_paragraph_voice_id="default_paragraph_voice_id", - default_model_id="default_model_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `str` — The name of the Studio project, used for identification only. - -
-
- -
-
- -**default_title_voice_id:** `str` — The voice_id that corresponds to the default voice used for new titles. - -
-
- -
-
- -**default_paragraph_voice_id:** `str` — The voice_id that corresponds to the default voice used for new paragraphs. - -
-
- -
-
- -**default_model_id:** `str` — The ID of the model to be used for this Studio project, you can query GET /v1/models to list all available models. - -
-
- -
-
- -**from_url:** `typing.Optional[str]` — An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' must be null. If neither 'from_url' or 'from_document' are provided we will initialize the Studio project as blank. - -
-
- -
-
- -**from_document:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**quality_preset:** `typing.Optional[str]` - -Output quality of the generated audio. Must be one of: -standard - standard output format, 128kbps with 44.1kHz sample rate. -high - high quality output format, 192kbps with 44.1kHz sample rate and major improvements on our side. Using this setting increases the credit cost by 20%. -ultra - ultra quality output format, 192kbps with 44.1kHz sample rate and highest improvements on our side. Using this setting increases the credit cost by 50%. -ultra lossless - ultra quality output format, 705.6kbps with 44.1kHz sample rate and highest improvements on our side in a fully lossless format. Using this setting increases the credit cost by 100%. - -
-
- -
-
- -**title:** `typing.Optional[str]` — An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. - -
-
- -
-
- -**author:** `typing.Optional[str]` — An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. - -
-
- -
-
- -**description:** `typing.Optional[str]` — An optional description of the Studio project. - -
-
- -
-
- -**genres:** `typing.Optional[typing.List[str]]` — An optional list of genres associated with the Studio project. - -
-
- -
-
- -**target_audience:** `typing.Optional[ProjectsCreateRequestTargetAudience]` — An optional target audience of the Studio project. - -
-
- -
-
- -**language:** `typing.Optional[str]` — An optional language of the Studio project. Two-letter language code (ISO 639-1). - -
-
- -
-
- -**content_type:** `typing.Optional[str]` — An optional content type of the Studio project. - -
-
- -
-
- -**original_publication_date:** `typing.Optional[str]` — An optional original publication date of the Studio project, in the format YYYY-MM-DD or YYYY. - -
-
- -
-
- -**mature_content:** `typing.Optional[bool]` — An optional specification of whether this Studio project contains mature content. - -
-
- -
-
- -**isbn_number:** `typing.Optional[str]` — An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. - -
-
- -
-
- -**acx_volume_normalization:** `typing.Optional[bool]` — [Deprecated] When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements - -
-
- -
-
- -**volume_normalization:** `typing.Optional[bool]` — When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements - -
-
- -
-
- -**pronunciation_dictionary_locators:** `typing.Optional[typing.List[str]]` — A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\"pronunciation_dictionary_id\":\"Vmd4Zor6fplcA7WrINey\",\"version_id\":\"hRPaxjlTdR7wFMhV4w0b\"}"' --form 'pronunciation_dictionary_locators="{\"pronunciation_dictionary_id\":\"JzWtcGQMJ6bnlWwyMo7e\",\"version_id\":\"lbmwxiLu4q6txYxgdZqn\"}"'. Note that multiple dictionaries are not currently supported by our UI which will only show the first. - -
-
- -
-
- -**callback_url:** `typing.Optional[str]` — A url that will be called by our service when the Studio project is converted. Request will contain a json blob containing the status of the conversion - -
-
- -
-
- -**fiction:** `typing.Optional[ProjectsCreateRequestFiction]` — An optional specification of whether the content of this Studio project is fiction. - -
-
- -
-
- -**apply_text_normalization:** `typing.Optional[ProjectsCreateRequestApplyTextNormalization]` - - - This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'. - When set to 'auto', the system will automatically decide whether to apply text normalization - (e.g., spelling out numbers). With 'on', text normalization will always be applied, while - with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English. - - -
-
- -
-
- -**auto_convert:** `typing.Optional[bool]` — Whether to auto convert the Studio project to audio or not. - -
-
- -
-
- -**auto_assign_voices:** `typing.Optional[bool]` — [Alpha Feature] Whether automatically assign voices to phrases in the create Project. - -
-
- -
-
- -**source_type:** `typing.Optional[ProjectsCreateRequestSourceType]` — The type of Studio project to create. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns information about a specific Studio project. This endpoint returns more detailed information about a project than `GET /v1/studio`. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.get( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Updates the specified Studio project by setting the values of the parameters passed. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.update( - project_id="21m00Tcm4TlvDq8ikWAM", - name="Project 1", - default_title_voice_id="21m00Tcm4TlvDq8ikWAM", - default_paragraph_voice_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. - -
-
- -
-
- -**name:** `str` — The name of the Studio project, used for identification only. - -
-
- -
-
- -**default_title_voice_id:** `str` — The voice_id that corresponds to the default voice used for new titles. - -
-
- -
-
- -**default_paragraph_voice_id:** `str` — The voice_id that corresponds to the default voice used for new paragraphs. - -
-
- -
-
- -**title:** `typing.Optional[str]` — An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. - -
-
- -
-
- -**author:** `typing.Optional[str]` — An optional name of the author of the Studio project, this will be added as metadata to the mp3 file on Studio project or chapter download. - -
-
- -
-
- -**isbn_number:** `typing.Optional[str]` — An optional ISBN number of the Studio project you want to create, this will be added as metadata to the mp3 file on Studio project or chapter download. - -
-
- -
-
- -**volume_normalization:** `typing.Optional[bool]` — When the Studio project is downloaded, should the returned audio have postprocessing in order to make it compliant with audiobook normalized volume requirements - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Deletes a Studio project. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.delete( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.convert(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Starts conversion of a Studio project and all of its chapters. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.convert( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Studio Projects Content -
client.studio.projects.content.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Updates Studio project content. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.content.update( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. - -
-
- -
-
- -**from_url:** `typing.Optional[str]` — An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' must be null. If neither 'from_url' or 'from_document' are provided we will initialize the Studio project as blank. - -
-
- -
-
- -**from_document:** `from __future__ import annotations - -typing.Optional[core.File]` — See core.File for more documentation - -
-
- -
-
- -**auto_convert:** `typing.Optional[bool]` — Whether to auto convert the Studio project to audio or not. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Studio Projects Snapshots -
client.studio.projects.snapshots.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves a list of snapshots for a Studio project. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.snapshots.list( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.snapshots.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns the project snapshot. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.snapshots.get( - project_id="21m00Tcm4TlvDq8ikWAM", - project_snapshot_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**project_snapshot_id:** `str` — The ID of the Studio project snapshot. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Studio Projects Chapters -
client.studio.projects.chapters.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of a Studio project's chapters. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.chapters.list( - project_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.chapters.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new chapter either as blank or from a URL. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.chapters.create( - project_id="21m00Tcm4TlvDq8ikWAM", - name="Chapter 1", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**name:** `str` — The name of the chapter, used for identification only. - -
-
- -
-
- -**from_url:** `typing.Optional[str]` — An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' must be null. If neither 'from_url' or 'from_document' are provided we will initialize the Studio project as blank. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.chapters.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns information about a specific chapter. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.chapters.get( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. - -
-
- -
-
- -**chapter_id:** `str` — The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.chapters.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Updates a chapter. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.chapters.update( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. - -
-
- -
-
- -**chapter_id:** `str` — The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. - -
-
- -
-
- -**name:** `typing.Optional[str]` — The name of the chapter, used for identification only. - -
-
- -
-
- -**content:** `typing.Optional[ChapterContentInputModel]` — The chapter content to use. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.chapters.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Deletes a chapter. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.chapters.delete( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. - -
-
- -
-
- -**chapter_id:** `str` — The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.chapters.convert(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Starts conversion of a specific chapter. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.chapters.convert( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. - -
-
- -
-
- -**chapter_id:** `str` — The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Studio Projects PronunciationDictionaries -
client.studio.projects.pronunciation_dictionaries.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a set of pronunciation dictionaries acting on a project. This will automatically mark text within this project as requiring reconverting where the new dictionary would apply or the old one no longer does. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs, PronunciationDictionaryVersionLocator - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.pronunciation_dictionaries.create( - project_id="21m00Tcm4TlvDq8ikWAM", - pronunciation_dictionary_locators=[ - PronunciationDictionaryVersionLocator( - pronunciation_dictionary_id="pronunciation_dictionary_id", - ) - ], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. - -
-
- -
-
- -**pronunciation_dictionary_locators:** `typing.Sequence[PronunciationDictionaryVersionLocator]` — A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\"pronunciation_dictionary_id\":\"Vmd4Zor6fplcA7WrINey\",\"version_id\":\"hRPaxjlTdR7wFMhV4w0b\"}"' --form 'pronunciation_dictionary_locators="{\"pronunciation_dictionary_id\":\"JzWtcGQMJ6bnlWwyMo7e\",\"version_id\":\"lbmwxiLu4q6txYxgdZqn\"}"'. Note that multiple dictionaries are not currently supported by our UI which will only show the first. - -
-
- -
-
- -**invalidate_affected_text:** `typing.Optional[bool]` — This will automatically mark text in this project for reconversion when the new dictionary applies or the old one no longer does. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Studio Projects Chapters Snapshots -
client.studio.projects.chapters.snapshots.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Gets information about all the snapshots of a chapter. Each snapshot can be downloaded as audio. Whenever a chapter is converted a snapshot will automatically be created. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.chapters.snapshots.list( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects. - -
-
- -
-
- -**chapter_id:** `str` — The ID of the chapter to be used. You can use the [List project chapters](/docs/api-reference/studio/get-chapters) endpoint to list all the available chapters. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.studio.projects.chapters.snapshots.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns the chapter snapshot. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.studio.projects.chapters.snapshots.get( - project_id="21m00Tcm4TlvDq8ikWAM", - chapter_id="21m00Tcm4TlvDq8ikWAM", - chapter_snapshot_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**project_id:** `str` — The ID of the Studio project. - -
-
- -
-
- -**chapter_id:** `str` — The ID of the chapter. - -
-
- -
-
- -**chapter_snapshot_id:** `str` — The ID of the chapter snapshot. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## User Subscription -
client.user.subscription.get() -
-
- -#### 📝 Description - -
-
- -
-
- -Gets extended information about the users subscription -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.user.subscription.get() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Voices Settings -
client.voices.settings.get_default() -
-
- -#### 📝 Description - -
-
- -
-
- -Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.settings.get_default() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.settings.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.settings.get( - voice_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.settings.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs, VoiceSettings - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.settings.update( - voice_id="21m00Tcm4TlvDq8ikWAM", - request=VoiceSettings( - stability=1.0, - use_speaker_boost=True, - similarity_boost=1.0, - style=0.0, - speed=1.0, - ), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices. - -
-
- -
-
- -**request:** `VoiceSettings` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Voices Ivc -
client.voices.ivc.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a voice clone and add it to your Voices -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.ivc.create( - name="name", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `str` — The name that identifies this voice. This will be displayed in the dropdown of the website. - -
-
- -
-
- -**files:** `from __future__ import annotations - -typing.List[core.File]` — See core.File for more documentation - -
-
- -
-
- -**remove_background_noise:** `typing.Optional[bool]` — If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. - -
-
- -
-
- -**description:** `typing.Optional[str]` — A description of the voice. - -
-
- -
-
- -**labels:** `typing.Optional[str]` — Serialized labels dictionary for the voice. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Voices Pvc -
client.voices.pvc.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new PVC voice with metadata but no samples -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.pvc.create( - name="John Smith", - language="en", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `str` — The name that identifies this voice. This will be displayed in the dropdown of the website. - -
-
- -
-
- -**language:** `str` — Language used in the samples. - -
-
- -
-
- -**description:** `typing.Optional[str]` — Description to use for the created voice. - -
-
- -
-
- -**labels:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]` — Serialized labels dictionary for the voice. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.pvc.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Edit PVC voice metadata -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.pvc.update( - voice_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**name:** `typing.Optional[str]` — The name that identifies this voice. This will be displayed in the dropdown of the website. - -
-
- -
-
- -**language:** `typing.Optional[str]` — Language used in the samples. - -
-
- -
-
- -**description:** `typing.Optional[str]` — Description to use for the created voice. - -
-
- -
-
- -**labels:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]` — Serialized labels dictionary for the voice. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.pvc.train(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Start PVC training process for a voice. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.pvc.train( - voice_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**model_id:** `typing.Optional[str]` — The model ID to use for the conversion. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Voices Pvc Samples -
client.voices.pvc.samples.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Add audio samples to a PVC voice -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.pvc.samples.create( - voice_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**files:** `from __future__ import annotations - -typing.List[core.File]` — See core.File for more documentation - -
-
- -
-
- -**remove_background_noise:** `typing.Optional[bool]` — If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.pvc.samples.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update a PVC voice sample - apply noise removal, or select speaker. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.pvc.samples.update( - voice_id="21m00Tcm4TlvDq8ikWAM", - sample_id="VW7YKqPnjY4h39yTbx2L", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**sample_id:** `str` — Sample ID to be used - -
-
- -
-
- -**remove_background_noise:** `typing.Optional[bool]` — If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. - -
-
- -
-
- -**selected_speaker_ids:** `typing.Optional[typing.Sequence[str]]` — Speaker IDs to be used for PVC training. Make sure you send all the speaker IDs you want to use for PVC training in one request because the last request will override the previous ones. - -
-
- -
-
- -**trim_start_time:** `typing.Optional[int]` — The start time of the audio to be used for PVC training. Time should be in milliseconds - -
-
- -
-
- -**trim_end_time:** `typing.Optional[int]` — The end time of the audio to be used for PVC training. Time should be in milliseconds - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.pvc.samples.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete a sample from a PVC voice. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.pvc.samples.delete( - voice_id="21m00Tcm4TlvDq8ikWAM", - sample_id="VW7YKqPnjY4h39yTbx2L", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**sample_id:** `str` — Sample ID to be used - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Voices Pvc Verification -
client.voices.pvc.verification.request(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Request manual verification for a PVC voice. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.pvc.verification.request( - voice_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**files:** `from __future__ import annotations - -typing.List[core.File]` — See core.File for more documentation - -
-
- -
-
- -**extra_text:** `typing.Optional[str]` — Extra text to be used in the manual verification process. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Voices Pvc Samples Audio -
client.voices.pvc.samples.audio.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve the first 30 seconds of voice sample audio with or without noise removal. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.pvc.samples.audio.get( - voice_id="21m00Tcm4TlvDq8ikWAM", - sample_id="VW7YKqPnjY4h39yTbx2L", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**sample_id:** `str` — Sample ID to be used - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Voices Pvc Samples Waveform -
client.voices.pvc.samples.waveform.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve the visual waveform of a voice sample. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.pvc.samples.waveform.get( - voice_id="21m00Tcm4TlvDq8ikWAM", - sample_id="VW7YKqPnjY4h39yTbx2L", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**sample_id:** `str` — Sample ID to be used - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Voices Pvc Samples Speakers -
client.voices.pvc.samples.speakers.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve the status of the speaker separation process and the list of detected speakers if complete. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.pvc.samples.speakers.get( - voice_id="21m00Tcm4TlvDq8ikWAM", - sample_id="VW7YKqPnjY4h39yTbx2L", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**sample_id:** `str` — Sample ID to be used - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.pvc.samples.speakers.separate(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Start speaker separation process for a sample -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.pvc.samples.speakers.separate( - voice_id="21m00Tcm4TlvDq8ikWAM", - sample_id="VW7YKqPnjY4h39yTbx2L", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**sample_id:** `str` — Sample ID to be used - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Voices Pvc Samples Speakers Audio -
client.voices.pvc.samples.speakers.audio.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieve the separated audio for a specific speaker. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.pvc.samples.speakers.audio.get( - voice_id="21m00Tcm4TlvDq8ikWAM", - sample_id="VW7YKqPnjY4h39yTbx2L", - speaker_id="VW7YKqPnjY4h39yTbx2L", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**sample_id:** `str` — Sample ID to be used - -
-
- -
-
- -**speaker_id:** `str` — Speaker ID to be used, you can use GET https://api.elevenlabs.io/v1/voices/{voice_id}/samples/{sample_id}/speakers to list all the available speakers for a sample. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Voices Pvc Verification Captcha -
client.voices.pvc.verification.captcha.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get captcha for PVC voice verification. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.pvc.verification.captcha.get( - voice_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.voices.pvc.verification.captcha.verify(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Submit captcha verification for PVC voice. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.pvc.verification.captcha.verify( - voice_id="21m00Tcm4TlvDq8ikWAM", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**voice_id:** `str` — Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. - -
-
- -
-
- -**recording:** `from __future__ import annotations - -core.File` — See core.File for more documentation - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Voices Samples Audio -## Workspace Groups -
client.workspace.groups.search(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Searches for user groups in the workspace. Multiple or no groups may be returned. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.groups.search( - name="name", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `str` — Name of the target group. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Workspace Invites -
client.workspace.invites.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. If the user is already in the workspace a 400 error will be returned. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.invites.create( - email="john.doe@testmail.com", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**email:** `str` — The email of the customer - -
-
- -
-
- -**group_ids:** `typing.Optional[typing.Sequence[str]]` — The group ids of the user - -
-
- -
-
- -**workspace_permission:** `typing.Optional[BodyInviteUserV1WorkspaceInvitesAddPostWorkspacePermission]` — The workspace permission of the user - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.invites.create_batch(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.invites.create_batch( - emails=["emails"], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**emails:** `typing.Sequence[str]` — The email of the customer - -
-
- -
-
- -**group_ids:** `typing.Optional[typing.Sequence[str]]` — The group ids of the user - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.invites.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace administrators. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.invites.delete( - email="john.doe@testmail.com", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**email:** `str` — The email of the customer - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Workspace Members -
client.workspace.members.update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.members.update( - email="email", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**email:** `str` — Email of the target user. - -
-
- -
-
- -**is_locked:** `typing.Optional[bool]` — Whether to lock or unlock the user account. - -
-
- -
-
- -**workspace_role:** `typing.Optional[BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole]` — Role dictating permissions in the workspace. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.members.delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Deletes a workspace member. This endpoint may only be called by workspace administrators. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.members.delete( - email="email", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**email:** `str` — Email of the target user. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Workspace Resources -
client.workspace.resources.get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Gets the metadata of a resource by ID. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.resources.get( - resource_id="resource_id", - resource_type="voice", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**resource_id:** `str` — The ID of the target resource. - -
-
- -
-
- -**resource_type:** `WorkspaceResourceType` — Resource type of the target resource. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.resources.share(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Grants a role on a workspace resource to a user or a group. It overrides any existing role this user/service account/group/workspace api key has on the resource. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be shared with the service account associated with the api key. You must have admin access to the resource to share it. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.resources.share( - resource_id="resource_id", - role="admin", - resource_type="voice", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**resource_id:** `str` — The ID of the target resource. - -
-
- -
-
- -**role:** `BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole` — Role to update the target principal with. - -
-
- -
-
- -**resource_type:** `WorkspaceResourceType` — Resource type of the target resource. - -
-
- -
-
- -**user_email:** `typing.Optional[str]` — The email of the user or service account. - -
-
- -
-
- -**group_id:** `typing.Optional[str]` — The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'. - -
-
- -
-
- -**workspace_api_key_id:** `typing.Optional[str]` — The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.resources.unshare(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Removes any existing role on a workspace resource from a user, service account, group or workspace api key. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be unshared from the service account associated with the api key. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.resources.unshare( - resource_id="resource_id", - resource_type="voice", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**resource_id:** `str` — The ID of the target resource. - -
-
- -
-
- -**resource_type:** `WorkspaceResourceType` — Resource type of the target resource. - -
-
- -
-
- -**user_email:** `typing.Optional[str]` — The email of the user or service account. - -
-
- -
-
- -**group_id:** `typing.Optional[str]` — The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'. - -
-
- -
-
- -**workspace_api_key_id:** `typing.Optional[str]` — The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Workspace Groups Members -
client.workspace.groups.members.remove(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Removes a member from the specified group. This endpoint may only be called by workspace administrators. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.groups.members.remove( - group_id="group_id", - email="email", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**group_id:** `str` — The ID of the target group. - -
-
- -
-
- -**email:** `str` — The email of the target workspace member. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workspace.groups.members.add(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Adds a member of your workspace to the specified group. This endpoint may only be called by workspace administrators. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.workspace.groups.members.add( - group_id="group_id", - email="email", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**group_id:** `str` — The ID of the target group. - -
-
- -
-
- -**email:** `str` — The email of the target workspace member. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- diff --git a/src/elevenlabs/__init__.py b/src/elevenlabs/__init__.py index d511cd1c..35863e29 100644 --- a/src/elevenlabs/__init__.py +++ b/src/elevenlabs/__init__.py @@ -80,6 +80,7 @@ BodyStreamChapterAudioV1ProjectsProjectIdChaptersChapterIdSnapshotsChapterSnapshotIdStreamPost, BodyStreamProjectAudioV1ProjectsProjectIdSnapshotsProjectSnapshotIdStreamPost, BreakdownTypes, + BuiltInTools, ChapterContentBlockExtendableNodeResponseModel, ChapterContentBlockInputModel, ChapterContentBlockInputModelSubType, @@ -316,7 +317,6 @@ GetPronunciationDictionaryMetadataResponse, GetPronunciationDictionaryMetadataResponseModelPermissionOnResource, GetPronunciationDictionaryResponse, - GetSharedSoundGenerationsResponseModel, GetSpeechHistoryResponse, GetVoicesResponse, GetVoicesV2Response, @@ -330,6 +330,7 @@ InitialiseContext, InitializeConnection, InitializeConnectionMulti, + IntegrationType, InvoiceResponse, KeepContextAlive, KnowledgeBaseDocumentChunkResponseModel, @@ -357,7 +358,7 @@ LlmUsageOutput, ManualVerificationFileResponse, ManualVerificationResponse, - McpApprovalRequiredModel, + McpApprovalPolicy, McpToolConfigInput, McpToolConfigOutput, MetricRecord, @@ -369,8 +370,6 @@ ModerationStatusResponseModel, ModerationStatusResponseModelSafetyStatus, ModerationStatusResponseModelWarningStatus, - NativeMcpToolConfigInput, - NativeMcpToolConfigOutput, NormalizedAlignment, ObjectJsonSchemaPropertyInput, ObjectJsonSchemaPropertyInputPropertiesValue, @@ -417,19 +416,16 @@ PromptAgentDbModelToolsItem, PromptAgentDbModelToolsItem_Client, PromptAgentDbModelToolsItem_Mcp, - PromptAgentDbModelToolsItem_NativeMcp, PromptAgentDbModelToolsItem_System, PromptAgentDbModelToolsItem_Webhook, PromptAgentInputToolsItem, PromptAgentInputToolsItem_Client, PromptAgentInputToolsItem_Mcp, - PromptAgentInputToolsItem_NativeMcp, PromptAgentInputToolsItem_System, PromptAgentInputToolsItem_Webhook, PromptAgentOutputToolsItem, PromptAgentOutputToolsItem_Client, PromptAgentOutputToolsItem_Mcp, - PromptAgentOutputToolsItem_NativeMcp, PromptAgentOutputToolsItem_System, PromptAgentOutputToolsItem_Webhook, PromptAgentOverride, @@ -483,7 +479,6 @@ SendTextMulti, ShareOptionResponseModel, ShareOptionResponseModelType, - SharedSoundGenerationResponseModel, SimilarVoice, SimilarVoiceCategory, SimilarVoicesForSpeakerResponse, @@ -615,6 +610,7 @@ WidgetLanguagePreset, WidgetLanguagePresetResponse, WidgetPlacement, + WidgetStyles, WidgetTextContents, WorkspaceBatchCallsResponse, WorkspaceGroupByNameResponseModel, @@ -793,6 +789,7 @@ "BodyTextToSpeechV1TextToSpeechVoiceIdPostApplyTextNormalization", "BodyTextToSpeechWithTimestampsV1TextToSpeechVoiceIdWithTimestampsPostApplyTextNormalization", "BreakdownTypes", + "BuiltInTools", "ChapterContentBlockExtendableNodeResponseModel", "ChapterContentBlockInputModel", "ChapterContentBlockInputModelSubType", @@ -1032,7 +1029,6 @@ "GetPronunciationDictionaryMetadataResponse", "GetPronunciationDictionaryMetadataResponseModelPermissionOnResource", "GetPronunciationDictionaryResponse", - "GetSharedSoundGenerationsResponseModel", "GetSpeechHistoryResponse", "GetVoicesResponse", "GetVoicesV2Response", @@ -1047,6 +1043,7 @@ "InitialiseContext", "InitializeConnection", "InitializeConnectionMulti", + "IntegrationType", "InvoiceResponse", "KeepContextAlive", "KnowledgeBaseDocumentChunkResponseModel", @@ -1074,7 +1071,7 @@ "LlmUsageOutput", "ManualVerificationFileResponse", "ManualVerificationResponse", - "McpApprovalRequiredModel", + "McpApprovalPolicy", "McpToolConfigInput", "McpToolConfigOutput", "MetricRecord", @@ -1086,8 +1083,6 @@ "ModerationStatusResponseModel", "ModerationStatusResponseModelSafetyStatus", "ModerationStatusResponseModelWarningStatus", - "NativeMcpToolConfigInput", - "NativeMcpToolConfigOutput", "NormalizedAlignment", "NotFoundError", "ObjectJsonSchemaPropertyInput", @@ -1135,19 +1130,16 @@ "PromptAgentDbModelToolsItem", "PromptAgentDbModelToolsItem_Client", "PromptAgentDbModelToolsItem_Mcp", - "PromptAgentDbModelToolsItem_NativeMcp", "PromptAgentDbModelToolsItem_System", "PromptAgentDbModelToolsItem_Webhook", "PromptAgentInputToolsItem", "PromptAgentInputToolsItem_Client", "PromptAgentInputToolsItem_Mcp", - "PromptAgentInputToolsItem_NativeMcp", "PromptAgentInputToolsItem_System", "PromptAgentInputToolsItem_Webhook", "PromptAgentOutputToolsItem", "PromptAgentOutputToolsItem_Client", "PromptAgentOutputToolsItem_Mcp", - "PromptAgentOutputToolsItem_NativeMcp", "PromptAgentOutputToolsItem_System", "PromptAgentOutputToolsItem_Webhook", "PromptAgentOverride", @@ -1207,7 +1199,6 @@ "SendTextMulti", "ShareOptionResponseModel", "ShareOptionResponseModelType", - "SharedSoundGenerationResponseModel", "SimilarVoice", "SimilarVoiceCategory", "SimilarVoicesForSpeakerResponse", @@ -1356,6 +1347,7 @@ "WidgetLanguagePreset", "WidgetLanguagePresetResponse", "WidgetPlacement", + "WidgetStyles", "WidgetTextContents", "WorkspaceBatchCallsResponse", "WorkspaceGroupByNameResponseModel", diff --git a/src/elevenlabs/base_client.py b/src/elevenlabs/base_client.py index d23fb6ef..50e2f1cf 100644 --- a/src/elevenlabs/base_client.py +++ b/src/elevenlabs/base_client.py @@ -100,10 +100,10 @@ def __init__( self.audio_native = AudioNativeClient(client_wrapper=self._client_wrapper) self.usage = UsageClient(client_wrapper=self._client_wrapper) self.pronunciation_dictionaries = PronunciationDictionariesClient(client_wrapper=self._client_wrapper) + self.workspace = WorkspaceClient(client_wrapper=self._client_wrapper) self.speech_to_text = SpeechToTextClient(client_wrapper=self._client_wrapper) self.forced_alignment = ForcedAlignmentClient(client_wrapper=self._client_wrapper) self.conversational_ai = ConversationalAiClient(client_wrapper=self._client_wrapper) - self.workspace = WorkspaceClient(client_wrapper=self._client_wrapper) class AsyncBaseElevenLabs: @@ -178,7 +178,7 @@ def __init__( self.audio_native = AsyncAudioNativeClient(client_wrapper=self._client_wrapper) self.usage = AsyncUsageClient(client_wrapper=self._client_wrapper) self.pronunciation_dictionaries = AsyncPronunciationDictionariesClient(client_wrapper=self._client_wrapper) + self.workspace = AsyncWorkspaceClient(client_wrapper=self._client_wrapper) self.speech_to_text = AsyncSpeechToTextClient(client_wrapper=self._client_wrapper) self.forced_alignment = AsyncForcedAlignmentClient(client_wrapper=self._client_wrapper) self.conversational_ai = AsyncConversationalAiClient(client_wrapper=self._client_wrapper) - self.workspace = AsyncWorkspaceClient(client_wrapper=self._client_wrapper) diff --git a/src/elevenlabs/conversational_ai/conversations/feedback/raw_client.py b/src/elevenlabs/conversational_ai/conversations/feedback/raw_client.py index 468b674a..6746144c 100644 --- a/src/elevenlabs/conversational_ai/conversations/feedback/raw_client.py +++ b/src/elevenlabs/conversational_ai/conversations/feedback/raw_client.py @@ -61,6 +61,8 @@ def create( omit=OMIT, ) try: + if _response is None or not _response.text.strip(): + return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Optional[typing.Any], @@ -131,6 +133,8 @@ async def create( omit=OMIT, ) try: + if _response is None or not _response.text.strip(): + return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Optional[typing.Any], diff --git a/src/elevenlabs/conversational_ai/conversations/raw_client.py b/src/elevenlabs/conversational_ai/conversations/raw_client.py index 4f54ced7..96b57143 100644 --- a/src/elevenlabs/conversational_ai/conversations/raw_client.py +++ b/src/elevenlabs/conversational_ai/conversations/raw_client.py @@ -234,6 +234,8 @@ def delete( request_options=request_options, ) try: + if _response is None or not _response.text.strip(): + return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Optional[typing.Any], @@ -477,6 +479,8 @@ async def delete( request_options=request_options, ) try: + if _response is None or not _response.text.strip(): + return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Optional[typing.Any], diff --git a/src/elevenlabs/conversational_ai/knowledge_base/documents/raw_client.py b/src/elevenlabs/conversational_ai/knowledge_base/documents/raw_client.py index 7df64c6d..a2acdb40 100644 --- a/src/elevenlabs/conversational_ai/knowledge_base/documents/raw_client.py +++ b/src/elevenlabs/conversational_ai/knowledge_base/documents/raw_client.py @@ -302,6 +302,8 @@ def delete( request_options=request_options, ) try: + if _response is None or not _response.text.strip(): + return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Optional[typing.Any], @@ -779,6 +781,8 @@ async def delete( request_options=request_options, ) try: + if _response is None or not _response.text.strip(): + return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Optional[typing.Any], diff --git a/src/elevenlabs/conversational_ai/phone_numbers/raw_client.py b/src/elevenlabs/conversational_ai/phone_numbers/raw_client.py index 7f3c8187..b5e028bc 100644 --- a/src/elevenlabs/conversational_ai/phone_numbers/raw_client.py +++ b/src/elevenlabs/conversational_ai/phone_numbers/raw_client.py @@ -160,6 +160,8 @@ def delete( request_options=request_options, ) try: + if _response is None or not _response.text.strip(): + return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Optional[typing.Any], @@ -436,6 +438,8 @@ async def delete( request_options=request_options, ) try: + if _response is None or not _response.text.strip(): + return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Optional[typing.Any], diff --git a/src/elevenlabs/core/client_wrapper.py b/src/elevenlabs/core/client_wrapper.py index 87a73714..24bbfe41 100644 --- a/src/elevenlabs/core/client_wrapper.py +++ b/src/elevenlabs/core/client_wrapper.py @@ -21,10 +21,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "elevenlabs/v2.3.0", + "User-Agent": "elevenlabs/v2.4.0", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "v2.3.0", + "X-Fern-SDK-Version": "v2.4.0", } if self._api_key is not None: headers["xi-api-key"] = self._api_key diff --git a/src/elevenlabs/speech_to_text/client.py b/src/elevenlabs/speech_to_text/client.py index c2367d48..577c69b8 100644 --- a/src/elevenlabs/speech_to_text/client.py +++ b/src/elevenlabs/speech_to_text/client.py @@ -45,6 +45,7 @@ def convert( file_format: typing.Optional[SpeechToTextConvertRequestFileFormat] = OMIT, cloud_storage_url: typing.Optional[str] = OMIT, webhook: typing.Optional[bool] = OMIT, + temperature: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechToTextChunkResponseModel: """ @@ -86,7 +87,10 @@ def convert( The valid AWS S3, Cloudflare R2 or Google Cloud Storage URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be a valid publicly accessible cloud storage URL. The file size must be less than 2GB. URL can be pre-signed. webhook : typing.Optional[bool] - Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. Webhooks can be created and assigned to a transcription task in webhook settings page in the UI. + Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. + + temperature : typing.Optional[float] + Controls the randomness of the transcription output. Accepts values between 0.0 and 2.0, where higher values result in more diverse and less deterministic results. If omitted, we will use a temperature based on the model you selected which is usually 0. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -120,6 +124,7 @@ def convert( file_format=file_format, cloud_storage_url=cloud_storage_url, webhook=webhook, + temperature=temperature, request_options=request_options, ) return _response.data @@ -155,6 +160,7 @@ async def convert( file_format: typing.Optional[SpeechToTextConvertRequestFileFormat] = OMIT, cloud_storage_url: typing.Optional[str] = OMIT, webhook: typing.Optional[bool] = OMIT, + temperature: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechToTextChunkResponseModel: """ @@ -196,7 +202,10 @@ async def convert( The valid AWS S3, Cloudflare R2 or Google Cloud Storage URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be a valid publicly accessible cloud storage URL. The file size must be less than 2GB. URL can be pre-signed. webhook : typing.Optional[bool] - Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. Webhooks can be created and assigned to a transcription task in webhook settings page in the UI. + Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. + + temperature : typing.Optional[float] + Controls the randomness of the transcription output. Accepts values between 0.0 and 2.0, where higher values result in more diverse and less deterministic results. If omitted, we will use a temperature based on the model you selected which is usually 0. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -238,6 +247,7 @@ async def main() -> None: file_format=file_format, cloud_storage_url=cloud_storage_url, webhook=webhook, + temperature=temperature, request_options=request_options, ) return _response.data diff --git a/src/elevenlabs/speech_to_text/raw_client.py b/src/elevenlabs/speech_to_text/raw_client.py index 68285916..3aa08f7c 100644 --- a/src/elevenlabs/speech_to_text/raw_client.py +++ b/src/elevenlabs/speech_to_text/raw_client.py @@ -39,6 +39,7 @@ def convert( file_format: typing.Optional[SpeechToTextConvertRequestFileFormat] = OMIT, cloud_storage_url: typing.Optional[str] = OMIT, webhook: typing.Optional[bool] = OMIT, + temperature: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SpeechToTextChunkResponseModel]: """ @@ -80,7 +81,10 @@ def convert( The valid AWS S3, Cloudflare R2 or Google Cloud Storage URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be a valid publicly accessible cloud storage URL. The file size must be less than 2GB. URL can be pre-signed. webhook : typing.Optional[bool] - Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. Webhooks can be created and assigned to a transcription task in webhook settings page in the UI. + Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. + + temperature : typing.Optional[float] + Controls the randomness of the transcription output. Accepts values between 0.0 and 2.0, where higher values result in more diverse and less deterministic results. If omitted, we will use a temperature based on the model you selected which is usually 0. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -108,6 +112,7 @@ def convert( "file_format": file_format, "cloud_storage_url": cloud_storage_url, "webhook": webhook, + "temperature": temperature, }, files={ **({"file": file} if file is not None else {}), @@ -162,6 +167,7 @@ async def convert( file_format: typing.Optional[SpeechToTextConvertRequestFileFormat] = OMIT, cloud_storage_url: typing.Optional[str] = OMIT, webhook: typing.Optional[bool] = OMIT, + temperature: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SpeechToTextChunkResponseModel]: """ @@ -203,7 +209,10 @@ async def convert( The valid AWS S3, Cloudflare R2 or Google Cloud Storage URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be a valid publicly accessible cloud storage URL. The file size must be less than 2GB. URL can be pre-signed. webhook : typing.Optional[bool] - Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. Webhooks can be created and assigned to a transcription task in webhook settings page in the UI. + Whether to send the transcription result to configured speech-to-text webhooks. If set the request will return early without the transcription, which will be delivered later via webhook. + + temperature : typing.Optional[float] + Controls the randomness of the transcription output. Accepts values between 0.0 and 2.0, where higher values result in more diverse and less deterministic results. If omitted, we will use a temperature based on the model you selected which is usually 0. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -231,6 +240,7 @@ async def convert( "file_format": file_format, "cloud_storage_url": cloud_storage_url, "webhook": webhook, + "temperature": temperature, }, files={ **({"file": file} if file is not None else {}), diff --git a/src/elevenlabs/types/__init__.py b/src/elevenlabs/types/__init__.py index 3bfc3ba6..1a0e8cd3 100644 --- a/src/elevenlabs/types/__init__.py +++ b/src/elevenlabs/types/__init__.py @@ -113,6 +113,7 @@ BodyStreamProjectAudioV1ProjectsProjectIdSnapshotsProjectSnapshotIdStreamPost, ) from .breakdown_types import BreakdownTypes +from .built_in_tools import BuiltInTools from .chapter_content_block_extendable_node_response_model import ChapterContentBlockExtendableNodeResponseModel from .chapter_content_block_input_model import ChapterContentBlockInputModel from .chapter_content_block_input_model_sub_type import ChapterContentBlockInputModelSubType @@ -399,7 +400,6 @@ GetPronunciationDictionaryMetadataResponseModelPermissionOnResource, ) from .get_pronunciation_dictionary_response import GetPronunciationDictionaryResponse -from .get_shared_sound_generations_response_model import GetSharedSoundGenerationsResponseModel from .get_speech_history_response import GetSpeechHistoryResponse from .get_voices_response import GetVoicesResponse from .get_voices_v_2_response import GetVoicesV2Response @@ -413,6 +413,7 @@ from .initialise_context import InitialiseContext from .initialize_connection import InitializeConnection from .initialize_connection_multi import InitializeConnectionMulti +from .integration_type import IntegrationType from .invoice_response import InvoiceResponse from .keep_context_alive import KeepContextAlive from .knowledge_base_document_chunk_response_model import KnowledgeBaseDocumentChunkResponseModel @@ -440,7 +441,7 @@ from .llm_usage_output import LlmUsageOutput from .manual_verification_file_response import ManualVerificationFileResponse from .manual_verification_response import ManualVerificationResponse -from .mcp_approval_required_model import McpApprovalRequiredModel +from .mcp_approval_policy import McpApprovalPolicy from .mcp_tool_config_input import McpToolConfigInput from .mcp_tool_config_output import McpToolConfigOutput from .metric_record import MetricRecord @@ -452,8 +453,6 @@ from .moderation_status_response_model import ModerationStatusResponseModel from .moderation_status_response_model_safety_status import ModerationStatusResponseModelSafetyStatus from .moderation_status_response_model_warning_status import ModerationStatusResponseModelWarningStatus -from .native_mcp_tool_config_input import NativeMcpToolConfigInput -from .native_mcp_tool_config_output import NativeMcpToolConfigOutput from .normalized_alignment import NormalizedAlignment from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput from .object_json_schema_property_input_properties_value import ObjectJsonSchemaPropertyInputPropertiesValue @@ -501,7 +500,6 @@ PromptAgentDbModelToolsItem, PromptAgentDbModelToolsItem_Client, PromptAgentDbModelToolsItem_Mcp, - PromptAgentDbModelToolsItem_NativeMcp, PromptAgentDbModelToolsItem_System, PromptAgentDbModelToolsItem_Webhook, ) @@ -509,7 +507,6 @@ PromptAgentInputToolsItem, PromptAgentInputToolsItem_Client, PromptAgentInputToolsItem_Mcp, - PromptAgentInputToolsItem_NativeMcp, PromptAgentInputToolsItem_System, PromptAgentInputToolsItem_Webhook, ) @@ -517,7 +514,6 @@ PromptAgentOutputToolsItem, PromptAgentOutputToolsItem_Client, PromptAgentOutputToolsItem_Mcp, - PromptAgentOutputToolsItem_NativeMcp, PromptAgentOutputToolsItem_System, PromptAgentOutputToolsItem_Webhook, ) @@ -574,7 +570,6 @@ from .send_text_multi import SendTextMulti from .share_option_response_model import ShareOptionResponseModel from .share_option_response_model_type import ShareOptionResponseModelType -from .shared_sound_generation_response_model import SharedSoundGenerationResponseModel from .similar_voice import SimilarVoice from .similar_voice_category import SimilarVoiceCategory from .similar_voices_for_speaker_response import SimilarVoicesForSpeakerResponse @@ -720,6 +715,7 @@ from .widget_language_preset import WidgetLanguagePreset from .widget_language_preset_response import WidgetLanguagePresetResponse from .widget_placement import WidgetPlacement +from .widget_styles import WidgetStyles from .widget_text_contents import WidgetTextContents from .workspace_batch_calls_response import WorkspaceBatchCallsResponse from .workspace_group_by_name_response_model import WorkspaceGroupByNameResponseModel @@ -803,6 +799,7 @@ "BodyStreamChapterAudioV1ProjectsProjectIdChaptersChapterIdSnapshotsChapterSnapshotIdStreamPost", "BodyStreamProjectAudioV1ProjectsProjectIdSnapshotsProjectSnapshotIdStreamPost", "BreakdownTypes", + "BuiltInTools", "ChapterContentBlockExtendableNodeResponseModel", "ChapterContentBlockInputModel", "ChapterContentBlockInputModelSubType", @@ -1039,7 +1036,6 @@ "GetPronunciationDictionaryMetadataResponse", "GetPronunciationDictionaryMetadataResponseModelPermissionOnResource", "GetPronunciationDictionaryResponse", - "GetSharedSoundGenerationsResponseModel", "GetSpeechHistoryResponse", "GetVoicesResponse", "GetVoicesV2Response", @@ -1053,6 +1049,7 @@ "InitialiseContext", "InitializeConnection", "InitializeConnectionMulti", + "IntegrationType", "InvoiceResponse", "KeepContextAlive", "KnowledgeBaseDocumentChunkResponseModel", @@ -1080,7 +1077,7 @@ "LlmUsageOutput", "ManualVerificationFileResponse", "ManualVerificationResponse", - "McpApprovalRequiredModel", + "McpApprovalPolicy", "McpToolConfigInput", "McpToolConfigOutput", "MetricRecord", @@ -1092,8 +1089,6 @@ "ModerationStatusResponseModel", "ModerationStatusResponseModelSafetyStatus", "ModerationStatusResponseModelWarningStatus", - "NativeMcpToolConfigInput", - "NativeMcpToolConfigOutput", "NormalizedAlignment", "ObjectJsonSchemaPropertyInput", "ObjectJsonSchemaPropertyInputPropertiesValue", @@ -1140,19 +1135,16 @@ "PromptAgentDbModelToolsItem", "PromptAgentDbModelToolsItem_Client", "PromptAgentDbModelToolsItem_Mcp", - "PromptAgentDbModelToolsItem_NativeMcp", "PromptAgentDbModelToolsItem_System", "PromptAgentDbModelToolsItem_Webhook", "PromptAgentInputToolsItem", "PromptAgentInputToolsItem_Client", "PromptAgentInputToolsItem_Mcp", - "PromptAgentInputToolsItem_NativeMcp", "PromptAgentInputToolsItem_System", "PromptAgentInputToolsItem_Webhook", "PromptAgentOutputToolsItem", "PromptAgentOutputToolsItem_Client", "PromptAgentOutputToolsItem_Mcp", - "PromptAgentOutputToolsItem_NativeMcp", "PromptAgentOutputToolsItem_System", "PromptAgentOutputToolsItem_Webhook", "PromptAgentOverride", @@ -1206,7 +1198,6 @@ "SendTextMulti", "ShareOptionResponseModel", "ShareOptionResponseModelType", - "SharedSoundGenerationResponseModel", "SimilarVoice", "SimilarVoiceCategory", "SimilarVoicesForSpeakerResponse", @@ -1338,6 +1329,7 @@ "WidgetLanguagePreset", "WidgetLanguagePresetResponse", "WidgetPlacement", + "WidgetStyles", "WidgetTextContents", "WorkspaceBatchCallsResponse", "WorkspaceGroupByNameResponseModel", diff --git a/src/elevenlabs/types/built_in_tools.py b/src/elevenlabs/types/built_in_tools.py new file mode 100644 index 00000000..b5623d99 --- /dev/null +++ b/src/elevenlabs/types/built_in_tools.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .system_tool_config_input import SystemToolConfigInput + + +class BuiltInTools(UncheckedBaseModel): + end_call: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) + """ + The end call tool + """ + + language_detection: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) + """ + The language detection tool + """ + + transfer_to_agent: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) + """ + The transfer to agent tool + """ + + transfer_to_number: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) + """ + The transfer to number tool + """ + + skip_turn: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None) + """ + The skip turn tool + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/client_event.py b/src/elevenlabs/types/client_event.py index 76f256dc..f2b66dbe 100644 --- a/src/elevenlabs/types/client_event.py +++ b/src/elevenlabs/types/client_event.py @@ -13,10 +13,11 @@ "agent_response", "agent_response_correction", "client_tool_call", + "mcp_tool_call", + "agent_tool_response", "vad_score", "internal_turn_probability", "internal_tentative_agent_response", - "internal_native_mcp_tool_call", ], typing.Any, ] diff --git a/src/elevenlabs/types/get_shared_sound_generations_response_model.py b/src/elevenlabs/types/get_shared_sound_generations_response_model.py deleted file mode 100644 index 14601877..00000000 --- a/src/elevenlabs/types/get_shared_sound_generations_response_model.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .shared_sound_generation_response_model import SharedSoundGenerationResponseModel - - -class GetSharedSoundGenerationsResponseModel(UncheckedBaseModel): - shared_sound_generations: typing.List[SharedSoundGenerationResponseModel] - last_sort_id: typing.Optional[str] = None - has_more: bool - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/integration_type.py b/src/elevenlabs/types/integration_type.py new file mode 100644 index 00000000..fd262cf8 --- /dev/null +++ b/src/elevenlabs/types/integration_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +IntegrationType = typing.Union[typing.Literal["mcp_server", "mcp_integration"], typing.Any] diff --git a/src/elevenlabs/types/mcp_approval_policy.py b/src/elevenlabs/types/mcp_approval_policy.py new file mode 100644 index 00000000..c5f21ea5 --- /dev/null +++ b/src/elevenlabs/types/mcp_approval_policy.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +McpApprovalPolicy = typing.Union[ + typing.Literal["auto_approve_all", "require_approval_all", "require_approval_per_tool"], typing.Any +] diff --git a/src/elevenlabs/types/mcp_approval_required_model.py b/src/elevenlabs/types/mcp_approval_required_model.py deleted file mode 100644 index 1bbed6aa..00000000 --- a/src/elevenlabs/types/mcp_approval_required_model.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -McpApprovalRequiredModel = typing.Union[ - typing.Literal["user_approval_always_given", "user_approval_never_given", "user_approval_required_per_tool"], - typing.Any, -] diff --git a/src/elevenlabs/types/mcp_tool_config_input.py b/src/elevenlabs/types/mcp_tool_config_input.py index 2ec14b5f..5f5e8b24 100644 --- a/src/elevenlabs/types/mcp_tool_config_input.py +++ b/src/elevenlabs/types/mcp_tool_config_input.py @@ -7,12 +7,13 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel -from .mcp_approval_required_model import McpApprovalRequiredModel +from .integration_type import IntegrationType +from .mcp_approval_policy import McpApprovalPolicy class McpToolConfigInput(UncheckedBaseModel): """ - A MCP tool is a tool that is used to call a MCP server + An MCP tool configuration that can be used to call MCP servers """ id: typing.Optional[str] = None @@ -23,24 +24,44 @@ class McpToolConfigInput(UncheckedBaseModel): The maximum time in seconds to wait for the tool call to complete. """ + integration_type: IntegrationType = pydantic.Field() + """ + The type of MCP tool + """ + parameters: typing.Optional["ObjectJsonSchemaPropertyInput"] = pydantic.Field(default=None) """ Schema for any parameters the LLM needs to provide to the MCP tool. """ + approval_policy: typing.Optional[McpApprovalPolicy] = pydantic.Field(default=None) + """ + The approval policy for the MCP tool + """ + mcp_tool_name: str = pydantic.Field() """ The name of the MCP tool to call """ + mcp_tool_description: str = pydantic.Field() + """ + The description of the MCP tool to call + """ + mcp_server_id: str = pydantic.Field() """ The id of the MCP server to call """ - approval_mode: typing.Optional[McpApprovalRequiredModel] = pydantic.Field(default=None) + mcp_server_name: str = pydantic.Field() + """ + The name of the MCP server to call + """ + + mcp_input_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) """ - If set to approved, the tool will be pre-approved and not require user approval before executing + Original inputSchema dict for consistent hashing (pure MCP format) """ if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/mcp_tool_config_output.py b/src/elevenlabs/types/mcp_tool_config_output.py index 34cc0cea..4630f2eb 100644 --- a/src/elevenlabs/types/mcp_tool_config_output.py +++ b/src/elevenlabs/types/mcp_tool_config_output.py @@ -7,12 +7,13 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel -from .mcp_approval_required_model import McpApprovalRequiredModel +from .integration_type import IntegrationType +from .mcp_approval_policy import McpApprovalPolicy class McpToolConfigOutput(UncheckedBaseModel): """ - A MCP tool is a tool that is used to call a MCP server + An MCP tool configuration that can be used to call MCP servers """ id: typing.Optional[str] = None @@ -23,24 +24,44 @@ class McpToolConfigOutput(UncheckedBaseModel): The maximum time in seconds to wait for the tool call to complete. """ + integration_type: IntegrationType = pydantic.Field() + """ + The type of MCP tool + """ + parameters: typing.Optional["ObjectJsonSchemaPropertyOutput"] = pydantic.Field(default=None) """ Schema for any parameters the LLM needs to provide to the MCP tool. """ + approval_policy: typing.Optional[McpApprovalPolicy] = pydantic.Field(default=None) + """ + The approval policy for the MCP tool + """ + mcp_tool_name: str = pydantic.Field() """ The name of the MCP tool to call """ + mcp_tool_description: str = pydantic.Field() + """ + The description of the MCP tool to call + """ + mcp_server_id: str = pydantic.Field() """ The id of the MCP server to call """ - approval_mode: typing.Optional[McpApprovalRequiredModel] = pydantic.Field(default=None) + mcp_server_name: str = pydantic.Field() + """ + The name of the MCP server to call + """ + + mcp_input_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) """ - If set to approved, the tool will be pre-approved and not require user approval before executing + Original inputSchema dict for consistent hashing (pure MCP format) """ if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/native_mcp_tool_config_input.py b/src/elevenlabs/types/native_mcp_tool_config_input.py deleted file mode 100644 index 70e68825..00000000 --- a/src/elevenlabs/types/native_mcp_tool_config_input.py +++ /dev/null @@ -1,59 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from ..core.unchecked_base_model import UncheckedBaseModel -from .mcp_approval_required_model import McpApprovalRequiredModel - - -class NativeMcpToolConfigInput(UncheckedBaseModel): - """ - A Native MCP tool is a tool that is used to call a Native MCP server - """ - - id: typing.Optional[str] = None - name: str - description: str - response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) - """ - The maximum time in seconds to wait for the tool call to complete. - """ - - parameters: typing.Optional["ObjectJsonSchemaPropertyInput"] = pydantic.Field(default=None) - """ - Schema for any parameters the LLM needs to provide to the MCP tool. - """ - - mcp_tool_name: str = pydantic.Field() - """ - The name of the MCP tool to call - """ - - mcp_server_id: str = pydantic.Field() - """ - The id of the MCP server to call - """ - - approval_mode: typing.Optional[McpApprovalRequiredModel] = pydantic.Field(default=None) - """ - If set to always accept, the tool will be pre-approved and not require user approval before executing - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, F401, I001 -from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, F401, I001 - -update_forward_refs(NativeMcpToolConfigInput) diff --git a/src/elevenlabs/types/native_mcp_tool_config_output.py b/src/elevenlabs/types/native_mcp_tool_config_output.py deleted file mode 100644 index 309fdbe3..00000000 --- a/src/elevenlabs/types/native_mcp_tool_config_output.py +++ /dev/null @@ -1,59 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from ..core.unchecked_base_model import UncheckedBaseModel -from .mcp_approval_required_model import McpApprovalRequiredModel - - -class NativeMcpToolConfigOutput(UncheckedBaseModel): - """ - A Native MCP tool is a tool that is used to call a Native MCP server - """ - - id: typing.Optional[str] = None - name: str - description: str - response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) - """ - The maximum time in seconds to wait for the tool call to complete. - """ - - parameters: typing.Optional["ObjectJsonSchemaPropertyOutput"] = pydantic.Field(default=None) - """ - Schema for any parameters the LLM needs to provide to the MCP tool. - """ - - mcp_tool_name: str = pydantic.Field() - """ - The name of the MCP tool to call - """ - - mcp_server_id: str = pydantic.Field() - """ - The id of the MCP server to call - """ - - approval_mode: typing.Optional[McpApprovalRequiredModel] = pydantic.Field(default=None) - """ - If set to always accept, the tool will be pre-approved and not require user approval before executing - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, F401, I001 -from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, F401, I001 - -update_forward_refs(NativeMcpToolConfigOutput) diff --git a/src/elevenlabs/types/prompt_agent_db_model.py b/src/elevenlabs/types/prompt_agent_db_model.py index 19f53f17..8f586e2c 100644 --- a/src/elevenlabs/types/prompt_agent_db_model.py +++ b/src/elevenlabs/types/prompt_agent_db_model.py @@ -7,6 +7,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel +from .built_in_tools import BuiltInTools from .custom_llm import CustomLlm from .knowledge_base_locator import KnowledgeBaseLocator from .llm import Llm @@ -76,6 +77,7 @@ class PromptAgentDbModel(UncheckedBaseModel): """ knowledge_base_document_ids: typing.Optional[typing.List[str]] = None + built_in_tools: typing.Optional[BuiltInTools] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/prompt_agent_db_model_tools_item.py b/src/elevenlabs/types/prompt_agent_db_model_tools_item.py index 8c54ae18..8072c9c8 100644 --- a/src/elevenlabs/types/prompt_agent_db_model_tools_item.py +++ b/src/elevenlabs/types/prompt_agent_db_model_tools_item.py @@ -9,7 +9,8 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dynamic_variables_config import DynamicVariablesConfig -from .mcp_approval_required_model import McpApprovalRequiredModel +from .integration_type import IntegrationType +from .mcp_approval_policy import McpApprovalPolicy from .system_tool_config_input_params import SystemToolConfigInputParams from .webhook_tool_api_schema_config_input import WebhookToolApiSchemaConfigInput @@ -48,35 +49,14 @@ class PromptAgentDbModelToolsItem_Mcp(UncheckedBaseModel): name: str description: str response_timeout_secs: typing.Optional[int] = None + integration_type: IntegrationType parameters: typing.Optional["ObjectJsonSchemaPropertyInput"] = None + approval_policy: typing.Optional[McpApprovalPolicy] = None mcp_tool_name: str + mcp_tool_description: str mcp_server_id: str - approval_mode: typing.Optional[McpApprovalRequiredModel] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class PromptAgentDbModelToolsItem_NativeMcp(UncheckedBaseModel): - """ - The type of tool - """ - - type: typing.Literal["native_mcp"] = "native_mcp" - id: typing.Optional[str] = None - name: str - description: str - response_timeout_secs: typing.Optional[int] = None - parameters: typing.Optional["ObjectJsonSchemaPropertyInput"] = None - mcp_tool_name: str - mcp_server_id: str - approval_mode: typing.Optional[McpApprovalRequiredModel] = None + mcp_server_name: str + mcp_input_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -140,7 +120,6 @@ class Config: typing.Union[ PromptAgentDbModelToolsItem_Client, PromptAgentDbModelToolsItem_Mcp, - PromptAgentDbModelToolsItem_NativeMcp, PromptAgentDbModelToolsItem_System, PromptAgentDbModelToolsItem_Webhook, ], @@ -148,5 +127,4 @@ class Config: ] update_forward_refs(PromptAgentDbModelToolsItem_Client) update_forward_refs(PromptAgentDbModelToolsItem_Mcp) -update_forward_refs(PromptAgentDbModelToolsItem_NativeMcp) update_forward_refs(PromptAgentDbModelToolsItem_Webhook) diff --git a/src/elevenlabs/types/prompt_agent_input_tools_item.py b/src/elevenlabs/types/prompt_agent_input_tools_item.py index 997e8c1a..263b924c 100644 --- a/src/elevenlabs/types/prompt_agent_input_tools_item.py +++ b/src/elevenlabs/types/prompt_agent_input_tools_item.py @@ -9,7 +9,8 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dynamic_variables_config import DynamicVariablesConfig -from .mcp_approval_required_model import McpApprovalRequiredModel +from .integration_type import IntegrationType +from .mcp_approval_policy import McpApprovalPolicy from .system_tool_config_input_params import SystemToolConfigInputParams from .webhook_tool_api_schema_config_input import WebhookToolApiSchemaConfigInput @@ -48,35 +49,14 @@ class PromptAgentInputToolsItem_Mcp(UncheckedBaseModel): name: str description: str response_timeout_secs: typing.Optional[int] = None + integration_type: IntegrationType parameters: typing.Optional["ObjectJsonSchemaPropertyInput"] = None + approval_policy: typing.Optional[McpApprovalPolicy] = None mcp_tool_name: str + mcp_tool_description: str mcp_server_id: str - approval_mode: typing.Optional[McpApprovalRequiredModel] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class PromptAgentInputToolsItem_NativeMcp(UncheckedBaseModel): - """ - The type of tool - """ - - type: typing.Literal["native_mcp"] = "native_mcp" - id: typing.Optional[str] = None - name: str - description: str - response_timeout_secs: typing.Optional[int] = None - parameters: typing.Optional["ObjectJsonSchemaPropertyInput"] = None - mcp_tool_name: str - mcp_server_id: str - approval_mode: typing.Optional[McpApprovalRequiredModel] = None + mcp_server_name: str + mcp_input_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -140,7 +120,6 @@ class Config: typing.Union[ PromptAgentInputToolsItem_Client, PromptAgentInputToolsItem_Mcp, - PromptAgentInputToolsItem_NativeMcp, PromptAgentInputToolsItem_System, PromptAgentInputToolsItem_Webhook, ], @@ -148,5 +127,4 @@ class Config: ] update_forward_refs(PromptAgentInputToolsItem_Client) update_forward_refs(PromptAgentInputToolsItem_Mcp) -update_forward_refs(PromptAgentInputToolsItem_NativeMcp) update_forward_refs(PromptAgentInputToolsItem_Webhook) diff --git a/src/elevenlabs/types/prompt_agent_output_tools_item.py b/src/elevenlabs/types/prompt_agent_output_tools_item.py index cca8406e..36b420bc 100644 --- a/src/elevenlabs/types/prompt_agent_output_tools_item.py +++ b/src/elevenlabs/types/prompt_agent_output_tools_item.py @@ -9,7 +9,8 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata from .dynamic_variables_config import DynamicVariablesConfig -from .mcp_approval_required_model import McpApprovalRequiredModel +from .integration_type import IntegrationType +from .mcp_approval_policy import McpApprovalPolicy from .system_tool_config_output_params import SystemToolConfigOutputParams from .webhook_tool_api_schema_config_output import WebhookToolApiSchemaConfigOutput @@ -48,35 +49,14 @@ class PromptAgentOutputToolsItem_Mcp(UncheckedBaseModel): name: str description: str response_timeout_secs: typing.Optional[int] = None + integration_type: IntegrationType parameters: typing.Optional["ObjectJsonSchemaPropertyOutput"] = None + approval_policy: typing.Optional[McpApprovalPolicy] = None mcp_tool_name: str + mcp_tool_description: str mcp_server_id: str - approval_mode: typing.Optional[McpApprovalRequiredModel] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class PromptAgentOutputToolsItem_NativeMcp(UncheckedBaseModel): - """ - The type of tool - """ - - type: typing.Literal["native_mcp"] = "native_mcp" - id: typing.Optional[str] = None - name: str - description: str - response_timeout_secs: typing.Optional[int] = None - parameters: typing.Optional["ObjectJsonSchemaPropertyOutput"] = None - mcp_tool_name: str - mcp_server_id: str - approval_mode: typing.Optional[McpApprovalRequiredModel] = None + mcp_server_name: str + mcp_input_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 @@ -140,7 +120,6 @@ class Config: typing.Union[ PromptAgentOutputToolsItem_Client, PromptAgentOutputToolsItem_Mcp, - PromptAgentOutputToolsItem_NativeMcp, PromptAgentOutputToolsItem_System, PromptAgentOutputToolsItem_Webhook, ], @@ -148,5 +127,4 @@ class Config: ] update_forward_refs(PromptAgentOutputToolsItem_Client) update_forward_refs(PromptAgentOutputToolsItem_Mcp) -update_forward_refs(PromptAgentOutputToolsItem_NativeMcp) update_forward_refs(PromptAgentOutputToolsItem_Webhook) diff --git a/src/elevenlabs/types/shared_sound_generation_response_model.py b/src/elevenlabs/types/shared_sound_generation_response_model.py deleted file mode 100644 index 34e9b8c7..00000000 --- a/src/elevenlabs/types/shared_sound_generation_response_model.py +++ /dev/null @@ -1,31 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel - - -class SharedSoundGenerationResponseModel(UncheckedBaseModel): - public_user_id: str - history_item_id: str - generation_id: str - text: str - category: str - labels: typing.Dict[str, str] - purchased_count: int - like_count: int - featured: bool - preview_url: str - purchased: bool - icon_url: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/supported_voice.py b/src/elevenlabs/types/supported_voice.py index e5003ae6..a10cbbc0 100644 --- a/src/elevenlabs/types/supported_voice.py +++ b/src/elevenlabs/types/supported_voice.py @@ -6,6 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .tts_model_family import TtsModelFamily +from .tts_optimize_streaming_latency import TtsOptimizeStreamingLatency class SupportedVoice(UncheckedBaseModel): @@ -14,6 +15,10 @@ class SupportedVoice(UncheckedBaseModel): description: typing.Optional[str] = None language: typing.Optional[str] = None model_family: typing.Optional[TtsModelFamily] = None + optimize_streaming_latency: typing.Optional[TtsOptimizeStreamingLatency] = None + stability: typing.Optional[float] = None + speed: typing.Optional[float] = None + similarity_boost: typing.Optional[float] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/system_tool_config_input_params.py b/src/elevenlabs/types/system_tool_config_input_params.py index eb15c0ea..10c73c81 100644 --- a/src/elevenlabs/types/system_tool_config_input_params.py +++ b/src/elevenlabs/types/system_tool_config_input_params.py @@ -68,6 +68,7 @@ class Config: class SystemToolConfigInputParams_TransferToNumber(UncheckedBaseModel): system_tool_type: typing.Literal["transfer_to_number"] = "transfer_to_number" transfers: typing.List[PhoneNumberTransfer] + enable_client_message: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/system_tool_config_output_params.py b/src/elevenlabs/types/system_tool_config_output_params.py index e49b07e1..bb7b787b 100644 --- a/src/elevenlabs/types/system_tool_config_output_params.py +++ b/src/elevenlabs/types/system_tool_config_output_params.py @@ -68,6 +68,7 @@ class Config: class SystemToolConfigOutputParams_TransferToNumber(UncheckedBaseModel): system_tool_type: typing.Literal["transfer_to_number"] = "transfer_to_number" transfers: typing.List[PhoneNumberTransfer] + enable_client_message: typing.Optional[bool] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/transfer_to_number_tool_config.py b/src/elevenlabs/types/transfer_to_number_tool_config.py index bf61b8ad..542eaf7e 100644 --- a/src/elevenlabs/types/transfer_to_number_tool_config.py +++ b/src/elevenlabs/types/transfer_to_number_tool_config.py @@ -10,6 +10,10 @@ class TransferToNumberToolConfig(UncheckedBaseModel): transfers: typing.List[PhoneNumberTransfer] + enable_client_message: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether to play a message to the client while they wait for transfer. Defaults to true for backward compatibility. + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/widget_config.py b/src/elevenlabs/types/widget_config.py index 6a694d79..10b45cc7 100644 --- a/src/elevenlabs/types/widget_config.py +++ b/src/elevenlabs/types/widget_config.py @@ -11,6 +11,7 @@ from .widget_feedback_mode import WidgetFeedbackMode from .widget_language_preset import WidgetLanguagePreset from .widget_placement import WidgetPlacement +from .widget_styles import WidgetStyles from .widget_text_contents import WidgetTextContents @@ -170,6 +171,11 @@ class WidgetConfig(UncheckedBaseModel): Text contents of the widget """ + styles: typing.Optional[WidgetStyles] = pydantic.Field(default=None) + """ + Styles for the widget + """ + language_selector: typing.Optional[bool] = pydantic.Field(default=None) """ Whether to show the language selector diff --git a/src/elevenlabs/types/widget_config_response.py b/src/elevenlabs/types/widget_config_response.py index 3a648dab..32200eec 100644 --- a/src/elevenlabs/types/widget_config_response.py +++ b/src/elevenlabs/types/widget_config_response.py @@ -11,6 +11,7 @@ from .widget_feedback_mode import WidgetFeedbackMode from .widget_language_preset_response import WidgetLanguagePresetResponse from .widget_placement import WidgetPlacement +from .widget_styles import WidgetStyles from .widget_text_contents import WidgetTextContents @@ -170,6 +171,11 @@ class WidgetConfigResponse(UncheckedBaseModel): Text contents of the widget """ + styles: typing.Optional[WidgetStyles] = pydantic.Field(default=None) + """ + Styles for the widget + """ + language: str supported_language_overrides: typing.Optional[typing.List[str]] = None language_presets: typing.Optional[typing.Dict[str, WidgetLanguagePresetResponse]] = pydantic.Field(default=None) diff --git a/src/elevenlabs/types/widget_styles.py b/src/elevenlabs/types/widget_styles.py new file mode 100644 index 00000000..43bb358e --- /dev/null +++ b/src/elevenlabs/types/widget_styles.py @@ -0,0 +1,118 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class WidgetStyles(UncheckedBaseModel): + base: typing.Optional[str] = pydantic.Field(default=None) + """ + The base background color. + """ + + base_hover: typing.Optional[str] = pydantic.Field(default=None) + """ + The color of the base background when hovered. + """ + + base_active: typing.Optional[str] = pydantic.Field(default=None) + """ + The color of the base background when active (clicked). + """ + + base_border: typing.Optional[str] = pydantic.Field(default=None) + """ + The color of the border against the base background. + """ + + base_subtle: typing.Optional[str] = pydantic.Field(default=None) + """ + The color of subtle text against the base background. + """ + + base_primary: typing.Optional[str] = pydantic.Field(default=None) + """ + The color of primary text against the base background. + """ + + base_error: typing.Optional[str] = pydantic.Field(default=None) + """ + The color of error text against the base background. + """ + + accent: typing.Optional[str] = pydantic.Field(default=None) + """ + The accent background color. + """ + + accent_hover: typing.Optional[str] = pydantic.Field(default=None) + """ + The color of the accent background when hovered. + """ + + accent_active: typing.Optional[str] = pydantic.Field(default=None) + """ + The color of the accent background when active (clicked). + """ + + accent_border: typing.Optional[str] = pydantic.Field(default=None) + """ + The color of the border against the accent background. + """ + + accent_subtle: typing.Optional[str] = pydantic.Field(default=None) + """ + The color of subtle text against the accent background. + """ + + accent_primary: typing.Optional[str] = pydantic.Field(default=None) + """ + The color of primary text against the accent background. + """ + + overlay_padding: typing.Optional[float] = pydantic.Field(default=None) + """ + The padding around the edges of the viewport. + """ + + button_radius: typing.Optional[float] = pydantic.Field(default=None) + """ + The radius of the buttons. + """ + + input_radius: typing.Optional[float] = pydantic.Field(default=None) + """ + The radius of the input fields. + """ + + bubble_radius: typing.Optional[float] = pydantic.Field(default=None) + """ + The radius of the chat bubbles. + """ + + sheet_radius: typing.Optional[float] = pydantic.Field(default=None) + """ + The default radius of sheets. + """ + + compact_sheet_radius: typing.Optional[float] = pydantic.Field(default=None) + """ + The radius of the sheet in compact mode. + """ + + dropdown_sheet_radius: typing.Optional[float] = pydantic.Field(default=None) + """ + The radius of the dropdown sheet. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/workspace_resource_type.py b/src/elevenlabs/types/workspace_resource_type.py index c79cd089..857bd9eb 100644 --- a/src/elevenlabs/types/workspace_resource_type.py +++ b/src/elevenlabs/types/workspace_resource_type.py @@ -16,7 +16,7 @@ "convai_secrets", "music_latent", "convai_phone_numbers", - "convai_mcps", + "convai_mcp_servers", "convai_batch_calls", ], typing.Any, diff --git a/src/elevenlabs/voices/client.py b/src/elevenlabs/voices/client.py index e9e07273..3a1d9270 100644 --- a/src/elevenlabs/voices/client.py +++ b/src/elevenlabs/voices/client.py @@ -112,7 +112,7 @@ def search( Which direction to sort the voices in. 'asc' or 'desc'. voice_type : typing.Optional[str] - Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to 'personal' plus 'community'. + Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to all but 'default'. category : typing.Optional[str] Category of the voice to filter by. One of 'premade', 'cloned', 'generated', 'professional' @@ -613,7 +613,7 @@ async def search( Which direction to sort the voices in. 'asc' or 'desc'. voice_type : typing.Optional[str] - Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to 'personal' plus 'community'. + Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to all but 'default'. category : typing.Optional[str] Category of the voice to filter by. One of 'premade', 'cloned', 'generated', 'professional' diff --git a/src/elevenlabs/voices/raw_client.py b/src/elevenlabs/voices/raw_client.py index bf62d192..81558305 100644 --- a/src/elevenlabs/voices/raw_client.py +++ b/src/elevenlabs/voices/raw_client.py @@ -119,7 +119,7 @@ def search( Which direction to sort the voices in. 'asc' or 'desc'. voice_type : typing.Optional[str] - Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to 'personal' plus 'community'. + Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to all but 'default'. category : typing.Optional[str] Category of the voice to filter by. One of 'premade', 'cloned', 'generated', 'professional' @@ -758,7 +758,7 @@ async def search( Which direction to sort the voices in. 'asc' or 'desc'. voice_type : typing.Optional[str] - Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to 'personal' plus 'community'. + Type of the voice to filter by. One of 'personal', 'community', 'default', 'workspace', 'non-default'. 'non-default' is equal to all but 'default'. category : typing.Optional[str] Category of the voice to filter by. One of 'premade', 'cloned', 'generated', 'professional' diff --git a/src/elevenlabs/workspace/client.py b/src/elevenlabs/workspace/client.py index e896af3c..3074232d 100644 --- a/src/elevenlabs/workspace/client.py +++ b/src/elevenlabs/workspace/client.py @@ -1,12 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +import typing + from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.request_options import RequestOptions from .groups.client import AsyncGroupsClient, GroupsClient from .invites.client import AsyncInvitesClient, InvitesClient from .members.client import AsyncMembersClient, MembersClient from .raw_client import AsyncRawWorkspaceClient, RawWorkspaceClient from .resources.client import AsyncResourcesClient, ResourcesClient +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + class WorkspaceClient: def __init__(self, *, client_wrapper: SyncClientWrapper): @@ -30,6 +36,38 @@ def with_raw_response(self) -> RawWorkspaceClient: """ return self._raw_client + def update_user_auto_provisioning( + self, *, enabled: bool, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Optional[typing.Any]: + """ + Update user auto provisioning settings for the workspace. + + Parameters + ---------- + enabled : bool + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Optional[typing.Any] + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.workspace.update_user_auto_provisioning( + enabled=True, + ) + """ + _response = self._raw_client.update_user_auto_provisioning(enabled=enabled, request_options=request_options) + return _response.data + class AsyncWorkspaceClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -52,3 +90,45 @@ def with_raw_response(self) -> AsyncRawWorkspaceClient: AsyncRawWorkspaceClient """ return self._raw_client + + async def update_user_auto_provisioning( + self, *, enabled: bool, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Optional[typing.Any]: + """ + Update user auto provisioning settings for the workspace. + + Parameters + ---------- + enabled : bool + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Optional[typing.Any] + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.workspace.update_user_auto_provisioning( + enabled=True, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.update_user_auto_provisioning( + enabled=enabled, request_options=request_options + ) + return _response.data diff --git a/src/elevenlabs/workspace/raw_client.py b/src/elevenlabs/workspace/raw_client.py index b33dafd0..3183bf3d 100644 --- a/src/elevenlabs/workspace/raw_client.py +++ b/src/elevenlabs/workspace/raw_client.py @@ -1,13 +1,143 @@ # This file was auto-generated by Fern from our API Definition. +import typing +from json.decoder import JSONDecodeError + +from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.request_options import RequestOptions +from ..core.unchecked_base_model import construct_type +from ..errors.unprocessable_entity_error import UnprocessableEntityError +from ..types.http_validation_error import HttpValidationError + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) class RawWorkspaceClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + def update_user_auto_provisioning( + self, *, enabled: bool, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[typing.Optional[typing.Any]]: + """ + Update user auto provisioning settings for the workspace. + + Parameters + ---------- + enabled : bool + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[typing.Optional[typing.Any]] + Successful Response + """ + _response = self._client_wrapper.httpx_client.request( + "v1/workspace/user-auto-provisioning", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "enabled": enabled, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if _response is None or not _response.text.strip(): + return HttpResponse(response=_response, data=None) + if 200 <= _response.status_code < 300: + _data = typing.cast( + typing.Optional[typing.Any], + construct_type( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + class AsyncRawWorkspaceClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper + + async def update_user_auto_provisioning( + self, *, enabled: bool, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[typing.Optional[typing.Any]]: + """ + Update user auto provisioning settings for the workspace. + + Parameters + ---------- + enabled : bool + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[typing.Optional[typing.Any]] + Successful Response + """ + _response = await self._client_wrapper.httpx_client.request( + "v1/workspace/user-auto-provisioning", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "enabled": enabled, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if _response is None or not _response.text.strip(): + return AsyncHttpResponse(response=_response, data=None) + if 200 <= _response.status_code < 300: + _data = typing.cast( + typing.Optional[typing.Any], + construct_type( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/elevenlabs/workspace/resources/raw_client.py b/src/elevenlabs/workspace/resources/raw_client.py index bc0b7f72..11f2d494 100644 --- a/src/elevenlabs/workspace/resources/raw_client.py +++ b/src/elevenlabs/workspace/resources/raw_client.py @@ -146,6 +146,8 @@ def share( omit=OMIT, ) try: + if _response is None or not _response.text.strip(): + return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Optional[typing.Any], @@ -226,6 +228,8 @@ def unshare( omit=OMIT, ) try: + if _response is None or not _response.text.strip(): + return HttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Optional[typing.Any], @@ -377,6 +381,8 @@ async def share( omit=OMIT, ) try: + if _response is None or not _response.text.strip(): + return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Optional[typing.Any], @@ -457,6 +463,8 @@ async def unshare( omit=OMIT, ) try: + if _response is None or not _response.text.strip(): + return AsyncHttpResponse(response=_response, data=None) if 200 <= _response.status_code < 300: _data = typing.cast( typing.Optional[typing.Any],