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 @@ -49,6 +49,9 @@ public partial interface ISubpackageAnthropicMessagesClient
/// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.
/// </param>
/// <param name="contextManagement"></param>
/// <param name="fallbacks">
/// Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries.
/// </param>
/// <param name="maxTokens"></param>
/// <param name="messages"></param>
/// <param name="metadata"></param>
Expand Down Expand Up @@ -97,6 +100,7 @@ public partial interface ISubpackageAnthropicMessagesClient
global::OpenRouter.MetadataLevel? xOpenRouterMetadata = default,
global::OpenRouter.AnthropicCacheControlDirective? cacheControl = default,
global::OpenRouter.OneOf<global::OpenRouter.MessagesRequestContextManagement, object>? contextManagement = default,
global::System.Collections.Generic.IList<global::OpenRouter.MessagesFallbackParam>? fallbacks = default,
int? maxTokens = default,
global::System.Collections.Generic.IList<global::OpenRouter.MessagesMessageParam>? messages = default,
global::OpenRouter.MessagesRequestMetadata? metadata = default,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#nullable enable

namespace OpenRouter
{
public partial interface ISubpackageDatasetsClient
{
/// <summary>
/// Design Arena Benchmark Rankings<br/>
/// Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
/// </summary>
/// <param name="arena">
/// Arena to query. Defaults to `models`.<br/>
/// Default Value: models
/// </param>
/// <param name="category"></param>
/// <param name="maxResults">
/// Default Value: 50
/// </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.BenchmarksDAResponse> GetBenchmarksDesignArenaAsync(
global::OpenRouter.DatasetsBenchmarksDesignArenaGetParametersArena? arena = default,
string? category = default,
int? maxResults = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Design Arena Benchmark Rankings<br/>
/// Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
/// </summary>
/// <param name="arena">
/// Arena to query. Defaults to `models`.<br/>
/// Default Value: models
/// </param>
/// <param name="category"></param>
/// <param name="maxResults">
/// Default Value: 50
/// </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.BenchmarksDAResponse>> GetBenchmarksDesignArenaAsResponseAsync(
global::OpenRouter.DatasetsBenchmarksDesignArenaGetParametersArena? arena = default,
string? category = default,
int? maxResults = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public partial interface ISubpackagePresetsClient
/// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.
/// </param>
/// <param name="contextManagement"></param>
/// <param name="fallbacks">
/// Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries.
/// </param>
/// <param name="maxTokens"></param>
/// <param name="messages"></param>
/// <param name="metadata"></param>
Expand Down Expand Up @@ -91,6 +94,7 @@ public partial interface ISubpackagePresetsClient
string model,
global::OpenRouter.AnthropicCacheControlDirective? cacheControl = default,
global::OpenRouter.OneOf<global::OpenRouter.MessagesRequestContextManagement, object>? contextManagement = default,
global::System.Collections.Generic.IList<global::OpenRouter.MessagesFallbackParam>? fallbacks = default,
int? maxTokens = default,
global::System.Collections.Generic.IList<global::OpenRouter.MessagesMessageParam>? messages = default,
global::OpenRouter.MessagesRequestMetadata? metadata = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class AnthropicUsageIterationJsonConverter : global::System.Text.Json.Ser
if (__jsonProps.Contains("cache_creation_input_tokens")) __score1++;
if (__jsonProps.Contains("cache_read_input_tokens")) __score1++;
if (__jsonProps.Contains("input_tokens")) __score1++;
if (__jsonProps.Contains("model")) __score1++;
if (__jsonProps.Contains("output_tokens")) __score1++;
if (__jsonProps.Contains("type")) __score1++;
var __score2 = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace OpenRouter.JsonConverters
{
/// <inheritdoc />
public sealed class BenchmarksDaMetaSourceJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.BenchmarksDaMetaSource>
{
/// <inheritdoc />
public override global::OpenRouter.BenchmarksDaMetaSource 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.BenchmarksDaMetaSourceExtensions.ToEnum(stringValue) ?? default;
}

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

return default;
}

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

writer.WriteStringValue(global::OpenRouter.BenchmarksDaMetaSourceExtensions.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 BenchmarksDaMetaSourceNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.BenchmarksDaMetaSource?>
{
/// <inheritdoc />
public override global::OpenRouter.BenchmarksDaMetaSource? 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.BenchmarksDaMetaSourceExtensions.ToEnum(stringValue);
}

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

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenRouter.BenchmarksDaMetaSource? 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.BenchmarksDaMetaSourceExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace OpenRouter.JsonConverters
{
/// <inheritdoc />
public sealed class BenchmarksDaMetaSourceUrlJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.BenchmarksDaMetaSourceUrl>
{
/// <inheritdoc />
public override global::OpenRouter.BenchmarksDaMetaSourceUrl 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.BenchmarksDaMetaSourceUrlExtensions.ToEnum(stringValue) ?? default;
}

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

return default;
}

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

writer.WriteStringValue(global::OpenRouter.BenchmarksDaMetaSourceUrlExtensions.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 BenchmarksDaMetaSourceUrlNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.BenchmarksDaMetaSourceUrl?>
{
/// <inheritdoc />
public override global::OpenRouter.BenchmarksDaMetaSourceUrl? 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.BenchmarksDaMetaSourceUrlExtensions.ToEnum(stringValue);
}

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

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenRouter.BenchmarksDaMetaSourceUrl? 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.BenchmarksDaMetaSourceUrlExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace OpenRouter.JsonConverters
{
/// <inheritdoc />
public sealed class BenchmarksDaMetaVersionJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.BenchmarksDaMetaVersion>
{
/// <inheritdoc />
public override global::OpenRouter.BenchmarksDaMetaVersion 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.BenchmarksDaMetaVersionExtensions.ToEnum(stringValue) ?? default;
}

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

return default;
}

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

writer.WriteStringValue(global::OpenRouter.BenchmarksDaMetaVersionExtensions.ToValueString(value));
}
}
}
Loading