Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#nullable enable

namespace CursorAgents
{
public partial interface ICursorAgentsClient
{
/// <summary>
/// Get agent usage<br/>
/// Retrieve token usage for an agent, broken down per run.<br/>
/// `totalUsage` sums input, output, and cache token counts across<br/>
/// every run on the agent, and `runs` lists the same breakdown for<br/>
/// each run. Token usage mirrors the `tokenUsage` shape on the team<br/>
/// usage events endpoint.<br/>
/// This endpoint is in early access. When it isn't enabled for the<br/>
/// account it returns `403 feature_unavailable`. An unknown `runId`<br/>
/// returns `404 run_not_found`.
/// </summary>
/// <param name="id">
/// Example: bc-00000000-0000-0000-0000-000000000001
/// </param>
/// <param name="runId">
/// Example: run-00000000-0000-0000-0000-000000000001
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::CursorAgents.ApiException"></exception>
global::System.Threading.Tasks.Task<global::CursorAgents.AgentUsageResponse> GetAgentUsageAsync(
string id,
string? runId = default,
global::CursorAgents.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Get agent usage<br/>
/// Retrieve token usage for an agent, broken down per run.<br/>
/// `totalUsage` sums input, output, and cache token counts across<br/>
/// every run on the agent, and `runs` lists the same breakdown for<br/>
/// each run. Token usage mirrors the `tokenUsage` shape on the team<br/>
/// usage events endpoint.<br/>
/// This endpoint is in early access. When it isn't enabled for the<br/>
/// account it returns `403 feature_unavailable`. An unknown `runId`<br/>
/// returns `404 run_not_found`.
/// </summary>
/// <param name="id">
/// Example: bc-00000000-0000-0000-0000-000000000001
/// </param>
/// <param name="runId">
/// Example: run-00000000-0000-0000-0000-000000000001
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::CursorAgents.ApiException"></exception>
global::System.Threading.Tasks.Task<global::CursorAgents.AutoSDKHttpResponse<global::CursorAgents.AgentUsageResponse>> GetAgentUsageAsResponseAsync(
string id,
string? runId = default,
global::CursorAgents.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ namespace CursorAgents
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ListArtifactsResponse))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::CursorAgents.Artifact>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.DownloadArtifactResponse))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.UsageTokenUsage))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.RunUsage))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.AgentUsageResponse))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::CursorAgents.RunUsage>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ApiKeyInfo))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ModelParameterValueDefinition))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ModelParameterDefinition))]
Expand Down Expand Up @@ -152,6 +156,7 @@ namespace CursorAgents
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.AgentSummary>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.Run>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.Artifact>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.RunUsage>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.ModelParameterValueDefinition>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.ModelVariantParam>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.ModelParameterDefinition>))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,79 +276,95 @@ public sealed partial class JsonSerializerContextTypes
/// <summary>
///
/// </summary>
public global::CursorAgents.ApiKeyInfo? Type62 { get; set; }
public global::CursorAgents.UsageTokenUsage? Type62 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ModelParameterValueDefinition? Type63 { get; set; }
public global::CursorAgents.RunUsage? Type63 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ModelParameterDefinition? Type64 { get; set; }
public global::CursorAgents.AgentUsageResponse? Type64 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.ModelParameterValueDefinition>? Type65 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.RunUsage>? Type65 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ModelVariant? Type66 { get; set; }
public global::CursorAgents.ApiKeyInfo? Type66 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.ModelVariantParam>? Type67 { get; set; }
public global::CursorAgents.ModelParameterValueDefinition? Type67 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ModelVariantParam? Type68 { get; set; }
public global::CursorAgents.ModelParameterDefinition? Type68 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ModelListItem? Type69 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.ModelParameterValueDefinition>? Type69 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.ModelParameterDefinition>? Type70 { get; set; }
public global::CursorAgents.ModelVariant? Type70 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.ModelVariant>? Type71 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.ModelVariantParam>? Type71 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ListModelsResponse? Type72 { get; set; }
public global::CursorAgents.ModelVariantParam? Type72 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.ModelListItem>? Type73 { get; set; }
public global::CursorAgents.ModelListItem? Type73 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.Repository? Type74 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.ModelParameterDefinition>? Type74 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ListRepositoriesResponse? Type75 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.ModelVariant>? Type75 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.Repository>? Type76 { get; set; }
public global::CursorAgents.ListModelsResponse? Type76 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.CreateSubTokenRequest? Type77 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.ModelListItem>? Type77 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.CreateSubTokenResponse? Type78 { get; set; }
public global::CursorAgents.Repository? Type78 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.Error? Type79 { get; set; }
public global::CursorAgents.ListRepositoriesResponse? Type79 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ErrorError1? Type80 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.Repository>? Type80 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.CreateSubTokenRequest? Type81 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.CreateSubTokenResponse? Type82 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.Error? Type83 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ErrorError1? Type84 { get; set; }

/// <summary>
///
Expand Down Expand Up @@ -397,26 +413,30 @@ public sealed partial class JsonSerializerContextTypes
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::CursorAgents.ModelParameterValueDefinition>? ListType11 { get; set; }
public global::System.Collections.Generic.List<global::CursorAgents.RunUsage>? ListType11 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::CursorAgents.ModelParameterValueDefinition>? ListType12 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::CursorAgents.ModelVariantParam>? ListType12 { get; set; }
public global::System.Collections.Generic.List<global::CursorAgents.ModelVariantParam>? ListType13 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::CursorAgents.ModelParameterDefinition>? ListType13 { get; set; }
public global::System.Collections.Generic.List<global::CursorAgents.ModelParameterDefinition>? ListType14 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::CursorAgents.ModelVariant>? ListType14 { get; set; }
public global::System.Collections.Generic.List<global::CursorAgents.ModelVariant>? ListType15 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::CursorAgents.ModelListItem>? ListType15 { get; set; }
public global::System.Collections.Generic.List<global::CursorAgents.ModelListItem>? ListType16 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.List<global::CursorAgents.Repository>? ListType16 { get; set; }
public global::System.Collections.Generic.List<global::CursorAgents.Repository>? ListType17 { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#nullable enable

namespace CursorAgents
{
public sealed partial class AgentUsageResponse
{
/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
/// </summary>
public string ToJson(
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
this.GetType(),
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerContext.
/// </summary>
public static global::CursorAgents.AgentUsageResponse? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::CursorAgents.AgentUsageResponse),
jsonSerializerContext) as global::CursorAgents.AgentUsageResponse;
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::CursorAgents.AgentUsageResponse? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::CursorAgents.AgentUsageResponse>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::CursorAgents.AgentUsageResponse?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
jsonStream,
typeof(global::CursorAgents.AgentUsageResponse),
jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.AgentUsageResponse;
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::System.Threading.Tasks.ValueTask<global::CursorAgents.AgentUsageResponse?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::CursorAgents.AgentUsageResponse?>(
jsonStream,
jsonSerializerOptions);
}
}
}
Loading