diff --git a/src/libs/OpenRouter/Generated/OpenRouter.AnthropicMessagesClient.CreateMessages.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.AnthropicMessagesClient.CreateMessages.g.cs
index 93d04e21..2150a027 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.AnthropicMessagesClient.CreateMessages.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.AnthropicMessagesClient.CreateMessages.g.cs
@@ -719,7 +719,7 @@ partial void ProcessCreateMessagesResponseContent(
/// Opt-in level for surfacing routing metadata on the response under `openrouter_metadata`.
///
///
- /// 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.
+ /// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
///
///
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ApiKeysClient.CreateKeys.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ApiKeysClient.CreateKeys.g.cs
index e464ae24..42fe1665 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.ApiKeysClient.CreateKeys.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.ApiKeysClient.CreateKeys.g.cs
@@ -652,7 +652,7 @@ partial void ProcessCreateKeysResponseContent(
global::System.DateTime? expiresAt = default,
bool? includeByokInLimit = default,
double? limit = default,
- global::OpenRouter.OneOf? limitReset = default,
+ global::OpenRouter.KeysPostRequestBodyContentApplicationJsonSchemaLimitReset? limitReset = default,
global::System.Guid? workspaceId = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ApiKeysClient.UpdateKeys.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ApiKeysClient.UpdateKeys.g.cs
index 99c7bf42..0cf4e07b 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.ApiKeysClient.UpdateKeys.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.ApiKeysClient.UpdateKeys.g.cs
@@ -655,7 +655,7 @@ partial void ProcessUpdateKeysResponseContent(
bool? disabled = default,
bool? includeByokInLimit = default,
double? limit = default,
- global::OpenRouter.OneOf? limitReset = default,
+ global::OpenRouter.KeysHashPatchRequestBodyContentApplicationJsonSchemaLimitReset? limitReset = default,
string? name = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.BetaAnalyticsClient.QueryAnalytics.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.BetaAnalyticsClient.QueryAnalytics.g.cs
index 8ea39e87..daf640ec 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.BetaAnalyticsClient.QueryAnalytics.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.BetaAnalyticsClient.QueryAnalytics.g.cs
@@ -622,6 +622,12 @@ partial void ProcessQueryAnalyticsResponseContent(
/// Query analytics data
/// Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
+ ///
+ /// Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace.
+ ///
+ ///
+ /// Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions.
+ ///
///
///
///
@@ -641,6 +647,8 @@ partial void ProcessQueryAnalyticsResponseContent(
///
public async global::System.Threading.Tasks.Task QueryAnalyticsAsync(
global::System.Collections.Generic.IList metrics,
+ global::OpenRouter.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierDimensions? classifierDimensions = default,
+ global::OpenRouter.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFilters? classifierFilters = default,
global::System.Collections.Generic.IList? dimensions = default,
global::System.Collections.Generic.IList? filters = default,
string? granularity = default,
@@ -653,6 +661,8 @@ partial void ProcessQueryAnalyticsResponseContent(
{
var __request = new global::OpenRouter.QueryAnalyticsRequest
{
+ ClassifierDimensions = classifierDimensions,
+ ClassifierFilters = classifierFilters,
Dimensions = dimensions,
Filters = filters,
Granularity = granularity,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.BetaResponsesClient.CreateResponses.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.BetaResponsesClient.CreateResponses.g.cs
index 98629015..63fd7cc8 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.BetaResponsesClient.CreateResponses.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.BetaResponsesClient.CreateResponses.g.cs
@@ -905,7 +905,7 @@ partial void ProcessCreateResponsesResponseContent(
///
///
///
- /// 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.
+ /// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
///
///
/// Debug options for inspecting request transformations (streaming only)
@@ -932,9 +932,14 @@ partial void ProcessCreateResponsesResponseContent(
/// Plugins you want to enable for this request, including their settings.
///
///
- ///
+ ///
+ /// Not supported. The Responses API is stateless: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead.
+ ///
///
///
+ ///
+ /// Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.
+ ///
///
/// When multiple model providers are available, optionally indicate your routing preference.
///
@@ -945,7 +950,9 @@ partial void ProcessCreateResponsesResponseContent(
/// Any type
///
///
- ///
+ ///
+ /// Default Value: auto
+ ///
///
/// A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
///
@@ -994,14 +1001,15 @@ partial void ProcessCreateResponsesResponseContent(
bool? parallelToolCalls = default,
global::System.Collections.Generic.IList? plugins = default,
double? presencePenalty = default,
- string? previousResponseId = default,
+ object? previousResponseId = default,
global::OpenRouter.StoredPromptTemplate? prompt = default,
string? promptCacheKey = default,
+ global::OpenRouter.PromptCacheOptions? promptCacheOptions = default,
global::OpenRouter.ProviderPreferences? provider = default,
global::OpenRouter.ReasoningConfig? reasoning = default,
object? route = default,
string? safetyIdentifier = default,
- global::OpenRouter.OneOf? serviceTier = default,
+ global::OpenRouter.ResponsesRequestServiceTier? serviceTier = default,
string? sessionId = default,
global::System.Collections.Generic.IList? stopServerToolsWhen = default,
bool? store = default,
@@ -1041,6 +1049,7 @@ partial void ProcessCreateResponsesResponseContent(
PreviousResponseId = previousResponseId,
Prompt = prompt,
PromptCacheKey = promptCacheKey,
+ PromptCacheOptions = promptCacheOptions,
Provider = provider,
Reasoning = reasoning,
Route = route,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ByokClient.ListByokKeys.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ByokClient.ListByokKeys.g.cs
index 024b2e00..399f0a1a 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.ByokClient.ListByokKeys.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.ByokClient.ListByokKeys.g.cs
@@ -51,8 +51,12 @@ partial void ProcessListByokKeysResponseContent(
/// List BYOK provider credentials
/// List the bring-your-own-key (BYOK) provider credentials for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace, or the `provider` query parameter to filter by upstream provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
///
///
/// Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`).
@@ -83,8 +87,12 @@ partial void ProcessListByokKeysResponseContent(
/// List BYOK provider credentials
/// List the bring-your-own-key (BYOK) provider credentials for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace, or the `provider` query parameter to filter by upstream provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
///
///
/// Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`).
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ChatClient.SendChatCompletionRequest.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ChatClient.SendChatCompletionRequest.g.cs
index 3e804f6a..61855a83 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.ChatClient.SendChatCompletionRequest.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.ChatClient.SendChatCompletionRequest.g.cs
@@ -904,7 +904,7 @@ partial void ProcessSendChatCompletionRequestResponseContent(
/// Opt-in level for surfacing routing metadata on the response under `openrouter_metadata`.
///
///
- /// 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.
+ /// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
///
///
/// Debug options for inspecting request transformations (streaming only)
@@ -949,9 +949,16 @@ partial void ProcessSendChatCompletionRequestResponseContent(
///
/// Plugins you want to enable for this request, including their settings.
///
+ ///
+ /// Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance.
+ ///
///
/// Presence penalty (-2.0 to 2.0)
///
+ ///
+ ///
+ /// Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.
+ ///
///
/// When multiple model providers are available, optionally indicate your routing preference.
///
@@ -1040,17 +1047,20 @@ partial void ProcessSendChatCompletionRequestResponseContent(
global::System.Collections.Generic.IList? models = default,
bool? parallelToolCalls = default,
global::System.Collections.Generic.IList? plugins = default,
+ global::OpenRouter.Prediction? prediction = default,
double? presencePenalty = default,
+ string? promptCacheKey = default,
+ global::OpenRouter.PromptCacheOptions? promptCacheOptions = default,
global::OpenRouter.ProviderPreferences? provider = default,
global::OpenRouter.ChatRequestReasoning? reasoning = default,
- global::OpenRouter.OneOf? reasoningEffort = default,
+ global::OpenRouter.ChatRequestReasoningEffort? reasoningEffort = default,
double? repetitionPenalty = default,
global::OpenRouter.ChatRequestResponseFormat? responseFormat = default,
object? route = default,
int? seed = default,
- global::OpenRouter.OneOf? serviceTier = default,
+ global::OpenRouter.ChatRequestServiceTier? serviceTier = default,
string? sessionId = default,
- global::OpenRouter.ChatRequestStop? stop = default,
+ global::OpenRouter.OneOf? stop = default,
global::System.Collections.Generic.IList? stopServerToolsWhen = default,
bool? stream = default,
global::OpenRouter.ChatStreamOptions? streamOptions = default,
@@ -1084,7 +1094,10 @@ partial void ProcessSendChatCompletionRequestResponseContent(
Models = models,
ParallelToolCalls = parallelToolCalls,
Plugins = plugins,
+ Prediction = prediction,
PresencePenalty = presencePenalty,
+ PromptCacheKey = promptCacheKey,
+ PromptCacheOptions = promptCacheOptions,
Provider = provider,
Reasoning = reasoning,
ReasoningEffort = reasoningEffort,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.DatasetsClient.GetRankingsDaily.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.DatasetsClient.GetRankingsDaily.g.cs
index afe89ad5..cda40fa2 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.DatasetsClient.GetRankingsDaily.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.DatasetsClient.GetRankingsDaily.g.cs
@@ -28,12 +28,22 @@ public partial class DatasetsClient
partial void PrepareGetRankingsDailyArguments(
global::System.Net.Http.HttpClient httpClient,
ref string? startDate,
- ref string? endDate);
+ ref string? endDate,
+ ref global::OpenRouter.DatasetsRankingsDailyGetParametersPeriod? period,
+ ref global::OpenRouter.DatasetsRankingsDailyGetParametersModality? modality,
+ ref global::OpenRouter.DatasetsRankingsDailyGetParametersContextBucket? contextBucket,
+ ref global::OpenRouter.DatasetsRankingsDailyGetParametersCategory? category,
+ ref global::OpenRouter.DatasetsRankingsDailyGetParametersLanguageType? languageType);
partial void PrepareGetRankingsDailyRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string? startDate,
- string? endDate);
+ string? endDate,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersPeriod? period,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersModality? modality,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersContextBucket? contextBucket,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersCategory? category,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersLanguageType? languageType);
partial void ProcessGetRankingsDailyResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);
@@ -52,6 +62,12 @@ partial void ProcessGetRankingsDailyResponseContent(
/// Each row is a distinct `(date, model_permaslug)` pair. The `other` row uses the
/// reserved permaslug `other` and is always returned last within its date, so callers
/// can compute `top-50 traffic / total daily traffic` without a second request.
+ /// Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time
+ /// grain. `modality` and `context_bucket` narrow the exact dataset by output/input
+ /// modality (or tool-calling activity) and request context length. `category` and
+ /// `language_type` instead read a sampled, upsampled dataset whose `total_tokens` are
+ /// weekly-grain estimates — they cannot be combined with each other or with the exact
+ /// filters, and reject `period=day` with a 400.
/// Authenticate with any valid OpenRouter API key (same key used for inference).
/// Rate-limited to 30 requests/minute per key and 500 requests/day per account.
/// When republishing or quoting this dataset, OpenRouter must be cited as:
@@ -63,18 +79,43 @@ partial void ProcessGetRankingsDailyResponseContent(
///
///
///
+ ///
+ /// Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries.
+ ///
+ ///
+ /// Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`.
+ ///
+ ///
+ /// Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`.
+ ///
+ ///
+ /// Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`.
+ ///
+ ///
+ /// Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`.
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
public async global::System.Threading.Tasks.Task GetRankingsDailyAsync(
string? startDate = default,
string? endDate = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersPeriod? period = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersModality? modality = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersContextBucket? contextBucket = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersCategory? category = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersLanguageType? languageType = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __response = await GetRankingsDailyAsResponseAsync(
startDate: startDate,
endDate: endDate,
+ period: period,
+ modality: modality,
+ contextBucket: contextBucket,
+ category: category,
+ languageType: languageType,
requestOptions: requestOptions,
cancellationToken: cancellationToken
).ConfigureAwait(false);
@@ -90,6 +131,12 @@ partial void ProcessGetRankingsDailyResponseContent(
/// Each row is a distinct `(date, model_permaslug)` pair. The `other` row uses the
/// reserved permaslug `other` and is always returned last within its date, so callers
/// can compute `top-50 traffic / total daily traffic` without a second request.
+ /// Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time
+ /// grain. `modality` and `context_bucket` narrow the exact dataset by output/input
+ /// modality (or tool-calling activity) and request context length. `category` and
+ /// `language_type` instead read a sampled, upsampled dataset whose `total_tokens` are
+ /// weekly-grain estimates — they cannot be combined with each other or with the exact
+ /// filters, and reject `period=day` with a 400.
/// Authenticate with any valid OpenRouter API key (same key used for inference).
/// Rate-limited to 30 requests/minute per key and 500 requests/day per account.
/// When republishing or quoting this dataset, OpenRouter must be cited as:
@@ -101,12 +148,32 @@ partial void ProcessGetRankingsDailyResponseContent(
///
///
///
+ ///
+ /// Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries.
+ ///
+ ///
+ /// Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`.
+ ///
+ ///
+ /// Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`.
+ ///
+ ///
+ /// Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`.
+ ///
+ ///
+ /// Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`.
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
public async global::System.Threading.Tasks.Task> GetRankingsDailyAsResponseAsync(
string? startDate = default,
string? endDate = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersPeriod? period = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersModality? modality = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersContextBucket? contextBucket = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersCategory? category = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersLanguageType? languageType = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
@@ -115,7 +182,12 @@ partial void ProcessGetRankingsDailyResponseContent(
PrepareGetRankingsDailyArguments(
httpClient: HttpClient,
startDate: ref startDate,
- endDate: ref endDate);
+ endDate: ref endDate,
+ period: ref period,
+ modality: ref modality,
+ contextBucket: ref contextBucket,
+ category: ref category,
+ languageType: ref languageType);
var __authorizations = global::OpenRouter.EndPointSecurityResolver.ResolveAuthorizations(
@@ -146,6 +218,11 @@ partial void ProcessGetRankingsDailyResponseContent(
__pathBuilder
.AddOptionalParameter("start_date", startDate)
.AddOptionalParameter("end_date", endDate)
+ .AddOptionalParameter("period", period?.ToValueString())
+ .AddOptionalParameter("modality", modality?.ToValueString())
+ .AddOptionalParameter("context_bucket", contextBucket?.ToValueString())
+ .AddOptionalParameter("category", category?.ToValueString())
+ .AddOptionalParameter("language_type", languageType?.ToValueString())
;
var __path = __pathBuilder.ToString();
__path = global::OpenRouter.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -188,7 +265,12 @@ partial void ProcessGetRankingsDailyResponseContent(
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
startDate: startDate,
- endDate: endDate);
+ endDate: endDate,
+ period: period,
+ modality: modality,
+ contextBucket: contextBucket,
+ category: category,
+ languageType: languageType);
return __httpRequest;
}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.EmbeddingsClient.ListEmbeddingsModels.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.EmbeddingsClient.ListEmbeddingsModels.g.cs
index 041b229c..ee9698b9 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.EmbeddingsClient.ListEmbeddingsModels.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.EmbeddingsClient.ListEmbeddingsModels.g.cs
@@ -26,10 +26,14 @@ public partial class EmbeddingsClient
{ s_ListEmbeddingsModelsSecurityRequirement0,
};
partial void PrepareListEmbeddingsModelsArguments(
- global::System.Net.Http.HttpClient httpClient);
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? offset,
+ ref int? limit);
partial void PrepareListEmbeddingsModelsRequest(
global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage);
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? offset,
+ int? limit);
partial void ProcessListEmbeddingsModelsResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);
@@ -43,14 +47,24 @@ partial void ProcessListEmbeddingsModelsResponseContent(
/// List all embeddings models
/// Returns a list of all available embeddings models and their properties
///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 500
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
public async global::System.Threading.Tasks.Task ListEmbeddingsModelsAsync(
+ int? offset = default,
+ int? limit = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __response = await ListEmbeddingsModelsAsResponseAsync(
+ offset: offset,
+ limit: limit,
requestOptions: requestOptions,
cancellationToken: cancellationToken
).ConfigureAwait(false);
@@ -61,17 +75,27 @@ partial void ProcessListEmbeddingsModelsResponseContent(
/// List all embeddings models
/// Returns a list of all available embeddings models and their properties
///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 500
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
public async global::System.Threading.Tasks.Task> ListEmbeddingsModelsAsResponseAsync(
+ int? offset = default,
+ int? limit = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
PrepareListEmbeddingsModelsArguments(
- httpClient: HttpClient);
+ httpClient: HttpClient,
+ offset: ref offset,
+ limit: ref limit);
var __authorizations = global::OpenRouter.EndPointSecurityResolver.ResolveAuthorizations(
@@ -99,6 +123,10 @@ partial void ProcessListEmbeddingsModelsResponseContent(
var __pathBuilder = new global::OpenRouter.PathBuilder(
path: "/embeddings/models",
baseUri: HttpClient.BaseAddress);
+ __pathBuilder
+ .AddOptionalParameter("offset", offset?.ToString())
+ .AddOptionalParameter("limit", limit?.ToString())
+ ;
var __path = __pathBuilder.ToString();
__path = global::OpenRouter.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -138,7 +166,9 @@ partial void ProcessListEmbeddingsModelsResponseContent(
request: __httpRequest);
PrepareListEmbeddingsModelsRequest(
httpClient: HttpClient,
- httpRequestMessage: __httpRequest);
+ httpRequestMessage: __httpRequest,
+ offset: offset,
+ limit: limit);
return __httpRequest;
}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.GenerationsClient.SubmitGenerationFeedback.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.GenerationsClient.SubmitGenerationFeedback.g.cs
new file mode 100644
index 00000000..8b908baf
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.GenerationsClient.SubmitGenerationFeedback.g.cs
@@ -0,0 +1,657 @@
+
+#nullable enable
+
+namespace OpenRouter
+{
+ public partial class GenerationsClient
+ {
+
+
+ private static readonly global::OpenRouter.EndPointSecurityRequirement s_SubmitGenerationFeedbackSecurityRequirement0 =
+ new global::OpenRouter.EndPointSecurityRequirement
+ {
+ Authorizations = new global::OpenRouter.EndPointAuthorizationRequirement[]
+ { new global::OpenRouter.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "Bearer",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::OpenRouter.EndPointSecurityRequirement[] s_SubmitGenerationFeedbackSecurityRequirements =
+ new global::OpenRouter.EndPointSecurityRequirement[]
+ { s_SubmitGenerationFeedbackSecurityRequirement0,
+ };
+ partial void PrepareSubmitGenerationFeedbackArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ global::OpenRouter.SubmitGenerationFeedbackRequest request);
+ partial void PrepareSubmitGenerationFeedbackRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ global::OpenRouter.SubmitGenerationFeedbackRequest request);
+ partial void ProcessSubmitGenerationFeedbackResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessSubmitGenerationFeedbackResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Submit feedback for a generation
+ /// Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task SubmitGenerationFeedbackAsync(
+
+ global::OpenRouter.SubmitGenerationFeedbackRequest request,
+ global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await SubmitGenerationFeedbackAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Submit feedback for a generation
+ /// Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> SubmitGenerationFeedbackAsResponseAsync(
+
+ global::OpenRouter.SubmitGenerationFeedbackRequest request,
+ global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ request = request ?? throw new global::System.ArgumentNullException(nameof(request));
+
+ PrepareArguments(
+ client: HttpClient);
+ PrepareSubmitGenerationFeedbackArguments(
+ httpClient: HttpClient,
+ request: request);
+
+
+ var __authorizations = global::OpenRouter.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_SubmitGenerationFeedbackSecurityRequirements,
+ operationName: "SubmitGenerationFeedbackAsync");
+
+ using var __timeoutCancellationTokenSource = global::OpenRouter.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::OpenRouter.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::OpenRouter.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::OpenRouter.PathBuilder(
+ path: "/generation/feedback",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::OpenRouter.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Post,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+ var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
+ var __httpRequestContent = new global::System.Net.Http.StringContent(
+ content: __httpRequestContentBody,
+ encoding: global::System.Text.Encoding.UTF8,
+ mediaType: "application/json");
+ __httpRequest.Content = __httpRequestContent;
+ global::OpenRouter.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareSubmitGenerationFeedbackRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::OpenRouter.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "SubmitGenerationFeedback",
+ methodName: "SubmitGenerationFeedbackAsync",
+ pathTemplate: "\"/generation/feedback\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::OpenRouter.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "SubmitGenerationFeedback",
+ methodName: "SubmitGenerationFeedbackAsync",
+ pathTemplate: "\"/generation/feedback\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::OpenRouter.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::OpenRouter.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "SubmitGenerationFeedback",
+ methodName: "SubmitGenerationFeedbackAsync",
+ pathTemplate: "\"/generation/feedback\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ __response.Dispose();
+ __response = null;
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessSubmitGenerationFeedbackResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "SubmitGenerationFeedback",
+ methodName: "SubmitGenerationFeedbackAsync",
+ pathTemplate: "\"/generation/feedback\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "SubmitGenerationFeedback",
+ methodName: "SubmitGenerationFeedbackAsync",
+ pathTemplate: "\"/generation/feedback\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Bad Request - Invalid request parameters or malformed input
+ if ((int)__response.StatusCode == 400)
+ {
+ string? __content_400 = null;
+ global::System.Exception? __exception_400 = null;
+ global::OpenRouter.BadRequestResponse? __value_400 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_400 = global::OpenRouter.BadRequestResponse.FromJson(__content_400, JsonSerializerContext);
+ }
+ else
+ {
+ __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_400 = global::OpenRouter.BadRequestResponse.FromJson(__content_400, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_400 = __ex;
+ }
+
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_400,
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Unauthorized - Authentication required or invalid credentials
+ if ((int)__response.StatusCode == 401)
+ {
+ string? __content_401 = null;
+ global::System.Exception? __exception_401 = null;
+ global::OpenRouter.UnauthorizedResponse? __value_401 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext);
+ }
+ else
+ {
+ __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_401 = __ex;
+ }
+
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_401,
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Not Found - Resource does not exist
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::OpenRouter.NotFoundResponse? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::OpenRouter.NotFoundResponse.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::OpenRouter.NotFoundResponse.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Too Many Requests - Rate limit exceeded
+ if ((int)__response.StatusCode == 429)
+ {
+ string? __content_429 = null;
+ global::System.Exception? __exception_429 = null;
+ global::OpenRouter.TooManyRequestsResponse? __value_429 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_429 = global::OpenRouter.TooManyRequestsResponse.FromJson(__content_429, JsonSerializerContext);
+ }
+ else
+ {
+ __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_429 = global::OpenRouter.TooManyRequestsResponse.FromJson(__content_429, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_429 = __ex;
+ }
+
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_429,
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Internal Server Error - Unexpected server error
+ if ((int)__response.StatusCode == 500)
+ {
+ string? __content_500 = null;
+ global::System.Exception? __exception_500 = null;
+ global::OpenRouter.InternalServerResponse? __value_500 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext);
+ }
+ else
+ {
+ __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_500 = __ex;
+ }
+
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_500,
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessSubmitGenerationFeedbackResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::OpenRouter.SubmitGenerationFeedbackResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::OpenRouter.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::OpenRouter.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::OpenRouter.SubmitGenerationFeedbackResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::OpenRouter.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::OpenRouter.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Submit feedback for a generation
+ /// Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ ///
+ ///
+ /// The category of feedback being reported
+ ///
+ ///
+ /// An optional free-text comment describing the feedback
+ ///
+ ///
+ /// The generation to submit feedback on
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task SubmitGenerationFeedbackAsync(
+ global::OpenRouter.SubmitGenerationFeedbackRequestCategory category,
+ string generationId,
+ string? comment = default,
+ global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __request = new global::OpenRouter.SubmitGenerationFeedbackRequest
+ {
+ Category = category,
+ Comment = comment,
+ GenerationId = generationId,
+ };
+
+ return await SubmitGenerationFeedbackAsync(
+ request: __request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.CreateGuardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.CreateGuardrail.g.cs
index 7748ea8a..85eb7df8 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.CreateGuardrail.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.CreateGuardrail.g.cs
@@ -592,7 +592,7 @@ partial void ProcessCreateGuardrailResponseContent(
/// List of allowed provider IDs
///
///
- /// Builtin content filters to apply. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only.
+ /// Builtin content filters to apply. Every builtin slug supports "block", "redact", and the detect-only "flag" action.
///
///
/// Custom regex content filters to apply to request messages
@@ -601,7 +601,7 @@ partial void ProcessCreateGuardrailResponseContent(
/// Description of the guardrail
///
///
- /// Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
+ /// Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
///
///
/// Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided.
@@ -613,7 +613,10 @@ partial void ProcessCreateGuardrailResponseContent(
/// Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided.
///
///
- /// Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided.
+ /// Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided.
+ ///
+ ///
+ /// Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided.
///
///
/// Array of model identifiers to exclude from routing (slug or canonical_slug accepted)
@@ -648,6 +651,7 @@ partial void ProcessCreateGuardrailResponseContent(
bool? enforceZdrGoogle = default,
bool? enforceZdrOpenai = default,
bool? enforceZdrOther = default,
+ bool? enforceZdrXai = default,
global::System.Collections.Generic.IList? ignoredModels = default,
global::System.Collections.Generic.IList? ignoredProviders = default,
double? limitUsd = default,
@@ -668,6 +672,7 @@ partial void ProcessCreateGuardrailResponseContent(
EnforceZdrGoogle = enforceZdrGoogle,
EnforceZdrOpenai = enforceZdrOpenai,
EnforceZdrOther = enforceZdrOther,
+ EnforceZdrXai = enforceZdrXai,
IgnoredModels = ignoredModels,
IgnoredProviders = ignoredProviders,
LimitUsd = limitUsd,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListGuardrailKeyAssignments.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListGuardrailKeyAssignments.g.cs
index dff8449f..82c9f2ff 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListGuardrailKeyAssignments.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListGuardrailKeyAssignments.g.cs
@@ -50,8 +50,12 @@ partial void ProcessListGuardrailKeyAssignmentsResponseContent(
/// List all API key assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -77,8 +81,12 @@ partial void ProcessListGuardrailKeyAssignmentsResponseContent(
/// List all API key assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListGuardrailMemberAssignments.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListGuardrailMemberAssignments.g.cs
index 800bb95d..db783110 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListGuardrailMemberAssignments.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListGuardrailMemberAssignments.g.cs
@@ -50,8 +50,12 @@ partial void ProcessListGuardrailMemberAssignmentsResponseContent(
/// List all organization member assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -77,8 +81,12 @@ partial void ProcessListGuardrailMemberAssignmentsResponseContent(
/// List all organization member assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListGuardrails.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListGuardrails.g.cs
index a88c26c0..f9adbab0 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListGuardrails.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListGuardrails.g.cs
@@ -49,8 +49,12 @@ partial void ProcessListGuardrailsResponseContent(
/// List guardrails
/// List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
@@ -76,8 +80,12 @@ partial void ProcessListGuardrailsResponseContent(
/// List guardrails
/// List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListKeyAssignments.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListKeyAssignments.g.cs
index abd0f0b1..f606aae7 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListKeyAssignments.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListKeyAssignments.g.cs
@@ -47,8 +47,12 @@ partial void ProcessListKeyAssignmentsResponseContent(
/// List all key assignments
/// List all API key guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -71,8 +75,12 @@ partial void ProcessListKeyAssignmentsResponseContent(
/// List all key assignments
/// List all API key guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListMemberAssignments.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListMemberAssignments.g.cs
index e20025bc..cbb470dc 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListMemberAssignments.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.ListMemberAssignments.g.cs
@@ -47,8 +47,12 @@ partial void ProcessListMemberAssignmentsResponseContent(
/// List all member assignments
/// List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -71,8 +75,12 @@ partial void ProcessListMemberAssignmentsResponseContent(
/// List all member assignments
/// List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.UpdateGuardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.UpdateGuardrail.g.cs
index 2e422b80..f054db7b 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.UpdateGuardrail.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.GuardrailsClient.UpdateGuardrail.g.cs
@@ -602,7 +602,7 @@ partial void ProcessUpdateGuardrailResponseContent(
/// New list of allowed provider IDs
///
///
- /// Builtin content filters to apply. Set to null to remove. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only.
+ /// Builtin content filters to apply. Set to null to remove. Every builtin slug supports "block", "redact", and the detect-only "flag" action.
///
///
/// Custom regex content filters to apply. Set to null to remove.
@@ -611,7 +611,7 @@ partial void ProcessUpdateGuardrailResponseContent(
/// New description for the guardrail
///
///
- /// Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
+ /// Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
///
///
/// Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided.
@@ -623,7 +623,10 @@ partial void ProcessUpdateGuardrailResponseContent(
/// Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided.
///
///
- /// Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided.
+ /// Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided.
+ ///
+ ///
+ /// Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided.
///
///
/// Array of model identifiers to exclude from routing (slug or canonical_slug accepted)
@@ -655,6 +658,7 @@ partial void ProcessUpdateGuardrailResponseContent(
bool? enforceZdrGoogle = default,
bool? enforceZdrOpenai = default,
bool? enforceZdrOther = default,
+ bool? enforceZdrXai = default,
global::System.Collections.Generic.IList? ignoredModels = default,
global::System.Collections.Generic.IList? ignoredProviders = default,
double? limitUsd = default,
@@ -675,6 +679,7 @@ partial void ProcessUpdateGuardrailResponseContent(
EnforceZdrGoogle = enforceZdrGoogle,
EnforceZdrOpenai = enforceZdrOpenai,
EnforceZdrOther = enforceZdrOther,
+ EnforceZdrXai = enforceZdrXai,
IgnoredModels = ignoredModels,
IgnoredProviders = ignoredProviders,
LimitUsd = limitUsd,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IAnthropicMessagesClient.CreateMessages.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IAnthropicMessagesClient.CreateMessages.g.cs
index ee576e17..e1f36a74 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IAnthropicMessagesClient.CreateMessages.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IAnthropicMessagesClient.CreateMessages.g.cs
@@ -46,7 +46,7 @@ public partial interface IAnthropicMessagesClient
/// Opt-in level for surfacing routing metadata on the response under `openrouter_metadata`.
///
///
- /// 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.
+ /// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
///
///
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IApiKeysClient.CreateKeys.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IApiKeysClient.CreateKeys.g.cs
index 0b332f23..34230d7b 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IApiKeysClient.CreateKeys.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IApiKeysClient.CreateKeys.g.cs
@@ -64,7 +64,7 @@ public partial interface IApiKeysClient
global::System.DateTime? expiresAt = default,
bool? includeByokInLimit = default,
double? limit = default,
- global::OpenRouter.OneOf? limitReset = default,
+ global::OpenRouter.KeysPostRequestBodyContentApplicationJsonSchemaLimitReset? limitReset = default,
global::System.Guid? workspaceId = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IApiKeysClient.UpdateKeys.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IApiKeysClient.UpdateKeys.g.cs
index 36d4b2cc..a1208130 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IApiKeysClient.UpdateKeys.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IApiKeysClient.UpdateKeys.g.cs
@@ -62,7 +62,7 @@ public partial interface IApiKeysClient
bool? disabled = default,
bool? includeByokInLimit = default,
double? limit = default,
- global::OpenRouter.OneOf? limitReset = default,
+ global::OpenRouter.KeysHashPatchRequestBodyContentApplicationJsonSchemaLimitReset? limitReset = default,
string? name = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IBetaAnalyticsClient.QueryAnalytics.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IBetaAnalyticsClient.QueryAnalytics.g.cs
index 4e80aea0..fb9ab50b 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IBetaAnalyticsClient.QueryAnalytics.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IBetaAnalyticsClient.QueryAnalytics.g.cs
@@ -34,6 +34,12 @@ public partial interface IBetaAnalyticsClient
/// Query analytics data
/// Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
+ ///
+ /// Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace.
+ ///
+ ///
+ /// Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions.
+ ///
///
///
///
@@ -53,6 +59,8 @@ public partial interface IBetaAnalyticsClient
///
global::System.Threading.Tasks.Task QueryAnalyticsAsync(
global::System.Collections.Generic.IList metrics,
+ global::OpenRouter.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierDimensions? classifierDimensions = default,
+ global::OpenRouter.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFilters? classifierFilters = default,
global::System.Collections.Generic.IList? dimensions = default,
global::System.Collections.Generic.IList? filters = default,
string? granularity = default,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IBetaResponsesClient.CreateResponses.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IBetaResponsesClient.CreateResponses.g.cs
index 5412c4c8..1b91a47b 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IBetaResponsesClient.CreateResponses.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IBetaResponsesClient.CreateResponses.g.cs
@@ -47,7 +47,7 @@ public partial interface IBetaResponsesClient
///
///
///
- /// 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.
+ /// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
///
///
/// Debug options for inspecting request transformations (streaming only)
@@ -74,9 +74,14 @@ public partial interface IBetaResponsesClient
/// Plugins you want to enable for this request, including their settings.
///
///
- ///
+ ///
+ /// Not supported. The Responses API is stateless: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead.
+ ///
///
///
+ ///
+ /// Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.
+ ///
///
/// When multiple model providers are available, optionally indicate your routing preference.
///
@@ -87,7 +92,9 @@ public partial interface IBetaResponsesClient
/// Any type
///
///
- ///
+ ///
+ /// Default Value: auto
+ ///
///
/// A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
///
@@ -136,14 +143,15 @@ public partial interface IBetaResponsesClient
bool? parallelToolCalls = default,
global::System.Collections.Generic.IList? plugins = default,
double? presencePenalty = default,
- string? previousResponseId = default,
+ object? previousResponseId = default,
global::OpenRouter.StoredPromptTemplate? prompt = default,
string? promptCacheKey = default,
+ global::OpenRouter.PromptCacheOptions? promptCacheOptions = default,
global::OpenRouter.ProviderPreferences? provider = default,
global::OpenRouter.ReasoningConfig? reasoning = default,
object? route = default,
string? safetyIdentifier = default,
- global::OpenRouter.OneOf? serviceTier = default,
+ global::OpenRouter.ResponsesRequestServiceTier? serviceTier = default,
string? sessionId = default,
global::System.Collections.Generic.IList? stopServerToolsWhen = default,
bool? store = default,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IByokClient.ListByokKeys.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IByokClient.ListByokKeys.g.cs
index e5b1d4bc..fd07f821 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IByokClient.ListByokKeys.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IByokClient.ListByokKeys.g.cs
@@ -8,8 +8,12 @@ public partial interface IByokClient
/// List BYOK provider credentials
/// List the bring-your-own-key (BYOK) provider credentials for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace, or the `provider` query parameter to filter by upstream provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
///
///
/// Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`).
@@ -28,8 +32,12 @@ public partial interface IByokClient
/// List BYOK provider credentials
/// List the bring-your-own-key (BYOK) provider credentials for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace, or the `provider` query parameter to filter by upstream provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
///
///
/// Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`).
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IChatClient.SendChatCompletionRequest.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IChatClient.SendChatCompletionRequest.g.cs
index b2ded56f..8650e68b 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IChatClient.SendChatCompletionRequest.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IChatClient.SendChatCompletionRequest.g.cs
@@ -46,7 +46,7 @@ public partial interface IChatClient
/// Opt-in level for surfacing routing metadata on the response under `openrouter_metadata`.
///
///
- /// 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.
+ /// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
///
///
/// Debug options for inspecting request transformations (streaming only)
@@ -91,9 +91,16 @@ public partial interface IChatClient
///
/// Plugins you want to enable for this request, including their settings.
///
+ ///
+ /// Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance.
+ ///
///
/// Presence penalty (-2.0 to 2.0)
///
+ ///
+ ///
+ /// Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.
+ ///
///
/// When multiple model providers are available, optionally indicate your routing preference.
///
@@ -182,17 +189,20 @@ public partial interface IChatClient
global::System.Collections.Generic.IList? models = default,
bool? parallelToolCalls = default,
global::System.Collections.Generic.IList? plugins = default,
+ global::OpenRouter.Prediction? prediction = default,
double? presencePenalty = default,
+ string? promptCacheKey = default,
+ global::OpenRouter.PromptCacheOptions? promptCacheOptions = default,
global::OpenRouter.ProviderPreferences? provider = default,
global::OpenRouter.ChatRequestReasoning? reasoning = default,
- global::OpenRouter.OneOf? reasoningEffort = default,
+ global::OpenRouter.ChatRequestReasoningEffort? reasoningEffort = default,
double? repetitionPenalty = default,
global::OpenRouter.ChatRequestResponseFormat? responseFormat = default,
object? route = default,
int? seed = default,
- global::OpenRouter.OneOf? serviceTier = default,
+ global::OpenRouter.ChatRequestServiceTier? serviceTier = default,
string? sessionId = default,
- global::OpenRouter.ChatRequestStop? stop = default,
+ global::OpenRouter.OneOf? stop = default,
global::System.Collections.Generic.IList? stopServerToolsWhen = default,
bool? stream = default,
global::OpenRouter.ChatStreamOptions? streamOptions = default,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IDatasetsClient.GetRankingsDaily.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IDatasetsClient.GetRankingsDaily.g.cs
index 7aaad27d..16b0044a 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IDatasetsClient.GetRankingsDaily.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IDatasetsClient.GetRankingsDaily.g.cs
@@ -13,6 +13,12 @@ public partial interface IDatasetsClient
/// Each row is a distinct `(date, model_permaslug)` pair. The `other` row uses the
/// reserved permaslug `other` and is always returned last within its date, so callers
/// can compute `top-50 traffic / total daily traffic` without a second request.
+ /// Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time
+ /// grain. `modality` and `context_bucket` narrow the exact dataset by output/input
+ /// modality (or tool-calling activity) and request context length. `category` and
+ /// `language_type` instead read a sampled, upsampled dataset whose `total_tokens` are
+ /// weekly-grain estimates — they cannot be combined with each other or with the exact
+ /// filters, and reject `period=day` with a 400.
/// Authenticate with any valid OpenRouter API key (same key used for inference).
/// Rate-limited to 30 requests/minute per key and 500 requests/day per account.
/// When republishing or quoting this dataset, OpenRouter must be cited as:
@@ -24,12 +30,32 @@ public partial interface IDatasetsClient
///
///
///
+ ///
+ /// Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries.
+ ///
+ ///
+ /// Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`.
+ ///
+ ///
+ /// Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`.
+ ///
+ ///
+ /// Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`.
+ ///
+ ///
+ /// Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`.
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
global::System.Threading.Tasks.Task GetRankingsDailyAsync(
string? startDate = default,
string? endDate = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersPeriod? period = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersModality? modality = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersContextBucket? contextBucket = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersCategory? category = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersLanguageType? languageType = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
///
@@ -41,6 +67,12 @@ public partial interface IDatasetsClient
/// Each row is a distinct `(date, model_permaslug)` pair. The `other` row uses the
/// reserved permaslug `other` and is always returned last within its date, so callers
/// can compute `top-50 traffic / total daily traffic` without a second request.
+ /// Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time
+ /// grain. `modality` and `context_bucket` narrow the exact dataset by output/input
+ /// modality (or tool-calling activity) and request context length. `category` and
+ /// `language_type` instead read a sampled, upsampled dataset whose `total_tokens` are
+ /// weekly-grain estimates — they cannot be combined with each other or with the exact
+ /// filters, and reject `period=day` with a 400.
/// Authenticate with any valid OpenRouter API key (same key used for inference).
/// Rate-limited to 30 requests/minute per key and 500 requests/day per account.
/// When republishing or quoting this dataset, OpenRouter must be cited as:
@@ -52,12 +84,32 @@ public partial interface IDatasetsClient
///
///
///
+ ///
+ /// Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries.
+ ///
+ ///
+ /// Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`.
+ ///
+ ///
+ /// Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`.
+ ///
+ ///
+ /// Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`.
+ ///
+ ///
+ /// Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`.
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
global::System.Threading.Tasks.Task> GetRankingsDailyAsResponseAsync(
string? startDate = default,
string? endDate = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersPeriod? period = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersModality? modality = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersContextBucket? contextBucket = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersCategory? category = default,
+ global::OpenRouter.DatasetsRankingsDailyGetParametersLanguageType? languageType = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IEmbeddingsClient.ListEmbeddingsModels.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IEmbeddingsClient.ListEmbeddingsModels.g.cs
index c28e9bb6..b5955421 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IEmbeddingsClient.ListEmbeddingsModels.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IEmbeddingsClient.ListEmbeddingsModels.g.cs
@@ -8,20 +8,36 @@ public partial interface IEmbeddingsClient
/// List all embeddings models
/// Returns a list of all available embeddings models and their properties
///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 500
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
global::System.Threading.Tasks.Task ListEmbeddingsModelsAsync(
+ int? offset = default,
+ int? limit = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
///
/// List all embeddings models
/// Returns a list of all available embeddings models and their properties
///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 500
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
global::System.Threading.Tasks.Task> ListEmbeddingsModelsAsResponseAsync(
+ int? offset = default,
+ int? limit = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IGenerationsClient.SubmitGenerationFeedback.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IGenerationsClient.SubmitGenerationFeedback.g.cs
new file mode 100644
index 00000000..ed9653e9
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IGenerationsClient.SubmitGenerationFeedback.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenRouter
+{
+ public partial interface IGenerationsClient
+ {
+ ///
+ /// Submit feedback for a generation
+ /// Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task SubmitGenerationFeedbackAsync(
+
+ global::OpenRouter.SubmitGenerationFeedbackRequest request,
+ global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Submit feedback for a generation
+ /// Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> SubmitGenerationFeedbackAsResponseAsync(
+
+ global::OpenRouter.SubmitGenerationFeedbackRequest request,
+ global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Submit feedback for a generation
+ /// Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ ///
+ ///
+ /// The category of feedback being reported
+ ///
+ ///
+ /// An optional free-text comment describing the feedback
+ ///
+ ///
+ /// The generation to submit feedback on
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task SubmitGenerationFeedbackAsync(
+ global::OpenRouter.SubmitGenerationFeedbackRequestCategory category,
+ string generationId,
+ string? comment = default,
+ global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.CreateGuardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.CreateGuardrail.g.cs
index 21b76f33..9816c2b3 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.CreateGuardrail.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.CreateGuardrail.g.cs
@@ -41,7 +41,7 @@ public partial interface IGuardrailsClient
/// List of allowed provider IDs
///
///
- /// Builtin content filters to apply. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only.
+ /// Builtin content filters to apply. Every builtin slug supports "block", "redact", and the detect-only "flag" action.
///
///
/// Custom regex content filters to apply to request messages
@@ -50,7 +50,7 @@ public partial interface IGuardrailsClient
/// Description of the guardrail
///
///
- /// Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
+ /// Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
///
///
/// Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided.
@@ -62,7 +62,10 @@ public partial interface IGuardrailsClient
/// Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided.
///
///
- /// Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided.
+ /// Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided.
+ ///
+ ///
+ /// Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided.
///
///
/// Array of model identifiers to exclude from routing (slug or canonical_slug accepted)
@@ -97,6 +100,7 @@ public partial interface IGuardrailsClient
bool? enforceZdrGoogle = default,
bool? enforceZdrOpenai = default,
bool? enforceZdrOther = default,
+ bool? enforceZdrXai = default,
global::System.Collections.Generic.IList? ignoredModels = default,
global::System.Collections.Generic.IList? ignoredProviders = default,
double? limitUsd = default,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListGuardrailKeyAssignments.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListGuardrailKeyAssignments.g.cs
index cd775758..39b22a56 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListGuardrailKeyAssignments.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListGuardrailKeyAssignments.g.cs
@@ -9,8 +9,12 @@ public partial interface IGuardrailsClient
/// List all API key assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -25,8 +29,12 @@ public partial interface IGuardrailsClient
/// List all API key assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListGuardrailMemberAssignments.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListGuardrailMemberAssignments.g.cs
index b2bbbf49..fd85ec83 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListGuardrailMemberAssignments.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListGuardrailMemberAssignments.g.cs
@@ -9,8 +9,12 @@ public partial interface IGuardrailsClient
/// List all organization member assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -25,8 +29,12 @@ public partial interface IGuardrailsClient
/// List all organization member assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListGuardrails.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListGuardrails.g.cs
index 817c303e..bf19f5ab 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListGuardrails.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListGuardrails.g.cs
@@ -8,8 +8,12 @@ public partial interface IGuardrailsClient
/// List guardrails
/// List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
@@ -24,8 +28,12 @@ public partial interface IGuardrailsClient
/// List guardrails
/// List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListKeyAssignments.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListKeyAssignments.g.cs
index b366d906..b14b7bc0 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListKeyAssignments.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListKeyAssignments.g.cs
@@ -8,8 +8,12 @@ public partial interface IGuardrailsClient
/// List all key assignments
/// List all API key guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -22,8 +26,12 @@ public partial interface IGuardrailsClient
/// List all key assignments
/// List all API key guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListMemberAssignments.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListMemberAssignments.g.cs
index fd2d7036..a491fed5 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListMemberAssignments.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.ListMemberAssignments.g.cs
@@ -8,8 +8,12 @@ public partial interface IGuardrailsClient
/// List all member assignments
/// List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -22,8 +26,12 @@ public partial interface IGuardrailsClient
/// List all member assignments
/// List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.UpdateGuardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.UpdateGuardrail.g.cs
index 4c6ace4e..732271b2 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.UpdateGuardrail.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IGuardrailsClient.UpdateGuardrail.g.cs
@@ -46,7 +46,7 @@ public partial interface IGuardrailsClient
/// New list of allowed provider IDs
///
///
- /// Builtin content filters to apply. Set to null to remove. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only.
+ /// Builtin content filters to apply. Set to null to remove. Every builtin slug supports "block", "redact", and the detect-only "flag" action.
///
///
/// Custom regex content filters to apply. Set to null to remove.
@@ -55,7 +55,7 @@ public partial interface IGuardrailsClient
/// New description for the guardrail
///
///
- /// Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
+ /// Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request.
///
///
/// Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided.
@@ -67,7 +67,10 @@ public partial interface IGuardrailsClient
/// Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided.
///
///
- /// Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided.
+ /// Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided.
+ ///
+ ///
+ /// Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided.
///
///
/// Array of model identifiers to exclude from routing (slug or canonical_slug accepted)
@@ -99,6 +102,7 @@ public partial interface IGuardrailsClient
bool? enforceZdrGoogle = default,
bool? enforceZdrOpenai = default,
bool? enforceZdrOther = default,
+ bool? enforceZdrXai = default,
global::System.Collections.Generic.IList? ignoredModels = default,
global::System.Collections.Generic.IList? ignoredProviders = default,
double? limitUsd = default,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IImagesClient.CreateImages.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IImagesClient.CreateImages.g.cs
index daaa9aaf..d61cc216 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IImagesClient.CreateImages.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IImagesClient.CreateImages.g.cs
@@ -59,7 +59,7 @@ public partial interface IImagesClient
/// Text description of the desired image
///
///
- /// Provider-specific passthrough configuration
+ /// Provider routing preferences and provider-specific passthrough configuration.
///
///
/// Rendering quality. Providers without a quality knob ignore this.
@@ -71,7 +71,7 @@ public partial interface IImagesClient
/// If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers.
///
///
- /// Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected.
+ /// Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400.
///
///
/// If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response.
@@ -88,7 +88,7 @@ public partial interface IImagesClient
int? n = default,
int? outputCompression = default,
global::OpenRouter.ImageGenerationRequestOutputFormat? outputFormat = default,
- global::OpenRouter.ImageGenerationRequestProvider? provider = default,
+ global::OpenRouter.ImageGenerationProviderPreferences? provider = default,
global::OpenRouter.ImageGenerationRequestQuality? quality = default,
global::OpenRouter.ImageGenerationRequestResolution? resolution = default,
int? seed = default,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IModelsClient.GetModels.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IModelsClient.GetModels.g.cs
index f8e05713..c8b2b8da 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IModelsClient.GetModels.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IModelsClient.GetModels.g.cs
@@ -7,13 +7,19 @@ public partial interface IModelsClient
///
/// List all models and their properties
///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 500
+ ///
///
/// Filter models by use case category
///
///
///
///
- /// Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
+ /// Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
///
///
///
@@ -34,10 +40,24 @@ public partial interface IModelsClient
///
/// Filter to models with endpoints in the given data region. Currently only "eu" is supported.
///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
global::System.Threading.Tasks.Task GetModelsAsync(
+ int? offset = default,
+ int? limit = default,
global::OpenRouter.ModelsGetParametersCategory? category = default,
string? supportedParameters = default,
string? outputModalities = default,
@@ -55,18 +75,36 @@ public partial interface IModelsClient
global::OpenRouter.ModelsGetParametersDistillable? distillable = default,
global::OpenRouter.ModelsGetParametersZdr? zdr = default,
global::OpenRouter.ModelsGetParametersRegion? region = default,
+ double? minOutputPrice = default,
+ double? maxOutputPrice = default,
+ int? minAgeDays = default,
+ int? maxAgeDays = default,
+ double? minIntelligenceIndex = default,
+ double? maxIntelligenceIndex = default,
+ double? minCodingIndex = default,
+ double? maxCodingIndex = default,
+ double? minAgenticIndex = default,
+ double? maxAgenticIndex = default,
+ double? minToolSuccessRate = default,
+ double? maxToolSuccessRate = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
///
/// List all models and their properties
///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 500
+ ///
///
/// Filter models by use case category
///
///
///
///
- /// Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
+ /// Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
///
///
///
@@ -87,10 +125,24 @@ public partial interface IModelsClient
///
/// Filter to models with endpoints in the given data region. Currently only "eu" is supported.
///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
global::System.Threading.Tasks.Task> GetModelsAsResponseAsync(
+ int? offset = default,
+ int? limit = default,
global::OpenRouter.ModelsGetParametersCategory? category = default,
string? supportedParameters = default,
string? outputModalities = default,
@@ -108,6 +160,18 @@ public partial interface IModelsClient
global::OpenRouter.ModelsGetParametersDistillable? distillable = default,
global::OpenRouter.ModelsGetParametersZdr? zdr = default,
global::OpenRouter.ModelsGetParametersRegion? region = default,
+ double? minOutputPrice = default,
+ double? maxOutputPrice = default,
+ int? minAgeDays = default,
+ int? maxAgeDays = default,
+ double? minIntelligenceIndex = default,
+ double? maxIntelligenceIndex = default,
+ double? minCodingIndex = default,
+ double? maxCodingIndex = default,
+ double? minAgenticIndex = default,
+ double? maxAgenticIndex = default,
+ double? minToolSuccessRate = default,
+ double? maxToolSuccessRate = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IModelsClient.ListModelsUser.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IModelsClient.ListModelsUser.g.cs
index d1329166..54209bf4 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IModelsClient.ListModelsUser.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IModelsClient.ListModelsUser.g.cs
@@ -8,20 +8,36 @@ public partial interface IModelsClient
/// List models filtered by user provider preferences, privacy settings, and guardrails
/// List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing).
///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 500
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
global::System.Threading.Tasks.Task ListModelsUserAsync(
+ int? offset = default,
+ int? limit = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
///
/// List models filtered by user provider preferences, privacy settings, and guardrails
/// List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing).
///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 500
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
global::System.Threading.Tasks.Task> ListModelsUserAsResponseAsync(
+ int? offset = default,
+ int? limit = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IOAuthClient.ExchangeAuthCodeForApiKey.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IOAuthClient.ExchangeAuthCodeForApiKey.g.cs
index 35bbb744..271b7566 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IOAuthClient.ExchangeAuthCodeForApiKey.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IOAuthClient.ExchangeAuthCodeForApiKey.g.cs
@@ -48,7 +48,7 @@ public partial interface IOAuthClient
///
global::System.Threading.Tasks.Task ExchangeAuthCodeForApiKeyAsync(
string code,
- global::OpenRouter.OneOf? codeChallengeMethod = default,
+ global::OpenRouter.AuthKeysPostRequestBodyContentApplicationJsonSchemaCodeChallengeMethod? codeChallengeMethod = default,
string? codeVerifier = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IObservabilityClient.CreateObservabilityDestination.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IObservabilityClient.CreateObservabilityDestination.g.cs
index 03e995b1..739ece37 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IObservabilityClient.CreateObservabilityDestination.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IObservabilityClient.CreateObservabilityDestination.g.cs
@@ -72,7 +72,7 @@ public partial interface IObservabilityClient
global::OpenRouter.CreateObservabilityDestinationRequestType type,
global::System.Collections.Generic.IList? apiKeyHashes = default,
bool? enabled = default,
- global::OpenRouter.ObservabilityFilterRulesConfig? filterRules = default,
+ global::OpenRouter.ObservabilityFilterRulesConfigNullable? filterRules = default,
bool? privacyMode = default,
double? samplingRate = default,
global::System.Guid? workspaceId = default,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IObservabilityClient.ListObservabilityDestinations.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IObservabilityClient.ListObservabilityDestinations.g.cs
index e7d6b2ac..09949aa6 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IObservabilityClient.ListObservabilityDestinations.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IObservabilityClient.ListObservabilityDestinations.g.cs
@@ -8,8 +8,12 @@ public partial interface IObservabilityClient
/// List observability destinations
/// List the observability destinations configured for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
@@ -24,8 +28,12 @@ public partial interface IObservabilityClient
/// List observability destinations
/// List the observability destinations configured for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IOrganizationClient.ListOrganizationMembers.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IOrganizationClient.ListOrganizationMembers.g.cs
index 05086679..ebf96f5f 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IOrganizationClient.ListOrganizationMembers.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IOrganizationClient.ListOrganizationMembers.g.cs
@@ -8,8 +8,12 @@ public partial interface IOrganizationClient
/// List organization members
/// List all members of the organization associated with the authenticated management key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -22,8 +26,12 @@ public partial interface IOrganizationClient
/// List organization members
/// List all members of the organization associated with the authenticated management key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.CreatePresetsChatCompletions.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.CreatePresetsChatCompletions.g.cs
index bbe2f6e9..a27982f7 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.CreatePresetsChatCompletions.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.CreatePresetsChatCompletions.g.cs
@@ -40,7 +40,7 @@ public partial interface IPresetsClient
///
///
///
- /// 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.
+ /// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
///
///
/// Debug options for inspecting request transformations (streaming only)
@@ -85,9 +85,16 @@ public partial interface IPresetsClient
///
/// Plugins you want to enable for this request, including their settings.
///
+ ///
+ /// Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance.
+ ///
///
/// Presence penalty (-2.0 to 2.0)
///
+ ///
+ ///
+ /// Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.
+ ///
///
/// When multiple model providers are available, optionally indicate your routing preference.
///
@@ -176,17 +183,20 @@ public partial interface IPresetsClient
global::System.Collections.Generic.IList? models = default,
bool? parallelToolCalls = default,
global::System.Collections.Generic.IList? plugins = default,
+ global::OpenRouter.Prediction? prediction = default,
double? presencePenalty = default,
+ string? promptCacheKey = default,
+ global::OpenRouter.PromptCacheOptions? promptCacheOptions = default,
global::OpenRouter.ProviderPreferences? provider = default,
global::OpenRouter.ChatRequestReasoning? reasoning = default,
- global::OpenRouter.OneOf? reasoningEffort = default,
+ global::OpenRouter.ChatRequestReasoningEffort? reasoningEffort = default,
double? repetitionPenalty = default,
global::OpenRouter.ChatRequestResponseFormat? responseFormat = default,
object? route = default,
int? seed = default,
- global::OpenRouter.OneOf? serviceTier = default,
+ global::OpenRouter.ChatRequestServiceTier? serviceTier = default,
string? sessionId = default,
- global::OpenRouter.ChatRequestStop? stop = default,
+ global::OpenRouter.OneOf? stop = default,
global::System.Collections.Generic.IList? stopServerToolsWhen = default,
bool? stream = default,
global::OpenRouter.ChatStreamOptions? streamOptions = default,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.CreatePresetsMessages.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.CreatePresetsMessages.g.cs
index 1e137441..185a4d7a 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.CreatePresetsMessages.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.CreatePresetsMessages.g.cs
@@ -40,7 +40,7 @@ public partial interface IPresetsClient
///
///
///
- /// 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.
+ /// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
///
///
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.CreatePresetsResponses.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.CreatePresetsResponses.g.cs
index 672b1ab0..0e29bd32 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.CreatePresetsResponses.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.CreatePresetsResponses.g.cs
@@ -41,7 +41,7 @@ public partial interface IPresetsClient
///
///
///
- /// 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.
+ /// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
///
///
/// Debug options for inspecting request transformations (streaming only)
@@ -68,9 +68,14 @@ public partial interface IPresetsClient
/// Plugins you want to enable for this request, including their settings.
///
///
- ///
+ ///
+ /// Not supported. The Responses API is stateless: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead.
+ ///
///
///
+ ///
+ /// Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.
+ ///
///
/// When multiple model providers are available, optionally indicate your routing preference.
///
@@ -81,7 +86,9 @@ public partial interface IPresetsClient
/// Any type
///
///
- ///
+ ///
+ /// Default Value: auto
+ ///
///
/// A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
///
@@ -130,14 +137,15 @@ public partial interface IPresetsClient
bool? parallelToolCalls = default,
global::System.Collections.Generic.IList? plugins = default,
double? presencePenalty = default,
- string? previousResponseId = default,
+ object? previousResponseId = default,
global::OpenRouter.StoredPromptTemplate? prompt = default,
string? promptCacheKey = default,
+ global::OpenRouter.PromptCacheOptions? promptCacheOptions = default,
global::OpenRouter.ProviderPreferences? provider = default,
global::OpenRouter.ReasoningConfig? reasoning = default,
object? route = default,
string? safetyIdentifier = default,
- global::OpenRouter.OneOf? serviceTier = default,
+ global::OpenRouter.ResponsesRequestServiceTier? serviceTier = default,
string? sessionId = default,
global::System.Collections.Generic.IList? stopServerToolsWhen = default,
bool? store = default,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.ListPresetVersions.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.ListPresetVersions.g.cs
index cd7fffb6..b8221872 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.ListPresetVersions.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.ListPresetVersions.g.cs
@@ -9,8 +9,12 @@ public partial interface IPresetsClient
/// Lists all versions of a preset, ordered by version number ascending (oldest first).
///
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -25,8 +29,12 @@ public partial interface IPresetsClient
/// Lists all versions of a preset, ordered by version number ascending (oldest first).
///
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.ListPresets.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.ListPresets.g.cs
index 679a0124..be1b6a91 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.ListPresets.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IPresetsClient.ListPresets.g.cs
@@ -8,8 +8,12 @@ public partial interface IPresetsClient
/// List presets
/// Lists all presets for the authenticated user, ordered by most recently updated first.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -22,8 +26,12 @@ public partial interface IPresetsClient
/// List presets
/// Lists all presets for the authenticated user, ordered by most recently updated first.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ISttClient.CreateAudioTranscriptions.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ISttClient.CreateAudioTranscriptions.g.cs
index 0ed08821..d3fd2405 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.ISttClient.CreateAudioTranscriptions.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.ISttClient.CreateAudioTranscriptions.g.cs
@@ -6,7 +6,7 @@ public partial interface ISttClient
{
///
/// Create transcription
- /// Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text.
+ /// Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.
///
///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
@@ -19,7 +19,7 @@ public partial interface ISttClient
global::System.Threading.CancellationToken cancellationToken = default);
///
/// Create transcription
- /// Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text.
+ /// Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.
///
///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
@@ -32,7 +32,7 @@ public partial interface ISttClient
global::System.Threading.CancellationToken cancellationToken = default);
///
/// Create transcription
- /// Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text.
+ /// Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.
///
///
/// Base64-encoded audio to transcribe
@@ -46,9 +46,15 @@ public partial interface ISttClient
///
/// Provider-specific passthrough configuration
///
+ ///
+ /// Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers.
+ ///
///
/// Sampling temperature for transcription
///
+ ///
+ /// Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json".
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -57,7 +63,9 @@ public partial interface ISttClient
string model,
string? language = default,
global::OpenRouter.SttRequestProvider? provider = default,
+ global::OpenRouter.SttRequestResponseFormat? responseFormat = default,
double? temperature = default,
+ global::System.Collections.Generic.IList? timestampGranularities = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IWorkspacesClient.BulkRemoveWorkspaceMembers.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IWorkspacesClient.BulkRemoveWorkspaceMembers.g.cs
index b243dbae..6d9a8ac3 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IWorkspacesClient.BulkRemoveWorkspaceMembers.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IWorkspacesClient.BulkRemoveWorkspaceMembers.g.cs
@@ -6,7 +6,7 @@ public partial interface IWorkspacesClient
{
///
/// Bulk remove members from a workspace
- /// Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ /// Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. SCIM-managed members cannot be removed; changes must be made in your identity provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
///
///
@@ -21,7 +21,7 @@ public partial interface IWorkspacesClient
global::System.Threading.CancellationToken cancellationToken = default);
///
/// Bulk remove members from a workspace
- /// Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ /// Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. SCIM-managed members cannot be removed; changes must be made in your identity provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
///
///
@@ -36,7 +36,7 @@ public partial interface IWorkspacesClient
global::System.Threading.CancellationToken cancellationToken = default);
///
/// Bulk remove members from a workspace
- /// Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ /// Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. SCIM-managed members cannot be removed; changes must be made in your identity provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
///
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IWorkspacesClient.ListWorkspaceMembers.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IWorkspacesClient.ListWorkspaceMembers.g.cs
new file mode 100644
index 00000000..98344b4b
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IWorkspacesClient.ListWorkspaceMembers.g.cs
@@ -0,0 +1,48 @@
+#nullable enable
+
+namespace OpenRouter
+{
+ public partial interface IWorkspacesClient
+ {
+ ///
+ /// List workspace members
+ /// List all members of a workspace. Returns paginated results. For the default workspace, returns all organization members (implicit membership). [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ ///
+ ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task ListWorkspaceMembersAsync(
+ string id,
+ int? offset = default,
+ int? limit = default,
+ global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// List workspace members
+ /// List all members of a workspace. Returns paginated results. For the default workspace, returns all organization members (implicit membership). [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ ///
+ ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> ListWorkspaceMembersAsResponseAsync(
+ string id,
+ int? offset = default,
+ int? limit = default,
+ global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IWorkspacesClient.ListWorkspaces.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IWorkspacesClient.ListWorkspaces.g.cs
index e0c3aed2..40290ffe 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.IWorkspacesClient.ListWorkspaces.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.IWorkspacesClient.ListWorkspaces.g.cs
@@ -8,8 +8,12 @@ public partial interface IWorkspacesClient
/// List workspaces
/// List all workspaces for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -22,8 +26,12 @@ public partial interface IWorkspacesClient
/// List workspaces
/// List all workspaces for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
///
- ///
- ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 50
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ImagesClient.CreateImages.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ImagesClient.CreateImages.g.cs
index 087e7bab..ce40d465 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.ImagesClient.CreateImages.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.ImagesClient.CreateImages.g.cs
@@ -522,6 +522,43 @@ partial void ProcessCreateImagesResponseContent(
h => h.Key,
h => h.Value));
}
+ // Payload Too Large - Request payload exceeds size limits
+ if ((int)__response.StatusCode == 413)
+ {
+ string? __content_413 = null;
+ global::System.Exception? __exception_413 = null;
+ global::OpenRouter.PayloadTooLargeResponse? __value_413 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_413 = global::OpenRouter.PayloadTooLargeResponse.FromJson(__content_413, JsonSerializerContext);
+ }
+ else
+ {
+ __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_413 = global::OpenRouter.PayloadTooLargeResponse.FromJson(__content_413, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_413 = __ex;
+ }
+
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_413 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_413,
+ responseBody: __content_413,
+ responseObject: __value_413,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
// Too Many Requests - Rate limit exceeded
if ((int)__response.StatusCode == 429)
{
@@ -758,7 +795,7 @@ partial void ProcessCreateImagesResponseContent(
/// Text description of the desired image
///
///
- /// Provider-specific passthrough configuration
+ /// Provider routing preferences and provider-specific passthrough configuration.
///
///
/// Rendering quality. Providers without a quality knob ignore this.
@@ -770,7 +807,7 @@ partial void ProcessCreateImagesResponseContent(
/// If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers.
///
///
- /// Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected.
+ /// Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400.
///
///
/// If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response.
@@ -787,7 +824,7 @@ partial void ProcessCreateImagesResponseContent(
int? n = default,
int? outputCompression = default,
global::OpenRouter.ImageGenerationRequestOutputFormat? outputFormat = default,
- global::OpenRouter.ImageGenerationRequestProvider? provider = default,
+ global::OpenRouter.ImageGenerationProviderPreferences? provider = default,
global::OpenRouter.ImageGenerationRequestQuality? quality = default,
global::OpenRouter.ImageGenerationRequestResolution? resolution = default,
int? seed = default,
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemRole.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemRole.g.cs
new file mode 100644
index 00000000..24a6ff16
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemRole.g.cs
@@ -0,0 +1,53 @@
+#nullable enable
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public sealed class AdditionalToolsItemRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AdditionalToolsItemRole 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.AdditionalToolsItemRoleExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenRouter.AdditionalToolsItemRole)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::OpenRouter.AdditionalToolsItemRole);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AdditionalToolsItemRole value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenRouter.AdditionalToolsItemRoleExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemRoleNullable.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemRoleNullable.g.cs
new file mode 100644
index 00000000..60854249
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemRoleNullable.g.cs
@@ -0,0 +1,60 @@
+#nullable enable
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public sealed class AdditionalToolsItemRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AdditionalToolsItemRole? 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.AdditionalToolsItemRoleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenRouter.AdditionalToolsItemRole)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::OpenRouter.AdditionalToolsItemRole?);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AdditionalToolsItemRole? 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.AdditionalToolsItemRoleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemToolsItems.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemToolsItems.g.cs
new file mode 100644
index 00000000..b7b48a13
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemToolsItems.g.cs
@@ -0,0 +1,1430 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public class AdditionalToolsItemToolsItemsJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AdditionalToolsItemToolsItems Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
+ var __rawJson = __jsonDocument.RootElement.GetRawText();
+ var __jsonProps = new global::System.Collections.Generic.HashSet();
+ if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
+ {
+ foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
+ {
+ __jsonProps.Add(__jsonProp.Name);
+ if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object)
+ {
+ foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject())
+ {
+ __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name);
+ }
+ }
+
+ }
+ }
+
+ var __score0 = 0;
+ if (__jsonProps.Contains("description")) __score0++;
+ if (__jsonProps.Contains("name")) __score0++;
+ if (__jsonProps.Contains("parameters")) __score0++;
+ if (__jsonProps.Contains("strict")) __score0++;
+ if (__jsonProps.Contains("type")) __score0++;
+ var __score1 = 0;
+ if (__jsonProps.Contains("engine")) __score1++;
+ if (__jsonProps.Contains("filters")) __score1++;
+ if (__jsonProps.Contains("filters.allowed_domains")) __score1++;
+ if (__jsonProps.Contains("filters.excluded_domains")) __score1++;
+ if (__jsonProps.Contains("max_results")) __score1++;
+ if (__jsonProps.Contains("search_context_size")) __score1++;
+ if (__jsonProps.Contains("type")) __score1++;
+ if (__jsonProps.Contains("user_location")) __score1++;
+ var __score2 = 0;
+ if (__jsonProps.Contains("engine")) __score2++;
+ if (__jsonProps.Contains("filters")) __score2++;
+ if (__jsonProps.Contains("filters.allowed_domains")) __score2++;
+ if (__jsonProps.Contains("filters.excluded_domains")) __score2++;
+ if (__jsonProps.Contains("max_results")) __score2++;
+ if (__jsonProps.Contains("search_context_size")) __score2++;
+ if (__jsonProps.Contains("type")) __score2++;
+ if (__jsonProps.Contains("user_location")) __score2++;
+ var __score3 = 0;
+ if (__jsonProps.Contains("engine")) __score3++;
+ if (__jsonProps.Contains("filters")) __score3++;
+ if (__jsonProps.Contains("filters.allowed_domains")) __score3++;
+ if (__jsonProps.Contains("filters.excluded_domains")) __score3++;
+ if (__jsonProps.Contains("max_results")) __score3++;
+ if (__jsonProps.Contains("search_context_size")) __score3++;
+ if (__jsonProps.Contains("type")) __score3++;
+ if (__jsonProps.Contains("user_location")) __score3++;
+ if (__jsonProps.Contains("user_location.city")) __score3++;
+ if (__jsonProps.Contains("user_location.country")) __score3++;
+ if (__jsonProps.Contains("user_location.region")) __score3++;
+ if (__jsonProps.Contains("user_location.timezone")) __score3++;
+ if (__jsonProps.Contains("user_location.type")) __score3++;
+ var __score4 = 0;
+ if (__jsonProps.Contains("engine")) __score4++;
+ if (__jsonProps.Contains("filters")) __score4++;
+ if (__jsonProps.Contains("filters.allowed_domains")) __score4++;
+ if (__jsonProps.Contains("filters.excluded_domains")) __score4++;
+ if (__jsonProps.Contains("max_results")) __score4++;
+ if (__jsonProps.Contains("search_context_size")) __score4++;
+ if (__jsonProps.Contains("type")) __score4++;
+ if (__jsonProps.Contains("user_location")) __score4++;
+ if (__jsonProps.Contains("user_location.city")) __score4++;
+ if (__jsonProps.Contains("user_location.country")) __score4++;
+ if (__jsonProps.Contains("user_location.region")) __score4++;
+ if (__jsonProps.Contains("user_location.timezone")) __score4++;
+ if (__jsonProps.Contains("user_location.type")) __score4++;
+ var __score5 = 0;
+ if (__jsonProps.Contains("filters")) __score5++;
+ if (__jsonProps.Contains("max_num_results")) __score5++;
+ if (__jsonProps.Contains("ranking_options")) __score5++;
+ if (__jsonProps.Contains("ranking_options.ranker")) __score5++;
+ if (__jsonProps.Contains("ranking_options.score_threshold")) __score5++;
+ if (__jsonProps.Contains("type")) __score5++;
+ if (__jsonProps.Contains("vector_store_ids")) __score5++;
+ var __score6 = 0;
+ if (__jsonProps.Contains("display_height")) __score6++;
+ if (__jsonProps.Contains("display_width")) __score6++;
+ if (__jsonProps.Contains("environment")) __score6++;
+ if (__jsonProps.Contains("type")) __score6++;
+ var __score7 = 0;
+ if (__jsonProps.Contains("container")) __score7++;
+ if (__jsonProps.Contains("type")) __score7++;
+ var __score8 = 0;
+ if (__jsonProps.Contains("allowed_tools")) __score8++;
+ if (__jsonProps.Contains("authorization")) __score8++;
+ if (__jsonProps.Contains("connector_id")) __score8++;
+ if (__jsonProps.Contains("headers")) __score8++;
+ if (__jsonProps.Contains("require_approval")) __score8++;
+ if (__jsonProps.Contains("server_description")) __score8++;
+ if (__jsonProps.Contains("server_label")) __score8++;
+ if (__jsonProps.Contains("server_url")) __score8++;
+ if (__jsonProps.Contains("type")) __score8++;
+ var __score9 = 0;
+ if (__jsonProps.Contains("background")) __score9++;
+ if (__jsonProps.Contains("input_fidelity")) __score9++;
+ if (__jsonProps.Contains("input_image_mask")) __score9++;
+ if (__jsonProps.Contains("input_image_mask.file_id")) __score9++;
+ if (__jsonProps.Contains("input_image_mask.image_url")) __score9++;
+ if (__jsonProps.Contains("model")) __score9++;
+ if (__jsonProps.Contains("moderation")) __score9++;
+ if (__jsonProps.Contains("output_compression")) __score9++;
+ if (__jsonProps.Contains("output_format")) __score9++;
+ if (__jsonProps.Contains("partial_images")) __score9++;
+ if (__jsonProps.Contains("quality")) __score9++;
+ if (__jsonProps.Contains("size")) __score9++;
+ if (__jsonProps.Contains("type")) __score9++;
+ var __score10 = 0;
+ if (__jsonProps.Contains("type")) __score10++;
+ var __score11 = 0;
+ if (__jsonProps.Contains("type")) __score11++;
+ var __score12 = 0;
+ if (__jsonProps.Contains("type")) __score12++;
+ var __score13 = 0;
+ if (__jsonProps.Contains("description")) __score13++;
+ if (__jsonProps.Contains("format")) __score13++;
+ if (__jsonProps.Contains("name")) __score13++;
+ if (__jsonProps.Contains("type")) __score13++;
+ var __score14 = 0;
+ if (__jsonProps.Contains("description")) __score14++;
+ if (__jsonProps.Contains("name")) __score14++;
+ if (__jsonProps.Contains("tools")) __score14++;
+ if (__jsonProps.Contains("type")) __score14++;
+ var __score15 = 0;
+ if (__jsonProps.Contains("parameters")) __score15++;
+ if (__jsonProps.Contains("parameters.forward_transcript")) __score15++;
+ if (__jsonProps.Contains("parameters.instructions")) __score15++;
+ if (__jsonProps.Contains("parameters.max_completion_tokens")) __score15++;
+ if (__jsonProps.Contains("parameters.max_tool_calls")) __score15++;
+ if (__jsonProps.Contains("parameters.model")) __score15++;
+ if (__jsonProps.Contains("parameters.name")) __score15++;
+ if (__jsonProps.Contains("parameters.reasoning")) __score15++;
+ if (__jsonProps.Contains("parameters.stream")) __score15++;
+ if (__jsonProps.Contains("parameters.temperature")) __score15++;
+ if (__jsonProps.Contains("parameters.tools")) __score15++;
+ if (__jsonProps.Contains("type")) __score15++;
+ var __score16 = 0;
+ if (__jsonProps.Contains("parameters")) __score16++;
+ if (__jsonProps.Contains("parameters.instructions")) __score16++;
+ if (__jsonProps.Contains("parameters.max_completion_tokens")) __score16++;
+ if (__jsonProps.Contains("parameters.max_tool_calls")) __score16++;
+ if (__jsonProps.Contains("parameters.model")) __score16++;
+ if (__jsonProps.Contains("parameters.reasoning")) __score16++;
+ if (__jsonProps.Contains("parameters.temperature")) __score16++;
+ if (__jsonProps.Contains("parameters.tools")) __score16++;
+ if (__jsonProps.Contains("type")) __score16++;
+ var __score17 = 0;
+ if (__jsonProps.Contains("parameters")) __score17++;
+ if (__jsonProps.Contains("parameters.timezone")) __score17++;
+ if (__jsonProps.Contains("type")) __score17++;
+ var __score18 = 0;
+ if (__jsonProps.Contains("parameters")) __score18++;
+ if (__jsonProps.Contains("type")) __score18++;
+ var __score19 = 0;
+ if (__jsonProps.Contains("parameters")) __score19++;
+ if (__jsonProps.Contains("parameters.analysis_models")) __score19++;
+ if (__jsonProps.Contains("parameters.cache_control")) __score19++;
+ if (__jsonProps.Contains("parameters.max_completion_tokens")) __score19++;
+ if (__jsonProps.Contains("parameters.max_tool_calls")) __score19++;
+ if (__jsonProps.Contains("parameters.model")) __score19++;
+ if (__jsonProps.Contains("parameters.reasoning")) __score19++;
+ if (__jsonProps.Contains("parameters.temperature")) __score19++;
+ if (__jsonProps.Contains("parameters.tools")) __score19++;
+ if (__jsonProps.Contains("type")) __score19++;
+ var __score20 = 0;
+ if (__jsonProps.Contains("parameters")) __score20++;
+ if (__jsonProps.Contains("parameters.model")) __score20++;
+ if (__jsonProps.Contains("type")) __score20++;
+ var __score21 = 0;
+ if (__jsonProps.Contains("parameters")) __score21++;
+ if (__jsonProps.Contains("parameters.max_results")) __score21++;
+ if (__jsonProps.Contains("type")) __score21++;
+ var __score22 = 0;
+ if (__jsonProps.Contains("parameters")) __score22++;
+ if (__jsonProps.Contains("parameters.allowed_domains")) __score22++;
+ if (__jsonProps.Contains("parameters.blocked_domains")) __score22++;
+ if (__jsonProps.Contains("parameters.engine")) __score22++;
+ if (__jsonProps.Contains("parameters.max_content_tokens")) __score22++;
+ if (__jsonProps.Contains("parameters.max_uses")) __score22++;
+ if (__jsonProps.Contains("type")) __score22++;
+ var __score23 = 0;
+ if (__jsonProps.Contains("parameters")) __score23++;
+ if (__jsonProps.Contains("parameters.allowed_domains")) __score23++;
+ if (__jsonProps.Contains("parameters.engine")) __score23++;
+ if (__jsonProps.Contains("parameters.excluded_domains")) __score23++;
+ if (__jsonProps.Contains("parameters.max_characters")) __score23++;
+ if (__jsonProps.Contains("parameters.max_results")) __score23++;
+ if (__jsonProps.Contains("parameters.max_total_results")) __score23++;
+ if (__jsonProps.Contains("parameters.search_context_size")) __score23++;
+ if (__jsonProps.Contains("parameters.user_location")) __score23++;
+ if (__jsonProps.Contains("type")) __score23++;
+ var __score24 = 0;
+ if (__jsonProps.Contains("parameters")) __score24++;
+ if (__jsonProps.Contains("parameters.engine")) __score24++;
+ if (__jsonProps.Contains("type")) __score24++;
+ var __score25 = 0;
+ if (__jsonProps.Contains("parameters")) __score25++;
+ if (__jsonProps.Contains("parameters.engine")) __score25++;
+ if (__jsonProps.Contains("parameters.environment")) __score25++;
+ if (__jsonProps.Contains("parameters.sleep_after_seconds")) __score25++;
+ if (__jsonProps.Contains("type")) __score25++;
+ var __score26 = 0;
+ if (__jsonProps.Contains("parameters")) __score26++;
+ if (__jsonProps.Contains("parameters.engine")) __score26++;
+ if (__jsonProps.Contains("parameters.environment")) __score26++;
+ if (__jsonProps.Contains("parameters.sleep_after_seconds")) __score26++;
+ if (__jsonProps.Contains("type")) __score26++;
+ var __score27 = 0;
+ if (__jsonProps.Contains("type")) __score27++;
+ var __bestScore = 0;
+ var __bestIndex = -1;
+ if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
+ if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
+ if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; }
+ if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; }
+ if (__score4 > __bestScore) { __bestScore = __score4; __bestIndex = 4; }
+ if (__score5 > __bestScore) { __bestScore = __score5; __bestIndex = 5; }
+ if (__score6 > __bestScore) { __bestScore = __score6; __bestIndex = 6; }
+ if (__score7 > __bestScore) { __bestScore = __score7; __bestIndex = 7; }
+ if (__score8 > __bestScore) { __bestScore = __score8; __bestIndex = 8; }
+ if (__score9 > __bestScore) { __bestScore = __score9; __bestIndex = 9; }
+ if (__score10 > __bestScore) { __bestScore = __score10; __bestIndex = 10; }
+ if (__score11 > __bestScore) { __bestScore = __score11; __bestIndex = 11; }
+ if (__score12 > __bestScore) { __bestScore = __score12; __bestIndex = 12; }
+ if (__score13 > __bestScore) { __bestScore = __score13; __bestIndex = 13; }
+ if (__score14 > __bestScore) { __bestScore = __score14; __bestIndex = 14; }
+ if (__score15 > __bestScore) { __bestScore = __score15; __bestIndex = 15; }
+ if (__score16 > __bestScore) { __bestScore = __score16; __bestIndex = 16; }
+ if (__score17 > __bestScore) { __bestScore = __score17; __bestIndex = 17; }
+ if (__score18 > __bestScore) { __bestScore = __score18; __bestIndex = 18; }
+ if (__score19 > __bestScore) { __bestScore = __score19; __bestIndex = 19; }
+ if (__score20 > __bestScore) { __bestScore = __score20; __bestIndex = 20; }
+ if (__score21 > __bestScore) { __bestScore = __score21; __bestIndex = 21; }
+ if (__score22 > __bestScore) { __bestScore = __score22; __bestIndex = 22; }
+ if (__score23 > __bestScore) { __bestScore = __score23; __bestIndex = 23; }
+ if (__score24 > __bestScore) { __bestScore = __score24; __bestIndex = 24; }
+ if (__score25 > __bestScore) { __bestScore = __score25; __bestIndex = 25; }
+ if (__score26 > __bestScore) { __bestScore = __score26; __bestIndex = 26; }
+ if (__score27 > __bestScore) { __bestScore = __score27; __bestIndex = 27; }
+
+ global::OpenRouter.AdditionalToolsItemToolsItems0? additionalToolsItemToolsItems0 = default;
+ global::OpenRouter.PreviewWebSearchServerTool? previewWebSearchServerTool = default;
+ global::OpenRouter.Preview20250311WebSearchServerTool? preview20250311WebSearchServerTool = default;
+ global::OpenRouter.LegacyWebSearchServerTool? legacyWebSearchServerTool = default;
+ global::OpenRouter.WebSearchServerTool? webSearchServerTool = default;
+ global::OpenRouter.FileSearchServerTool? fileSearchServerTool = default;
+ global::OpenRouter.ComputerUseServerTool? computerUseServerTool = default;
+ global::OpenRouter.CodeInterpreterServerTool? codeInterpreterServerTool = default;
+ global::OpenRouter.McpServerTool? mcpServerTool = default;
+ global::OpenRouter.ImageGenerationServerTool? imageGenerationServerTool = default;
+ global::OpenRouter.CodexLocalShellTool? codexLocalShellTool = default;
+ global::OpenRouter.ShellServerTool? shellServerTool = default;
+ global::OpenRouter.ApplyPatchServerTool? applyPatchServerTool = default;
+ global::OpenRouter.CustomTool? customTool = default;
+ global::OpenRouter.NamespaceTool? namespaceTool = default;
+ global::OpenRouter.AdvisorServerToolOpenRouter? advisorServerToolOpenRouter = default;
+ global::OpenRouter.SubagentServerToolOpenRouter? subagentServerToolOpenRouter = default;
+ global::OpenRouter.DatetimeServerTool? datetimeServerTool = default;
+ global::OpenRouter.FilesServerTool? filesServerTool = default;
+ global::OpenRouter.FusionServerToolOpenRouter? fusionServerToolOpenRouter = default;
+ global::OpenRouter.ImageGenerationServerToolOpenRouter? imageGenerationServerToolOpenRouter = default;
+ global::OpenRouter.SearchModelsServerToolOpenRouter? searchModelsServerToolOpenRouter = default;
+ global::OpenRouter.WebFetchServerTool? webFetchServerTool = default;
+ global::OpenRouter.WebSearchServerToolOpenRouter? webSearchServerToolOpenRouter = default;
+ global::OpenRouter.ApplyPatchServerToolOpenRouter? applyPatchServerToolOpenRouter = default;
+ global::OpenRouter.BashServerTool? bashServerTool = default;
+ global::OpenRouter.ShellServerToolOpenRouter? shellServerToolOpenRouter = default;
+ global::OpenRouter.AdditionalToolsItemToolsItems27? additionalToolsItemToolsItems27 = default;
+ if (__bestIndex >= 0)
+ {
+ if (__bestIndex == 0)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AdditionalToolsItemToolsItems0), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AdditionalToolsItemToolsItems0).Name}");
+ additionalToolsItemToolsItems0 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 1)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.PreviewWebSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.PreviewWebSearchServerTool).Name}");
+ previewWebSearchServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 2)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.Preview20250311WebSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.Preview20250311WebSearchServerTool).Name}");
+ preview20250311WebSearchServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 3)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.LegacyWebSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.LegacyWebSearchServerTool).Name}");
+ legacyWebSearchServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 4)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.WebSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.WebSearchServerTool).Name}");
+ webSearchServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 5)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.FileSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.FileSearchServerTool).Name}");
+ fileSearchServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 6)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ComputerUseServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ComputerUseServerTool).Name}");
+ computerUseServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 7)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.CodeInterpreterServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.CodeInterpreterServerTool).Name}");
+ codeInterpreterServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 8)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.McpServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.McpServerTool).Name}");
+ mcpServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 9)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ImageGenerationServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ImageGenerationServerTool).Name}");
+ imageGenerationServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 10)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.CodexLocalShellTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.CodexLocalShellTool).Name}");
+ codexLocalShellTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 11)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ShellServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ShellServerTool).Name}");
+ shellServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 12)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ApplyPatchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ApplyPatchServerTool).Name}");
+ applyPatchServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 13)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.CustomTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.CustomTool).Name}");
+ customTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 14)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.NamespaceTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.NamespaceTool).Name}");
+ namespaceTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 15)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AdvisorServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AdvisorServerToolOpenRouter).Name}");
+ advisorServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 16)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.SubagentServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.SubagentServerToolOpenRouter).Name}");
+ subagentServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 17)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.DatetimeServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.DatetimeServerTool).Name}");
+ datetimeServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 18)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.FilesServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.FilesServerTool).Name}");
+ filesServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 19)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.FusionServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.FusionServerToolOpenRouter).Name}");
+ fusionServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 20)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ImageGenerationServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ImageGenerationServerToolOpenRouter).Name}");
+ imageGenerationServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 21)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.SearchModelsServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.SearchModelsServerToolOpenRouter).Name}");
+ searchModelsServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 22)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.WebFetchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.WebFetchServerTool).Name}");
+ webFetchServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 23)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.WebSearchServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.WebSearchServerToolOpenRouter).Name}");
+ webSearchServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 24)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ApplyPatchServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ApplyPatchServerToolOpenRouter).Name}");
+ applyPatchServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 25)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.BashServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.BashServerTool).Name}");
+ bashServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 26)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ShellServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ShellServerToolOpenRouter).Name}");
+ shellServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 27)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AdditionalToolsItemToolsItems27), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AdditionalToolsItemToolsItems27).Name}");
+ additionalToolsItemToolsItems27 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AdditionalToolsItemToolsItems0), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AdditionalToolsItemToolsItems0).Name}");
+ additionalToolsItemToolsItems0 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.PreviewWebSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.PreviewWebSearchServerTool).Name}");
+ previewWebSearchServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.Preview20250311WebSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.Preview20250311WebSearchServerTool).Name}");
+ preview20250311WebSearchServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.LegacyWebSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.LegacyWebSearchServerTool).Name}");
+ legacyWebSearchServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.WebSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.WebSearchServerTool).Name}");
+ webSearchServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.FileSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.FileSearchServerTool).Name}");
+ fileSearchServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ComputerUseServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ComputerUseServerTool).Name}");
+ computerUseServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.CodeInterpreterServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.CodeInterpreterServerTool).Name}");
+ codeInterpreterServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.McpServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.McpServerTool).Name}");
+ mcpServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ImageGenerationServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ImageGenerationServerTool).Name}");
+ imageGenerationServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.CodexLocalShellTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.CodexLocalShellTool).Name}");
+ codexLocalShellTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ShellServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ShellServerTool).Name}");
+ shellServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ApplyPatchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ApplyPatchServerTool).Name}");
+ applyPatchServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.CustomTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.CustomTool).Name}");
+ customTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.NamespaceTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.NamespaceTool).Name}");
+ namespaceTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AdvisorServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AdvisorServerToolOpenRouter).Name}");
+ advisorServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.SubagentServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.SubagentServerToolOpenRouter).Name}");
+ subagentServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.DatetimeServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.DatetimeServerTool).Name}");
+ datetimeServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.FilesServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.FilesServerTool).Name}");
+ filesServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.FusionServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.FusionServerToolOpenRouter).Name}");
+ fusionServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ImageGenerationServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ImageGenerationServerToolOpenRouter).Name}");
+ imageGenerationServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.SearchModelsServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.SearchModelsServerToolOpenRouter).Name}");
+ searchModelsServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.WebFetchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.WebFetchServerTool).Name}");
+ webFetchServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.WebSearchServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.WebSearchServerToolOpenRouter).Name}");
+ webSearchServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ApplyPatchServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ApplyPatchServerToolOpenRouter).Name}");
+ applyPatchServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.BashServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.BashServerTool).Name}");
+ bashServerTool = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ShellServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ShellServerToolOpenRouter).Name}");
+ shellServerToolOpenRouter = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (additionalToolsItemToolsItems0 == null && previewWebSearchServerTool == null && preview20250311WebSearchServerTool == null && legacyWebSearchServerTool == null && webSearchServerTool == null && fileSearchServerTool == null && computerUseServerTool == null && codeInterpreterServerTool == null && mcpServerTool == null && imageGenerationServerTool == null && codexLocalShellTool == null && shellServerTool == null && applyPatchServerTool == null && customTool == null && namespaceTool == null && advisorServerToolOpenRouter == null && subagentServerToolOpenRouter == null && datetimeServerTool == null && filesServerTool == null && fusionServerToolOpenRouter == null && imageGenerationServerToolOpenRouter == null && searchModelsServerToolOpenRouter == null && webFetchServerTool == null && webSearchServerToolOpenRouter == null && applyPatchServerToolOpenRouter == null && bashServerTool == null && shellServerToolOpenRouter == null && additionalToolsItemToolsItems27 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AdditionalToolsItemToolsItems27), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AdditionalToolsItemToolsItems27).Name}");
+ additionalToolsItemToolsItems27 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ var __value = new global::OpenRouter.AdditionalToolsItemToolsItems(
+ additionalToolsItemToolsItems0,
+
+ previewWebSearchServerTool,
+
+ preview20250311WebSearchServerTool,
+
+ legacyWebSearchServerTool,
+
+ webSearchServerTool,
+
+ fileSearchServerTool,
+
+ computerUseServerTool,
+
+ codeInterpreterServerTool,
+
+ mcpServerTool,
+
+ imageGenerationServerTool,
+
+ codexLocalShellTool,
+
+ shellServerTool,
+
+ applyPatchServerTool,
+
+ customTool,
+
+ namespaceTool,
+
+ advisorServerToolOpenRouter,
+
+ subagentServerToolOpenRouter,
+
+ datetimeServerTool,
+
+ filesServerTool,
+
+ fusionServerToolOpenRouter,
+
+ imageGenerationServerToolOpenRouter,
+
+ searchModelsServerToolOpenRouter,
+
+ webFetchServerTool,
+
+ webSearchServerToolOpenRouter,
+
+ applyPatchServerToolOpenRouter,
+
+ bashServerTool,
+
+ shellServerToolOpenRouter,
+
+ additionalToolsItemToolsItems27
+ );
+
+ return __value;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AdditionalToolsItemToolsItems value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsAdditionalToolsItemToolsItems0)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AdditionalToolsItemToolsItems0), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AdditionalToolsItemToolsItems0).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.AdditionalToolsItemToolsItems0!, typeInfo);
+ }
+ else if (value.IsPreviewWebSearchServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.PreviewWebSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.PreviewWebSearchServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.PreviewWebSearchServerTool!, typeInfo);
+ }
+ else if (value.IsPreview20250311WebSearchServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.Preview20250311WebSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.Preview20250311WebSearchServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Preview20250311WebSearchServerTool!, typeInfo);
+ }
+ else if (value.IsLegacyWebSearchServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.LegacyWebSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.LegacyWebSearchServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.LegacyWebSearchServerTool!, typeInfo);
+ }
+ else if (value.IsWebSearchServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.WebSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.WebSearchServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.WebSearchServerTool!, typeInfo);
+ }
+ else if (value.IsFileSearchServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.FileSearchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.FileSearchServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.FileSearchServerTool!, typeInfo);
+ }
+ else if (value.IsComputerUseServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ComputerUseServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ComputerUseServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.ComputerUseServerTool!, typeInfo);
+ }
+ else if (value.IsCodeInterpreterServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.CodeInterpreterServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.CodeInterpreterServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.CodeInterpreterServerTool!, typeInfo);
+ }
+ else if (value.IsMcpServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.McpServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.McpServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.McpServerTool!, typeInfo);
+ }
+ else if (value.IsImageGenerationServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ImageGenerationServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ImageGenerationServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.ImageGenerationServerTool!, typeInfo);
+ }
+ else if (value.IsCodexLocalShellTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.CodexLocalShellTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.CodexLocalShellTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.CodexLocalShellTool!, typeInfo);
+ }
+ else if (value.IsShellServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ShellServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ShellServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.ShellServerTool!, typeInfo);
+ }
+ else if (value.IsApplyPatchServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ApplyPatchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ApplyPatchServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.ApplyPatchServerTool!, typeInfo);
+ }
+ else if (value.IsCustomTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.CustomTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.CustomTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.CustomTool!, typeInfo);
+ }
+ else if (value.IsNamespaceTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.NamespaceTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.NamespaceTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.NamespaceTool!, typeInfo);
+ }
+ else if (value.IsAdvisorServerToolOpenRouter)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AdvisorServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AdvisorServerToolOpenRouter).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.AdvisorServerToolOpenRouter!, typeInfo);
+ }
+ else if (value.IsSubagentServerToolOpenRouter)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.SubagentServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.SubagentServerToolOpenRouter).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.SubagentServerToolOpenRouter!, typeInfo);
+ }
+ else if (value.IsDatetimeServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.DatetimeServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.DatetimeServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.DatetimeServerTool!, typeInfo);
+ }
+ else if (value.IsFilesServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.FilesServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.FilesServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.FilesServerTool!, typeInfo);
+ }
+ else if (value.IsFusionServerToolOpenRouter)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.FusionServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.FusionServerToolOpenRouter).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.FusionServerToolOpenRouter!, typeInfo);
+ }
+ else if (value.IsImageGenerationServerToolOpenRouter)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ImageGenerationServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ImageGenerationServerToolOpenRouter).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.ImageGenerationServerToolOpenRouter!, typeInfo);
+ }
+ else if (value.IsSearchModelsServerToolOpenRouter)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.SearchModelsServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.SearchModelsServerToolOpenRouter).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.SearchModelsServerToolOpenRouter!, typeInfo);
+ }
+ else if (value.IsWebFetchServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.WebFetchServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.WebFetchServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.WebFetchServerTool!, typeInfo);
+ }
+ else if (value.IsWebSearchServerToolOpenRouter)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.WebSearchServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.WebSearchServerToolOpenRouter).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.WebSearchServerToolOpenRouter!, typeInfo);
+ }
+ else if (value.IsApplyPatchServerToolOpenRouter)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ApplyPatchServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ApplyPatchServerToolOpenRouter).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.ApplyPatchServerToolOpenRouter!, typeInfo);
+ }
+ else if (value.IsBashServerTool)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.BashServerTool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.BashServerTool).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.BashServerTool!, typeInfo);
+ }
+ else if (value.IsShellServerToolOpenRouter)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.ShellServerToolOpenRouter), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.ShellServerToolOpenRouter).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.ShellServerToolOpenRouter!, typeInfo);
+ }
+ else if (value.IsAdditionalToolsItemToolsItems27)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AdditionalToolsItemToolsItems27), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AdditionalToolsItemToolsItems27).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.AdditionalToolsItemToolsItems27!, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemToolsItemsOneOf0Type.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemToolsItemsOneOf0Type.g.cs
new file mode 100644
index 00000000..500d9acf
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemToolsItemsOneOf0Type.g.cs
@@ -0,0 +1,53 @@
+#nullable enable
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public sealed class AdditionalToolsItemToolsItemsOneOf0TypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AdditionalToolsItemToolsItemsOneOf0Type 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.AdditionalToolsItemToolsItemsOneOf0TypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenRouter.AdditionalToolsItemToolsItemsOneOf0Type)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::OpenRouter.AdditionalToolsItemToolsItemsOneOf0Type);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AdditionalToolsItemToolsItemsOneOf0Type value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenRouter.AdditionalToolsItemToolsItemsOneOf0TypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemToolsItemsOneOf0TypeNullable.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemToolsItemsOneOf0TypeNullable.g.cs
new file mode 100644
index 00000000..f5e999aa
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemToolsItemsOneOf0TypeNullable.g.cs
@@ -0,0 +1,60 @@
+#nullable enable
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public sealed class AdditionalToolsItemToolsItemsOneOf0TypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AdditionalToolsItemToolsItemsOneOf0Type? 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.AdditionalToolsItemToolsItemsOneOf0TypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenRouter.AdditionalToolsItemToolsItemsOneOf0Type)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::OpenRouter.AdditionalToolsItemToolsItemsOneOf0Type?);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AdditionalToolsItemToolsItemsOneOf0Type? 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.AdditionalToolsItemToolsItemsOneOf0TypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemType.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemType.g.cs
new file mode 100644
index 00000000..3c3e4c95
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemType.g.cs
@@ -0,0 +1,53 @@
+#nullable enable
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public sealed class AdditionalToolsItemTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AdditionalToolsItemType 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.AdditionalToolsItemTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenRouter.AdditionalToolsItemType)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::OpenRouter.AdditionalToolsItemType);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AdditionalToolsItemType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenRouter.AdditionalToolsItemTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemTypeNullable.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemTypeNullable.g.cs
new file mode 100644
index 00000000..6074e1a3
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AdditionalToolsItemTypeNullable.g.cs
@@ -0,0 +1,60 @@
+#nullable enable
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public sealed class AdditionalToolsItemTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AdditionalToolsItemType? 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.AdditionalToolsItemTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenRouter.AdditionalToolsItemType)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::OpenRouter.AdditionalToolsItemType?);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AdditionalToolsItemType? 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.AdditionalToolsItemTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItems.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItems.g.cs
new file mode 100644
index 00000000..cdf0a522
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItems.g.cs
@@ -0,0 +1,197 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public class AgentMessageItemContentItemsJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AgentMessageItemContentItems Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
+ var __rawJson = __jsonDocument.RootElement.GetRawText();
+ var __jsonProps = new global::System.Collections.Generic.HashSet();
+ if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
+ {
+ foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
+ {
+ __jsonProps.Add(__jsonProp.Name);
+ if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object)
+ {
+ foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject())
+ {
+ __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name);
+ }
+ }
+
+ }
+ }
+
+ var __score0 = 0;
+ if (__jsonProps.Contains("prompt_cache_breakpoint")) __score0++;
+ if (__jsonProps.Contains("prompt_cache_breakpoint.mode")) __score0++;
+ if (__jsonProps.Contains("text")) __score0++;
+ var __score1 = 0;
+ if (__jsonProps.Contains("detail")) __score1++;
+ if (__jsonProps.Contains("image_url")) __score1++;
+ if (__jsonProps.Contains("type")) __score1++;
+ var __score2 = 0;
+ if (__jsonProps.Contains("encrypted_content")) __score2++;
+ if (__jsonProps.Contains("type")) __score2++;
+ var __bestScore = 0;
+ var __bestIndex = -1;
+ if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
+ if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
+ if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; }
+
+ global::OpenRouter.InputText? inputText = default;
+ global::OpenRouter.AgentMessageItemContentItems1? agentMessageItemContentItems1 = default;
+ global::OpenRouter.AgentMessageItemContentItems2? agentMessageItemContentItems2 = default;
+ if (__bestIndex >= 0)
+ {
+ if (__bestIndex == 0)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.InputText), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.InputText).Name}");
+ inputText = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 1)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AgentMessageItemContentItems1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AgentMessageItemContentItems1).Name}");
+ agentMessageItemContentItems1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 2)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AgentMessageItemContentItems2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AgentMessageItemContentItems2).Name}");
+ agentMessageItemContentItems2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ }
+
+ if (inputText == null && agentMessageItemContentItems1 == null && agentMessageItemContentItems2 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.InputText), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.InputText).Name}");
+ inputText = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (inputText == null && agentMessageItemContentItems1 == null && agentMessageItemContentItems2 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AgentMessageItemContentItems1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AgentMessageItemContentItems1).Name}");
+ agentMessageItemContentItems1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (inputText == null && agentMessageItemContentItems1 == null && agentMessageItemContentItems2 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AgentMessageItemContentItems2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AgentMessageItemContentItems2).Name}");
+ agentMessageItemContentItems2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ var __value = new global::OpenRouter.AgentMessageItemContentItems(
+ inputText,
+
+ agentMessageItemContentItems1,
+
+ agentMessageItemContentItems2
+ );
+
+ return __value;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AgentMessageItemContentItems value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsInputText)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.InputText), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.InputText).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.InputText!, typeInfo);
+ }
+ else if (value.IsAgentMessageItemContentItems1)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AgentMessageItemContentItems1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AgentMessageItemContentItems1).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentMessageItemContentItems1!, typeInfo);
+ }
+ else if (value.IsAgentMessageItemContentItems2)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenRouter.AgentMessageItemContentItems2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenRouter.AgentMessageItemContentItems2).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentMessageItemContentItems2!, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf1Detail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf1Detail.g.cs
new file mode 100644
index 00000000..2a99d305
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf1Detail.g.cs
@@ -0,0 +1,53 @@
+#nullable enable
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public sealed class AgentMessageItemContentItemsOneOf1DetailJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AgentMessageItemContentItemsOneOf1Detail 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.AgentMessageItemContentItemsOneOf1DetailExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenRouter.AgentMessageItemContentItemsOneOf1Detail)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::OpenRouter.AgentMessageItemContentItemsOneOf1Detail);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AgentMessageItemContentItemsOneOf1Detail value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenRouter.AgentMessageItemContentItemsOneOf1DetailExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf1DetailNullable.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf1DetailNullable.g.cs
new file mode 100644
index 00000000..b85c4795
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf1DetailNullable.g.cs
@@ -0,0 +1,60 @@
+#nullable enable
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public sealed class AgentMessageItemContentItemsOneOf1DetailNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AgentMessageItemContentItemsOneOf1Detail? 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.AgentMessageItemContentItemsOneOf1DetailExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenRouter.AgentMessageItemContentItemsOneOf1Detail)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::OpenRouter.AgentMessageItemContentItemsOneOf1Detail?);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AgentMessageItemContentItemsOneOf1Detail? 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.AgentMessageItemContentItemsOneOf1DetailExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf1Type.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf1Type.g.cs
new file mode 100644
index 00000000..07861e46
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf1Type.g.cs
@@ -0,0 +1,53 @@
+#nullable enable
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public sealed class AgentMessageItemContentItemsOneOf1TypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AgentMessageItemContentItemsOneOf1Type 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.AgentMessageItemContentItemsOneOf1TypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenRouter.AgentMessageItemContentItemsOneOf1Type)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::OpenRouter.AgentMessageItemContentItemsOneOf1Type);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AgentMessageItemContentItemsOneOf1Type value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenRouter.AgentMessageItemContentItemsOneOf1TypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf1TypeNullable.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf1TypeNullable.g.cs
new file mode 100644
index 00000000..8f556043
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf1TypeNullable.g.cs
@@ -0,0 +1,60 @@
+#nullable enable
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public sealed class AgentMessageItemContentItemsOneOf1TypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AgentMessageItemContentItemsOneOf1Type? 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.AgentMessageItemContentItemsOneOf1TypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenRouter.AgentMessageItemContentItemsOneOf1Type)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::OpenRouter.AgentMessageItemContentItemsOneOf1Type?);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AgentMessageItemContentItemsOneOf1Type? 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.AgentMessageItemContentItemsOneOf1TypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf2Type.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf2Type.g.cs
new file mode 100644
index 00000000..69346c8b
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf2Type.g.cs
@@ -0,0 +1,53 @@
+#nullable enable
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public sealed class AgentMessageItemContentItemsOneOf2TypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AgentMessageItemContentItemsOneOf2Type 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.AgentMessageItemContentItemsOneOf2TypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenRouter.AgentMessageItemContentItemsOneOf2Type)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::OpenRouter.AgentMessageItemContentItemsOneOf2Type);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AgentMessageItemContentItemsOneOf2Type value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenRouter.AgentMessageItemContentItemsOneOf2TypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf2TypeNullable.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf2TypeNullable.g.cs
new file mode 100644
index 00000000..241db9ff
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemContentItemsOneOf2TypeNullable.g.cs
@@ -0,0 +1,60 @@
+#nullable enable
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public sealed class AgentMessageItemContentItemsOneOf2TypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AgentMessageItemContentItemsOneOf2Type? 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.AgentMessageItemContentItemsOneOf2TypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenRouter.AgentMessageItemContentItemsOneOf2Type)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::OpenRouter.AgentMessageItemContentItemsOneOf2Type?);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AgentMessageItemContentItemsOneOf2Type? 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.AgentMessageItemContentItemsOneOf2TypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemType.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemType.g.cs
new file mode 100644
index 00000000..dada8113
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemType.g.cs
@@ -0,0 +1,53 @@
+#nullable enable
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public sealed class AgentMessageItemTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AgentMessageItemType 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.AgentMessageItemTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenRouter.AgentMessageItemType)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::OpenRouter.AgentMessageItemType);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AgentMessageItemType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenRouter.AgentMessageItemTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemTypeNullable.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemTypeNullable.g.cs
new file mode 100644
index 00000000..07d457ca
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AgentMessageItemTypeNullable.g.cs
@@ -0,0 +1,60 @@
+#nullable enable
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public sealed class AgentMessageItemTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AgentMessageItemType? 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.AgentMessageItemTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenRouter.AgentMessageItemType)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::OpenRouter.AgentMessageItemType?);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AgentMessageItemType? 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.AgentMessageItemTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue.g.cs
new file mode 100644
index 00000000..4cd7024a
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue.g.cs
@@ -0,0 +1,217 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public class AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+
+ using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
+ var __rawJson = __jsonDocument.RootElement.GetRawText();
+ var __jsonProps = new global::System.Collections.Generic.HashSet();
+ if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
+ {
+ foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
+ {
+ __jsonProps.Add(__jsonProp.Name);
+ }
+ }
+
+ var __score0 = 0;
+ {
+ var __ti = typeInfoResolver.GetTypeInfo(typeof(string), options);
+ if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object)
+ {
+ foreach (var __prop in __ti.Properties)
+ {
+ if (__jsonProps.Contains(__prop.Name)) __score0++;
+ }
+ }
+ }
+ var __score1 = 0;
+ {
+ var __ti = typeInfoResolver.GetTypeInfo(typeof(double), options);
+ if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object)
+ {
+ foreach (var __prop in __ti.Properties)
+ {
+ if (__jsonProps.Contains(__prop.Name)) __score1++;
+ }
+ }
+ }
+ var __score2 = 0;
+ {
+ var __ti = typeInfoResolver.GetTypeInfo(typeof(global::System.Collections.Generic.IList), options);
+ if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object)
+ {
+ foreach (var __prop in __ti.Properties)
+ {
+ if (__jsonProps.Contains(__prop.Name)) __score2++;
+ }
+ }
+ }
+ var __bestScore = 0;
+ var __bestIndex = -1;
+ if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
+ if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
+ if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; }
+
+ string? analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant1 = default;
+ double? analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant2 = default;
+ global::System.Collections.Generic.IList? analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue2 = default;
+ if (__bestIndex >= 0)
+ {
+ if (__bestIndex == 0)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ else if (__bestIndex == 1)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(double), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(double).Name}");
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ else if (__bestIndex == 2)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::System.Collections.Generic.IList), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::System.Collections.Generic.IList).Name}");
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ }
+
+ if (analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant1 == null && analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant2 == null && analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue2 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant1 == null && analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant2 == null && analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue2 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(double), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(double).Name}");
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant1 == null && analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant2 == null && analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue2 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::System.Collections.Generic.IList), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::System.Collections.Generic.IList).Name}");
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ var __value = new global::OpenRouter.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue(
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant1,
+
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant2,
+
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue2
+ );
+
+ return __value;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsAnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant1)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant1!, typeInfo);
+ }
+ else if (value.IsAnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant2)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(double), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(double).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueVariant2!.Value, typeInfo);
+ }
+ else if (value.IsAnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue2)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::System.Collections.Generic.IList), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo?> ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::System.Collections.Generic.IList).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValue2!, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2Items.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2Items.g.cs
new file mode 100644
index 00000000..28a8e255
--- /dev/null
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2Items.g.cs
@@ -0,0 +1,162 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace OpenRouter.JsonConverters
+{
+ ///
+ public class AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenRouter.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2Items Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+
+ using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
+ var __rawJson = __jsonDocument.RootElement.GetRawText();
+ var __jsonProps = new global::System.Collections.Generic.HashSet();
+ if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
+ {
+ foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
+ {
+ __jsonProps.Add(__jsonProp.Name);
+ }
+ }
+
+ var __score0 = 0;
+ {
+ var __ti = typeInfoResolver.GetTypeInfo(typeof(string), options);
+ if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object)
+ {
+ foreach (var __prop in __ti.Properties)
+ {
+ if (__jsonProps.Contains(__prop.Name)) __score0++;
+ }
+ }
+ }
+ var __score1 = 0;
+ {
+ var __ti = typeInfoResolver.GetTypeInfo(typeof(double), options);
+ if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object)
+ {
+ foreach (var __prop in __ti.Properties)
+ {
+ if (__jsonProps.Contains(__prop.Name)) __score1++;
+ }
+ }
+ }
+ var __bestScore = 0;
+ var __bestIndex = -1;
+ if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
+ if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
+
+ string? analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant1 = default;
+ double? analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant2 = default;
+ if (__bestIndex >= 0)
+ {
+ if (__bestIndex == 0)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ else if (__bestIndex == 1)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(double), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(double).Name}");
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ }
+
+ if (analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant1 == null && analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant2 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ if (analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant1 == null && analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant2 == null)
+ {
+ try
+ {
+
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(double), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(double).Name}");
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+
+ var __value = new global::OpenRouter.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2Items(
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant1,
+
+ analyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant2
+ );
+
+ return __value;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenRouter.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2Items value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsAnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant1)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant1!, typeInfo);
+ }
+ else if (value.IsAnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant2)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(double), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(double).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.AnalyticsQueryPostRequestBodyContentApplicationJsonSchemaClassifierFiltersFiltersItemsValueOneOf2ItemsVariant2!.Value, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.BaseInputs.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.BaseInputs.g.cs
index 83634f02..677f9658 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.BaseInputs.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.BaseInputs.g.cs
@@ -49,26 +49,13 @@ public class BaseInputsJsonConverter : global::System.Text.Json.Serialization.Js
}
}
}
- var __score2 = 0;
- {
- var __ti = typeInfoResolver.GetTypeInfo(typeof(object), options);
- if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object)
- {
- foreach (var __prop in __ti.Properties)
- {
- if (__jsonProps.Contains(__prop.Name)) __score2++;
- }
- }
- }
var __bestScore = 0;
var __bestIndex = -1;
if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
- if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; }
string? baseInputsVariant1 = default;
global::System.Collections.Generic.IList? baseInputs1 = default;
- object? baseInputsVariant3 = default;
if (__bestIndex >= 0)
{
if (__bestIndex == 0)
@@ -104,26 +91,9 @@ public class BaseInputsJsonConverter : global::System.Text.Json.Serialization.Js
{
}
}
-
- else if (__bestIndex == 2)
- {
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(object), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo