import * as z from "zod/v4"; import { ClosedEnum, OpenEnum } from "../types/enums.js"; import { ContentPartImage, ContentPartImage$Outbound } from "./contentpartimage.js"; import { ImageGenerationProviderPreferences, ImageGenerationProviderPreferences$Outbound } from "./imagegenerationproviderpreferences.js"; import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js"; /** * Normalized aspect ratio of the generated image. Providers clamp to their supported subset. */ export declare const ImageGenerationRequestAspectRatio: { readonly Eleven: "1:1"; readonly Twelve: "1:2"; readonly Thirteen: "1:3"; readonly Fourteen: "1:4"; readonly Eighteen: "1:8"; readonly TwentyOne: "2:1"; readonly TwentyThree: "2:3"; readonly ThirtyOne: "3:1"; readonly TwoDot351: "2.35:1"; readonly ThirtyTwo: "3:2"; readonly ThirtyFour: "3:4"; readonly FortyOne: "4:1"; readonly FortyThree: "4:3"; readonly FortyFive: "4:5"; readonly FiftyTwo: "5:2"; readonly FiftyFour: "5:4"; readonly FiftySeven: "5:7"; readonly SeventyFive: "7:5"; readonly EightyOne: "8:1"; readonly NineHundredAndSixteen: "9:16"; readonly OneHundredAndSixtyNine: "16:9"; readonly NineHundredAndNineteenDot5: "9:19.5"; readonly NineteenDot59: "19.5:9"; readonly NineHundredAndTwenty: "9:20"; readonly TwoHundredAndNine: "20:9"; readonly NineHundredAndTwentyOne: "9:21"; readonly TwoHundredAndNineteen: "21:9"; readonly Auto: "auto"; }; /** * Normalized aspect ratio of the generated image. Providers clamp to their supported subset. */ export type ImageGenerationRequestAspectRatio = OpenEnum; /** * Background treatment. `transparent` requires an output_format that supports alpha (png or webp). */ export declare const ImageGenerationRequestBackground: { readonly Auto: "auto"; readonly Transparent: "transparent"; readonly Opaque: "opaque"; }; /** * Background treatment. `transparent` requires an output_format that supports alpha (png or webp). */ export type ImageGenerationRequestBackground = OpenEnum; export type ImageGenerationRequestImageUrl = { url: string; }; export declare const ImageGenerationRequestType: { readonly ImageUrl: "image_url"; }; export type ImageGenerationRequestType = ClosedEnum; /** * A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise. */ export type Markup = { imageUrl: ImageGenerationRequestImageUrl; type: ImageGenerationRequestType; }; /** * Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`). */ export declare const ImageGenerationRequestOutputFormat: { readonly Png: "png"; readonly Jpeg: "jpeg"; readonly Webp: "webp"; readonly Svg: "svg"; readonly Gif: "gif"; }; /** * Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`). */ export type ImageGenerationRequestOutputFormat = OpenEnum; /** * Rendering quality. Providers without a quality knob ignore this. */ export declare const ImageGenerationRequestQuality: { readonly Auto: "auto"; readonly Low: "low"; readonly Medium: "medium"; readonly High: "high"; readonly Xhigh: "xhigh"; readonly Max: "max"; }; /** * Rendering quality. Providers without a quality knob ignore this. */ export type ImageGenerationRequestQuality = OpenEnum; /** * Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. */ export declare const ImageGenerationRequestResolution: { readonly FiveHundredAndTwelve: "512"; readonly SevenHundredAndSixtyEight: "768"; readonly OneK: "1K"; readonly OneDot5K: "1.5K"; readonly TwoK: "2K"; readonly FourK: "4K"; readonly EightK: "8K"; }; /** * Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. */ export type ImageGenerationRequestResolution = OpenEnum; /** * `b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable. */ export declare const ImageGenerationRequestResponseFormat: { readonly B64Json: "b64_json"; readonly Url: "url"; }; /** * `b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable. */ export type ImageGenerationRequestResponseFormat = OpenEnum; /** * Image generation request input */ export type ImageGenerationRequest = { /** * Normalized aspect ratio of the generated image. Providers clamp to their supported subset. */ aspectRatio?: ImageGenerationRequestAspectRatio | undefined; /** * Background treatment. `transparent` requires an output_format that supports alpha (png or webp). */ background?: ImageGenerationRequestBackground | undefined; /** * Number of animation frames (2-64) when `output_format` is `gif`. Only honored by models that produce animations; each accepts its own range and rejects values outside it. Ignored otherwise. */ frameCount?: number | undefined; /** * Display time of each animation frame in milliseconds (20-2000) when `output_format` is `gif`. Ignored by models that do not produce animations. */ frameDurationMs?: number | undefined; /** * Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. */ inputReferences?: Array | undefined; /** * A transparent PNG overlay (arrows, circles, annotations) with the same dimensions as the first reference image, as a base64 data URL or HTTP(S) URL, guiding where an edit applies. Image-to-image requests only; honored by models with markup-guided editing (OpenAI gpt-image-2.6) and ignored otherwise. */ markup?: Markup | undefined; /** * The image generation model to use */ model: string; /** * Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. */ n?: number | undefined; /** * Compression level (0-100) for jpeg/webp output. Ignored by providers without a compression knob; providers that honor it may reject it with other output formats (e.g. OpenAI requires output_format "jpeg" or "webp"). */ outputCompression?: number | undefined; /** * Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. GIF produces an animation on models that support it (OpenAI gpt-image-2.6; see `frame_count`). */ outputFormat?: ImageGenerationRequestOutputFormat | undefined; /** * Text description of the desired image */ prompt: string; /** * Provider routing preferences and provider-specific passthrough configuration. */ provider?: ImageGenerationProviderPreferences | undefined; /** * Rendering quality. Providers without a quality knob ignore this. */ quality?: ImageGenerationRequestQuality | undefined; /** * Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. */ resolution?: ImageGenerationRequestResolution | undefined; /** * `b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable. */ responseFormat?: ImageGenerationRequestResponseFormat | undefined; /** * 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. */ seed?: number | undefined; /** * A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. */ sessionId?: string | undefined; /** * Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. */ size?: string | undefined; /** * 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. */ stream?: boolean | undefined; /** * Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. */ trace?: TraceConfig | undefined; /** * A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. */ user?: string | undefined; }; /** @internal */ export declare const ImageGenerationRequestAspectRatio$outboundSchema: z.ZodType; /** @internal */ export declare const ImageGenerationRequestBackground$outboundSchema: z.ZodType; /** @internal */ export type ImageGenerationRequestImageUrl$Outbound = { url: string; }; /** @internal */ export declare const ImageGenerationRequestImageUrl$outboundSchema: z.ZodType; export declare function imageGenerationRequestImageUrlToJSON(imageGenerationRequestImageUrl: ImageGenerationRequestImageUrl): string; /** @internal */ export declare const ImageGenerationRequestType$outboundSchema: z.ZodEnum; /** @internal */ export type Markup$Outbound = { image_url: ImageGenerationRequestImageUrl$Outbound; type: string; }; /** @internal */ export declare const Markup$outboundSchema: z.ZodType; export declare function markupToJSON(markup: Markup): string; /** @internal */ export declare const ImageGenerationRequestOutputFormat$outboundSchema: z.ZodType; /** @internal */ export declare const ImageGenerationRequestQuality$outboundSchema: z.ZodType; /** @internal */ export declare const ImageGenerationRequestResolution$outboundSchema: z.ZodType; /** @internal */ export declare const ImageGenerationRequestResponseFormat$outboundSchema: z.ZodType; /** @internal */ export type ImageGenerationRequest$Outbound = { aspect_ratio?: string | undefined; background?: string | undefined; frame_count?: number | undefined; frame_duration_ms?: number | undefined; input_references?: Array | undefined; markup?: Markup$Outbound | undefined; model: string; n?: number | undefined; output_compression?: number | undefined; output_format?: string | undefined; prompt: string; provider?: ImageGenerationProviderPreferences$Outbound | undefined; quality?: string | undefined; resolution?: string | undefined; response_format?: string | undefined; seed?: number | undefined; session_id?: string | undefined; size?: string | undefined; stream?: boolean | undefined; trace?: TraceConfig$Outbound | undefined; user?: string | undefined; }; /** @internal */ export declare const ImageGenerationRequest$outboundSchema: z.ZodType; export declare function imageGenerationRequestToJSON(imageGenerationRequest: ImageGenerationRequest): string; //# sourceMappingURL=imagegenerationrequest.d.ts.map