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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public partial interface IOpenRouterClient : global::System.IDisposable
/// </summary>
public SubpackageChatClient SubpackageChat { get; }

/// <summary>
///
/// </summary>
public SubpackageClassificationsClient SubpackageClassifications { get; }

/// <summary>
///
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#nullable enable

namespace OpenRouter
{
public partial interface ISubpackageClassificationsClient
{
/// <summary>
/// Task classification market share<br/>
/// Returns the market-share breakdown of OpenRouter traffic by task classification<br/>
/// (e.g. code generation, web search, summarization) over a trailing time window.<br/>
/// Each classification reports its share of classified sampled requests (`usage_share`)<br/>
/// and classified sampled token volume (`token_share`) as fractions between 0 and 1.<br/>
/// The unclassified `other` bucket is excluded. Absolute volumes are not exposed<br/>
/// because the underlying data is sampled.<br/>
/// Each classification also includes a `models` array listing the top models by<br/>
/// request volume within that classification, with their within-tag usage and token shares.<br/>
/// Classifications are grouped into macro-categories (Code, Data, Agent, General)<br/>
/// with aggregate shares provided for each.<br/>
/// Authenticate with any valid OpenRouter API key (same key used for inference).<br/>
/// Rate-limited to 30 requests/minute per key and 500 requests/day per account.<br/>
/// When republishing or quoting this data, cite as:<br/>
/// "Source: OpenRouter (openrouter.ai/rankings), as of {as_of}."
/// </summary>
/// <param name="window">
/// Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.<br/>
/// Default Value: 7d
/// </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::OpenRouter.ApiException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.TaskClassificationResponse> GetTaskClassificationsAsync(
global::OpenRouter.ClassificationsTaskGetParametersWindow? window = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Task classification market share<br/>
/// Returns the market-share breakdown of OpenRouter traffic by task classification<br/>
/// (e.g. code generation, web search, summarization) over a trailing time window.<br/>
/// Each classification reports its share of classified sampled requests (`usage_share`)<br/>
/// and classified sampled token volume (`token_share`) as fractions between 0 and 1.<br/>
/// The unclassified `other` bucket is excluded. Absolute volumes are not exposed<br/>
/// because the underlying data is sampled.<br/>
/// Each classification also includes a `models` array listing the top models by<br/>
/// request volume within that classification, with their within-tag usage and token shares.<br/>
/// Classifications are grouped into macro-categories (Code, Data, Agent, General)<br/>
/// with aggregate shares provided for each.<br/>
/// Authenticate with any valid OpenRouter API key (same key used for inference).<br/>
/// Rate-limited to 30 requests/minute per key and 500 requests/day per account.<br/>
/// When republishing or quoting this data, cite as:<br/>
/// "Source: OpenRouter (openrouter.ai/rankings), as of {as_of}."
/// </summary>
/// <param name="window">
/// Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.<br/>
/// Default Value: 7d
/// </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::OpenRouter.ApiException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.AutoSDKHttpResponse<global::OpenRouter.TaskClassificationResponse>> GetTaskClassificationsAsResponseAsync(
global::OpenRouter.ClassificationsTaskGetParametersWindow? window = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

#nullable enable

namespace OpenRouter
{
/// <summary>
/// If no httpClient is provided, a new one will be created.<br/>
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
public partial interface ISubpackageClassificationsClient : global::System.IDisposable
{
/// <summary>
/// The HttpClient instance.
/// </summary>
public global::System.Net.Http.HttpClient HttpClient { get; }

/// <summary>
/// The base URL for the API.
/// </summary>
public System.Uri? BaseUri { get; }

/// <summary>
/// The authorizations to use for the requests.
/// </summary>
public global::System.Collections.Generic.List<global::OpenRouter.EndPointAuthorization> Authorizations { get; }

/// <summary>
/// Gets or sets a value indicating whether the response content should be read as a string.
/// True by default in debug builds, false otherwise.
/// When false, successful responses are deserialized directly from the response stream for better performance.
/// Error responses are always read as strings regardless of this setting,
/// ensuring <see cref="ApiException.ResponseBody"/> is populated.
/// </summary>
public bool ReadResponseAsString { get; set; }
/// <summary>
/// Client-wide request defaults such as headers, query parameters, retries, and timeout.
/// </summary>
public global::OpenRouter.AutoSDKClientOptions Options { get; }


/// <summary>
///
/// </summary>
global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; }


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

namespace OpenRouter.JsonConverters
{
/// <inheritdoc />
public sealed class ClassificationsTaskGetParametersWindowJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.ClassificationsTaskGetParametersWindow>
{
/// <inheritdoc />
public override global::OpenRouter.ClassificationsTaskGetParametersWindow Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::OpenRouter.ClassificationsTaskGetParametersWindowExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::OpenRouter.ClassificationsTaskGetParametersWindow)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::OpenRouter.ClassificationsTaskGetParametersWindow);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenRouter.ClassificationsTaskGetParametersWindow value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::OpenRouter.ClassificationsTaskGetParametersWindowExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace OpenRouter.JsonConverters
{
/// <inheritdoc />
public sealed class ClassificationsTaskGetParametersWindowNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.ClassificationsTaskGetParametersWindow?>
{
/// <inheritdoc />
public override global::OpenRouter.ClassificationsTaskGetParametersWindow? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::OpenRouter.ClassificationsTaskGetParametersWindowExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::OpenRouter.ClassificationsTaskGetParametersWindow)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::OpenRouter.ClassificationsTaskGetParametersWindow?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenRouter.ClassificationsTaskGetParametersWindow? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::OpenRouter.ClassificationsTaskGetParametersWindowExtensions.ToValueString(value.Value));
}
}
}
}
Loading