Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Elevenlabs Elevenlabs python WorkspaceClient

From Leeroopedia
Field Value
Sources src/elevenlabs/workspace/client.py, src/elevenlabs/workspace/raw_client.py
Domains Workspace Management, Organization
Last Updated 2026-02-15

Overview

The WorkspaceClient serves as a namespace client that provides access to workspace management sub-clients in the ElevenLabs API. It does not define direct API methods of its own, but instead aggregates four lazily-initialized sub-client properties for managing different aspects of a workspace: groups, invites, members, and resources.

Each sub-client is loaded on demand (lazy initialization) to minimize import overhead and allow for modular access to workspace features. The client also provides a with_raw_response property for accessing the underlying RawWorkspaceClient, though the raw client itself does not define any methods in the current implementation.

The client is accessible via client.workspace on an ElevenLabs instance. Both synchronous (WorkspaceClient) and asynchronous (AsyncWorkspaceClient) variants are provided.

Code Reference

Source Location

  • High-level client: src/elevenlabs/workspace/client.py
  • Raw client: src/elevenlabs/workspace/raw_client.py

Class Signatures

class WorkspaceClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper): ...

class AsyncWorkspaceClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper): ...

Import

The client is not typically imported directly. Instead, it is accessed through the main ElevenLabs client:

from elevenlabs import ElevenLabs

client = ElevenLabs(api_key="YOUR_API_KEY")
client.workspace  # WorkspaceClient instance

I/O Contract

The WorkspaceClient does not define direct API methods. Instead, it exposes the following sub-client properties:

Sub-Client Properties

Property Type (Sync) Type (Async) Description
groups GroupsClient AsyncGroupsClient Manage workspace groups
invites InvitesClient AsyncInvitesClient Manage workspace invitations
members MembersClient AsyncMembersClient Manage workspace members
resources ResourcesClient AsyncResourcesClient Manage workspace resources

All sub-clients are lazily initialized on first access. They are imported from their respective modules only when the property is first accessed, reducing startup overhead.

with_raw_response Property

Property Type (Sync) Type (Async)
with_raw_response RawWorkspaceClient AsyncRawWorkspaceClient

The RawWorkspaceClient and AsyncRawWorkspaceClient are minimal classes that currently do not define any methods. They serve as placeholders for potential future raw-response API endpoints on the workspace namespace.

Usage Examples

Access Workspace Sub-Clients

from elevenlabs import ElevenLabs

client = ElevenLabs(
    api_key="YOUR_API_KEY",
)

# Access workspace groups
groups_client = client.workspace.groups

# Access workspace invites
invites_client = client.workspace.invites

# Access workspace members
members_client = client.workspace.members

# Access workspace resources
resources_client = client.workspace.resources

Async Usage

import asyncio
from elevenlabs import AsyncElevenLabs

client = AsyncElevenLabs(
    api_key="YOUR_API_KEY",
)

async def main() -> None:
    # Access workspace groups asynchronously
    groups_client = client.workspace.groups

    # Access workspace members asynchronously
    members_client = client.workspace.members

asyncio.run(main())

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment