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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ public partial interface IOpenRouterClient : global::System.IDisposable
/// </summary>
public SubpackageGuardrailsClient SubpackageGuardrails { get; }

/// <summary>
///
/// </summary>
public SubpackageImagesClient SubpackageImages { get; }

/// <summary>
///
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public partial interface ISubpackageBetaResponsesClient
/// <param name="cacheControl">
/// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.
/// </param>
/// <param name="debug">
/// Debug options for inspecting request transformations (streaming only)
/// </param>
/// <param name="frequencyPenalty"></param>
/// <param name="imageConfig"></param>
/// <param name="include"></param>
Expand Down Expand Up @@ -118,6 +121,7 @@ public partial interface ISubpackageBetaResponsesClient
global::OpenRouter.MetadataLevel? xOpenRouterMetadata = default,
bool? background = default,
global::OpenRouter.AnthropicCacheControlDirective? cacheControl = default,
global::OpenRouter.ChatDebugOptions? debug = default,
double? frequencyPenalty = default,
global::OpenRouter.ImageConfig? imageConfig = default,
global::System.Collections.Generic.IList<global::OpenRouter.ResponseIncludesEnum>? include = default,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#nullable enable

namespace OpenRouter
{
public partial interface ISubpackageImagesClient
{
/// <summary>
/// Generate an image<br/>
/// Generates an image from a text prompt via the image generation router
/// </summary>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::OpenRouter.ApiException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.ImageGenerationResponse> CreateImagesAsync(

global::OpenRouter.ImageGenerationRequest request,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Generate an image<br/>
/// Generates an image from a text prompt via the image generation router
/// </summary>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::OpenRouter.ApiException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.AutoSDKHttpResponse<global::OpenRouter.ImageGenerationResponse>> CreateImagesAsResponseAsync(

global::OpenRouter.ImageGenerationRequest request,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Generate an image<br/>
/// Generates an image from a text prompt via the image generation router
/// </summary>
/// <param name="aspectRatio">
/// Normalized aspect ratio of the generated image. Providers clamp to their supported subset.
/// </param>
/// <param name="background">
/// Background treatment. `transparent` requires an output_format that supports alpha (png or webp).
/// </param>
/// <param name="inputReferences">
/// Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.
/// </param>
/// <param name="model">
/// The image generation model to use
/// </param>
/// <param name="n">
/// Number of images to generate (1-10). Providers that only support single-image generation reject n &gt; 1.
/// </param>
/// <param name="outputCompression">
/// Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.
/// </param>
/// <param name="outputFormat">
/// Encoding of the returned image bytes.
/// </param>
/// <param name="prompt">
/// Text description of the desired image
/// </param>
/// <param name="provider">
/// Provider-specific passthrough configuration
/// </param>
/// <param name="quality">
/// Rendering quality. Providers without a quality knob ignore this.
/// </param>
/// <param name="resolution">
/// Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
/// </param>
/// <param name="seed">
/// 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.
/// </param>
/// <param name="size">
/// 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.
/// </param>
/// <param name="stream">
/// 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.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.ImageGenerationResponse> CreateImagesAsync(
string model,
string prompt,
global::OpenRouter.ImageGenerationRequestAspectRatio? aspectRatio = default,
global::OpenRouter.ImageGenerationRequestBackground? background = default,
global::System.Collections.Generic.IList<global::OpenRouter.ContentPartImage>? inputReferences = default,
int? n = default,
int? outputCompression = default,
global::OpenRouter.ImageGenerationRequestOutputFormat? outputFormat = default,
global::OpenRouter.ImageGenerationRequestProvider? provider = default,
global::OpenRouter.ImageGenerationRequestQuality? quality = default,
global::OpenRouter.ImageGenerationRequestResolution? resolution = default,
int? seed = default,
string? size = default,
bool? stream = default,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#nullable enable

namespace OpenRouter
{
public partial interface ISubpackageImagesClient
{
/// <summary>
/// List endpoints for an image model<br/>
/// Returns the full per-endpoint records for an image model: each endpoint's definitive supported parameters, pricing, and passthrough allowlist.
/// </summary>
/// <param name="author"></param>
/// <param name="slug"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::OpenRouter.ApiException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.ImageModelEndpointsResponse> ListImageModelEndpointsAsync(
string author,
string slug,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// List endpoints for an image model<br/>
/// Returns the full per-endpoint records for an image model: each endpoint's definitive supported parameters, pricing, and passthrough allowlist.
/// </summary>
/// <param name="author"></param>
/// <param name="slug"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::OpenRouter.ApiException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.AutoSDKHttpResponse<global::OpenRouter.ImageModelEndpointsResponse>> ListImageModelEndpointsAsResponseAsync(
string author,
string slug,
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#nullable enable

namespace OpenRouter
{
public partial interface ISubpackageImagesClient
{
/// <summary>
/// List image generation models<br/>
/// Lists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records.
/// </summary>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::OpenRouter.ApiException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.ImageModelsListResponse> ListImageModelsAsync(
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// List image generation models<br/>
/// Lists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records.
/// </summary>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::OpenRouter.ApiException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.AutoSDKHttpResponse<global::OpenRouter.ImageModelsListResponse>> ListImageModelsAsResponseAsync(
global::OpenRouter.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

#nullable enable

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

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

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

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


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


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public partial interface ISubpackagePresetsClient
/// <param name="cacheControl">
/// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.
/// </param>
/// <param name="debug">
/// Debug options for inspecting request transformations (streaming only)
/// </param>
/// <param name="frequencyPenalty"></param>
/// <param name="imageConfig"></param>
/// <param name="include"></param>
Expand Down Expand Up @@ -112,6 +115,7 @@ public partial interface ISubpackagePresetsClient
string slug,
bool? background = default,
global::OpenRouter.AnthropicCacheControlDirective? cacheControl = default,
global::OpenRouter.ChatDebugOptions? debug = default,
double? frequencyPenalty = default,
global::OpenRouter.ImageConfig? imageConfig = default,
global::System.Collections.Generic.IList<global::OpenRouter.ResponseIncludesEnum>? include = default,
Expand Down
Loading