Table of Contents

Class LiveKitCloudAgentService

Namespace
LiveKit.Services
Assembly
LiveKit.AspNetCore.ServerSdk.dll

Service for managing LiveKit Cloud agents.

Provides methods for deploying, managing, and monitoring AI agent deployments on LiveKit Cloud. See Cloud Agent Service Documentation for more information.

public sealed class LiveKitCloudAgentService : TwirpClient, ILiveKitCloudAgentService
Inheritance
LiveKitCloudAgentService
Implements
Inherited Members

Constructors

LiveKitCloudAgentService(HttpClient, ILogger<LiveKitCloudAgentService>, ILiveKitTokenService)

Initializes a new instance of the LiveKitCloudAgentService class.

public LiveKitCloudAgentService(HttpClient httpClient, ILogger<LiveKitCloudAgentService> logger, ILiveKitTokenService _tokenService)

Parameters

httpClient HttpClient
logger ILogger<LiveKitCloudAgentService>
_tokenService ILiveKitTokenService

Methods

CreateAgentAsync(CreateAgentRequest, CancellationToken)

Creates a new agent deployment.

public Task<CreateAgentResponse> CreateAgentAsync(CreateAgentRequest request, CancellationToken cancellationToken = default)

Parameters

request CreateAgentRequest
cancellationToken CancellationToken

Returns

Task<CreateAgentResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

CreateAgentV2Async(CreateAgentV2Request, CancellationToken)

Creates a new agent deployment (V2 API).

public Task<CreateAgentV2Response> CreateAgentV2Async(CreateAgentV2Request request, CancellationToken cancellationToken = default)

Parameters

request CreateAgentV2Request
cancellationToken CancellationToken

Returns

Task<CreateAgentV2Response>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

CreatePrivateLinkAsync(CreatePrivateLinkRequest, CancellationToken)

Creates a private link for an agent.

public Task<CreatePrivateLinkResponse> CreatePrivateLinkAsync(CreatePrivateLinkRequest request, CancellationToken cancellationToken = default)

Parameters

request CreatePrivateLinkRequest
cancellationToken CancellationToken

Returns

Task<CreatePrivateLinkResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

DeleteAgentAsync(DeleteAgentRequest, CancellationToken)

Deletes an agent deployment.

public Task<DeleteAgentResponse> DeleteAgentAsync(DeleteAgentRequest request, CancellationToken cancellationToken = default)

Parameters

request DeleteAgentRequest
cancellationToken CancellationToken

Returns

Task<DeleteAgentResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

DeployAgentAsync(DeployAgentRequest, CancellationToken)

Deploys a new version of an agent.

public Task<DeployAgentResponse> DeployAgentAsync(DeployAgentRequest request, CancellationToken cancellationToken = default)

Parameters

request DeployAgentRequest
cancellationToken CancellationToken

Returns

Task<DeployAgentResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

DeployAgentV2Async(DeployAgentV2Request, CancellationToken)

Deploys a new version of an agent (V2 API).

public Task<DeployAgentV2Response> DeployAgentV2Async(DeployAgentV2Request request, CancellationToken cancellationToken = default)

Parameters

request DeployAgentV2Request
cancellationToken CancellationToken

Returns

Task<DeployAgentV2Response>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

DestroyPrivateLinkAsync(DestroyPrivateLinkRequest, CancellationToken)

Destroys a private link.

public Task<DestroyPrivateLinkResponse> DestroyPrivateLinkAsync(DestroyPrivateLinkRequest request, CancellationToken cancellationToken = default)

Parameters

request DestroyPrivateLinkRequest
cancellationToken CancellationToken

Returns

Task<DestroyPrivateLinkResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

GetClientSettingsAsync(ClientSettingsRequest, CancellationToken)

Gets client settings.

public Task<ClientSettingsResponse> GetClientSettingsAsync(ClientSettingsRequest request, CancellationToken cancellationToken = default)

Parameters

request ClientSettingsRequest
cancellationToken CancellationToken

Returns

Task<ClientSettingsResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

GetPrivateLinkStatusAsync(GetPrivateLinkStatusRequest, CancellationToken)

Gets the status of a private link.

public Task<GetPrivateLinkStatusResponse> GetPrivateLinkStatusAsync(GetPrivateLinkStatusRequest request, CancellationToken cancellationToken = default)

Parameters

request GetPrivateLinkStatusRequest
cancellationToken CancellationToken

Returns

Task<GetPrivateLinkStatusResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

ListAgentSecretsAsync(ListAgentSecretsRequest, CancellationToken)

Lists secrets for an agent.

public Task<ListAgentSecretsResponse> ListAgentSecretsAsync(ListAgentSecretsRequest request, CancellationToken cancellationToken = default)

Parameters

request ListAgentSecretsRequest
cancellationToken CancellationToken

Returns

Task<ListAgentSecretsResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

ListAgentVersionsAsync(ListAgentVersionsRequest, CancellationToken)

Lists versions of an agent.

public Task<ListAgentVersionsResponse> ListAgentVersionsAsync(ListAgentVersionsRequest request, CancellationToken cancellationToken = default)

Parameters

request ListAgentVersionsRequest
cancellationToken CancellationToken

Returns

Task<ListAgentVersionsResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

ListAgentsAsync(ListAgentsRequest, CancellationToken)

Lists agents in the project.

public Task<ListAgentsResponse> ListAgentsAsync(ListAgentsRequest request, CancellationToken cancellationToken = default)

Parameters

request ListAgentsRequest
cancellationToken CancellationToken

Returns

Task<ListAgentsResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

ListPrivateLinksAsync(ListPrivateLinksRequest, CancellationToken)

Lists private links.

public Task<ListPrivateLinksResponse> ListPrivateLinksAsync(ListPrivateLinksRequest request, CancellationToken cancellationToken = default)

Parameters

request ListPrivateLinksRequest
cancellationToken CancellationToken

Returns

Task<ListPrivateLinksResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

RestartAgentAsync(RestartAgentRequest, CancellationToken)

Restarts an agent deployment.

public Task<RestartAgentResponse> RestartAgentAsync(RestartAgentRequest request, CancellationToken cancellationToken = default)

Parameters

request RestartAgentRequest
cancellationToken CancellationToken

Returns

Task<RestartAgentResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

RollbackAgentAsync(RollbackAgentRequest, CancellationToken)

Rolls back an agent to a previous version.

public Task<RollbackAgentResponse> RollbackAgentAsync(RollbackAgentRequest request, CancellationToken cancellationToken = default)

Parameters

request RollbackAgentRequest
cancellationToken CancellationToken

Returns

Task<RollbackAgentResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

UpdateAgentAsync(UpdateAgentRequest, CancellationToken)

Updates an existing agent.

public Task<UpdateAgentResponse> UpdateAgentAsync(UpdateAgentRequest request, CancellationToken cancellationToken = default)

Parameters

request UpdateAgentRequest
cancellationToken CancellationToken

Returns

Task<UpdateAgentResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

UpdateAgentSecretsAsync(UpdateAgentSecretsRequest, CancellationToken)

Updates secrets for an agent.

public Task<UpdateAgentSecretsResponse> UpdateAgentSecretsAsync(UpdateAgentSecretsRequest request, CancellationToken cancellationToken = default)

Parameters

request UpdateAgentSecretsRequest
cancellationToken CancellationToken

Returns

Task<UpdateAgentSecretsResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.