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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,10 @@ partial void ProcessCreateResponseContent(
/// Optional allowlist of user IDs that may use this credential. `null` means no restriction.<br/>
/// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
/// </param>
/// <param name="declaredRegion">
/// Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. Defaults to the key's region for OpenAI and Fireworks, otherwise `null`.<br/>
/// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
/// </param>
/// <param name="declaredZdr">
/// Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter's data policy for the provider's endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. Defaults to `null`.<br/>
/// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
Expand Down Expand Up @@ -642,6 +646,7 @@ partial void ProcessCreateResponseContent(
global::System.Collections.Generic.IList<string>? allowedApiKeyHashes = default,
global::System.Collections.Generic.IList<string>? allowedModels = default,
global::System.Collections.Generic.IList<string>? allowedUserIds = default,
global::OpenRouter.CreateBYOKKeyRequestDeclaredRegion? declaredRegion = default,
bool? declaredZdr = default,
bool? disabled = default,
bool? isByokOnly = default,
Expand All @@ -657,6 +662,7 @@ partial void ProcessCreateResponseContent(
AllowedApiKeyHashes = allowedApiKeyHashes,
AllowedModels = allowedModels,
AllowedUserIds = allowedUserIds,
DeclaredRegion = declaredRegion,
DeclaredZdr = declaredZdr,
Disabled = disabled,
IsByokOnly = isByokOnly,
Expand Down
43 changes: 43 additions & 0 deletions src/libs/OpenRouter/Generated/OpenRouter.ByokClient.Update.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,43 @@ partial void ProcessUpdateResponseContent(
h => h.Key,
h => h.Value));
}
// Conflict - Resource conflict or concurrent modification
if ((int)__response.StatusCode == 409)
{
string? __content_409 = null;
global::System.Exception? __exception_409 = null;
global::OpenRouter.ConflictResponse? __value_409 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_409 = global::OpenRouter.ConflictResponse.FromJson(__content_409, JsonSerializerContext);
}
else
{
__content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_409 = global::OpenRouter.ConflictResponse.FromJson(__content_409, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_409 = __ex;
}


throw global::OpenRouter.ApiException<global::OpenRouter.ConflictResponse>.Create(
statusCode: __response.StatusCode,
message: __content_409 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_409,
responseBody: __content_409,
responseObject: __value_409,
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)
{
Expand Down Expand Up @@ -653,6 +690,10 @@ partial void ProcessUpdateResponseContent(
/// Optional allowlist of user IDs that may use this credential. `null` means no restriction.<br/>
/// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
/// </param>
/// <param name="declaredRegion">
/// Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. Omit to leave the stored value unchanged (rotating an OpenAI or Fireworks `key` re-derives it from the new key); `null` clears the declaration.<br/>
/// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
/// </param>
/// <param name="declaredZdr">
/// Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter's data policy for the provider's endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. Omit to leave the stored value unchanged; `null` clears the declaration.<br/>
/// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
Expand Down Expand Up @@ -689,6 +730,7 @@ partial void ProcessUpdateResponseContent(
global::System.Collections.Generic.IList<string>? allowedApiKeyHashes = default,
global::System.Collections.Generic.IList<string>? allowedModels = default,
global::System.Collections.Generic.IList<string>? allowedUserIds = default,
global::OpenRouter.UpdateBYOKKeyRequestDeclaredRegion? declaredRegion = default,
bool? declaredZdr = default,
bool? disabled = default,
bool? isByokOnly = default,
Expand All @@ -704,6 +746,7 @@ partial void ProcessUpdateResponseContent(
AllowedApiKeyHashes = allowedApiKeyHashes,
AllowedModels = allowedModels,
AllowedUserIds = allowedUserIds,
DeclaredRegion = declaredRegion,
DeclaredZdr = declaredZdr,
Disabled = disabled,
IsByokOnly = isByokOnly,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public partial interface IByokClient
/// Optional allowlist of user IDs that may use this credential. `null` means no restriction.<br/>
/// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
/// </param>
/// <param name="declaredRegion">
/// Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. Defaults to the key's region for OpenAI and Fireworks, otherwise `null`.<br/>
/// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
/// </param>
/// <param name="declaredZdr">
/// Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter's data policy for the provider's endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. Defaults to `null`.<br/>
/// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
Expand Down Expand Up @@ -91,6 +95,7 @@ public partial interface IByokClient
global::System.Collections.Generic.IList<string>? allowedApiKeyHashes = default,
global::System.Collections.Generic.IList<string>? allowedModels = default,
global::System.Collections.Generic.IList<string>? allowedUserIds = default,
global::OpenRouter.CreateBYOKKeyRequestDeclaredRegion? declaredRegion = default,
bool? declaredZdr = default,
bool? disabled = default,
bool? isByokOnly = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public partial interface IByokClient
/// Optional allowlist of user IDs that may use this credential. `null` means no restriction.<br/>
/// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
/// </param>
/// <param name="declaredRegion">
/// Your declaration of the data region in which the upstream provider account behind this credential processes requests, used for routing eligibility on OpenRouter's regional hosts. `null` means undeclared and `global` is behaviorally identical: the credential follows the region OpenRouter records for the endpoint. `europe` or `us` lets requests to `eu.openrouter.ai` or `us.openrouter.ai` use this credential for that provider (private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models are excluded). Self-declared and not verified by OpenRouter. For OpenAI and Fireworks the region comes from the key material (a `{"api_key": ..., "region": ...}` key), so the value must match the key's region. Among other providers, only Azure accepts `europe` or `us`. Omit to leave the stored value unchanged (rotating an OpenAI or Fireworks `key` re-derives it from the new key); `null` clears the declaration.<br/>
/// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
/// </param>
/// <param name="declaredZdr">
/// Your declaration of whether the upstream provider account behind this credential has zero data retention (ZDR). `null` inherits OpenRouter's data policy for the provider's endpoint; `true` declares the account ZDR so requests that require ZDR may route to this credential even when the shared endpoint retains data; `false` declares it non-ZDR so such requests never route to it. Self-declared and not verified by OpenRouter. Omit to leave the stored value unchanged; `null` clears the declaration.<br/>
/// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
Expand Down Expand Up @@ -96,6 +100,7 @@ public partial interface IByokClient
global::System.Collections.Generic.IList<string>? allowedApiKeyHashes = default,
global::System.Collections.Generic.IList<string>? allowedModels = default,
global::System.Collections.Generic.IList<string>? allowedUserIds = default,
global::OpenRouter.UpdateBYOKKeyRequestDeclaredRegion? declaredRegion = default,
bool? declaredZdr = default,
bool? disabled = default,
bool? isByokOnly = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,17 @@ public partial interface ITtsClient
/// Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).
/// </summary>
/// <param name="input">
/// Text to synthesize<br/>
/// Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is currently supported by Gemini TTS models only.<br/>
/// Example: Hello world
/// </param>
/// <param name="inputReferences">
/// Reference content for stateless voice cloning or voice design. Audio mode: one to three `input_audio` parts, each optionally paired with a `text` part carrying its transcript (a single clip accepts its transcript before or after it; with multiple clips each transcript immediately follows its clip); only routed to endpoints that support voice cloning (and multiple references when more than one part is sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. The two modes cannot be mixed. An empty array is treated as no reference.<br/>
/// Example: [{"input_audio":{"data":"data:audio/wav;base64,UklGRuQXDABXQVZF..."},"type":"input_audio"}, {"text":"I used to rule the world.","type":"text"}]
/// </param>
/// <param name="instructions">
/// Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts and Gemini TTS models. Ignored by other providers.<br/>
/// Example: Speak in a warm and friendly tone.
/// </param>
/// <param name="model">
/// TTS model identifier<br/>
/// Example: mistralai/voxtral-mini-tts-2603
Expand Down Expand Up @@ -91,9 +95,10 @@ public partial interface ITtsClient
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<byte[]> CreateSpeechAsync(
string input,
global::OpenRouter.SpeechInput input,
string model,
global::System.Collections.Generic.IList<global::OpenRouter.SpeechInputReference>? inputReferences = default,
string? instructions = default,
global::OpenRouter.SpeechRequestProvider? provider = default,
global::OpenRouter.SpeechRequestResponseFormat? responseFormat = default,
string? sessionId = default,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#nullable enable

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

break;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::OpenRouter.BYOKKeyDeclaredRegion);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

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

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

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

break;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::OpenRouter.BYOKKeyDeclaredRegion?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenRouter.BYOKKeyDeclaredRegion? 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.BYOKKeyDeclaredRegionExtensions.ToValueString(value.Value));
}
}
}
}
Loading
Loading