chore: 🐝 Update SDK - Generate (spec change merged) 0.11.25 (#438)

Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
Co-authored-by: speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2026-07-13 19:22:44 +00:00
committed by GitHub
co-authored by speakeasybot speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
parent 68b867f65c
commit 4d598caab2
27 changed files with 1101 additions and 772 deletions
+2 -2
View File
@@ -3,10 +3,10 @@
import importlib.metadata
__title__: str = "openrouter"
__version__: str = "0.11.24"
__version__: str = "0.11.25"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.914.0"
__user_agent__: str = "speakeasy-sdk/python 0.11.24 2.914.0 1.0.0 openrouter"
__user_agent__: str = "speakeasy-sdk/python 0.11.25 2.914.0 1.0.0 openrouter"
try:
if __package__ is not None:
+62 -36
View File
@@ -1149,15 +1149,25 @@ if TYPE_CHECKING:
ImageGenCompletedEventType,
ImageGenCompletedEventTypedDict,
)
from .imagegenerationproviderpreferences import (
ImageGenerationProviderPreferences,
ImageGenerationProviderPreferencesIgnore,
ImageGenerationProviderPreferencesIgnoreTypedDict,
ImageGenerationProviderPreferencesOnly,
ImageGenerationProviderPreferencesOnlyTypedDict,
ImageGenerationProviderPreferencesOptions,
ImageGenerationProviderPreferencesOptionsTypedDict,
ImageGenerationProviderPreferencesOrder,
ImageGenerationProviderPreferencesOrderTypedDict,
ImageGenerationProviderPreferencesSort,
ImageGenerationProviderPreferencesSortTypedDict,
ImageGenerationProviderPreferencesTypedDict,
)
from .imagegenerationrequest import (
ImageGenerationRequest,
ImageGenerationRequestAspectRatio,
ImageGenerationRequestBackground,
ImageGenerationRequestOptions,
ImageGenerationRequestOptionsTypedDict,
ImageGenerationRequestOutputFormat,
ImageGenerationRequestProvider,
ImageGenerationRequestProviderTypedDict,
ImageGenerationRequestQuality,
ImageGenerationRequestResolution,
ImageGenerationRequestTypedDict,
@@ -2212,18 +2222,18 @@ if TYPE_CHECKING:
)
from .providerpreferences import (
DataCollection,
Ignore,
IgnoreTypedDict,
MaxPrice,
MaxPriceTypedDict,
Only,
OnlyTypedDict,
Order,
OrderTypedDict,
ProviderPreferences,
ProviderPreferencesIgnore,
ProviderPreferencesIgnoreTypedDict,
ProviderPreferencesOnly,
ProviderPreferencesOnlyTypedDict,
ProviderPreferencesOrder,
ProviderPreferencesOrderTypedDict,
ProviderPreferencesSort,
ProviderPreferencesSortTypedDict,
ProviderPreferencesTypedDict,
Sort,
SortTypedDict,
)
from .providerresponse import (
ProviderResponse,
@@ -3625,8 +3635,6 @@ __all__ = [
"Guardrail",
"GuardrailInterval",
"GuardrailTypedDict",
"Ignore",
"IgnoreTypedDict",
"ImageConfig",
"ImageConfigTypedDict",
"ImageEndpoint",
@@ -3658,14 +3666,22 @@ __all__ = [
"ImageGenTextChunkEventPhase",
"ImageGenTextChunkEventType",
"ImageGenTextChunkEventTypedDict",
"ImageGenerationProviderPreferences",
"ImageGenerationProviderPreferencesIgnore",
"ImageGenerationProviderPreferencesIgnoreTypedDict",
"ImageGenerationProviderPreferencesOnly",
"ImageGenerationProviderPreferencesOnlyTypedDict",
"ImageGenerationProviderPreferencesOptions",
"ImageGenerationProviderPreferencesOptionsTypedDict",
"ImageGenerationProviderPreferencesOrder",
"ImageGenerationProviderPreferencesOrderTypedDict",
"ImageGenerationProviderPreferencesSort",
"ImageGenerationProviderPreferencesSortTypedDict",
"ImageGenerationProviderPreferencesTypedDict",
"ImageGenerationRequest",
"ImageGenerationRequestAspectRatio",
"ImageGenerationRequestBackground",
"ImageGenerationRequestOptions",
"ImageGenerationRequestOptionsTypedDict",
"ImageGenerationRequestOutputFormat",
"ImageGenerationRequestProvider",
"ImageGenerationRequestProviderTypedDict",
"ImageGenerationRequestQuality",
"ImageGenerationRequestResolution",
"ImageGenerationRequestTypedDict",
@@ -4041,8 +4057,6 @@ __all__ = [
"ObservabilityWebhookDestinationConfigTypedDict",
"ObservabilityWebhookDestinationType",
"ObservabilityWebhookDestinationTypedDict",
"Only",
"OnlyTypedDict",
"OpenAIResponseCustomToolCall",
"OpenAIResponseCustomToolCallOutput",
"OpenAIResponseCustomToolCallOutputOutput1",
@@ -4119,8 +4133,6 @@ __all__ = [
"OpenRouterWebSearchServerToolType",
"OpenRouterWebSearchServerToolTypedDict",
"Operator",
"Order",
"OrderTypedDict",
"Outcome",
"OutcomeExit",
"OutcomeExitTypedDict",
@@ -4348,6 +4360,14 @@ __all__ = [
"ProviderOverloadedResponseErrorData",
"ProviderOverloadedResponseErrorDataTypedDict",
"ProviderPreferences",
"ProviderPreferencesIgnore",
"ProviderPreferencesIgnoreTypedDict",
"ProviderPreferencesOnly",
"ProviderPreferencesOnlyTypedDict",
"ProviderPreferencesOrder",
"ProviderPreferencesOrderTypedDict",
"ProviderPreferencesSort",
"ProviderPreferencesSortTypedDict",
"ProviderPreferencesTypedDict",
"ProviderResponse",
"ProviderResponseProviderName",
@@ -4534,8 +4554,6 @@ __all__ = [
"ShellServerToolOpenRouterTypedDict",
"ShellServerToolType",
"ShellServerToolTypedDict",
"Sort",
"SortTypedDict",
"SourceContent",
"SourceContentTypedDict",
"SourceType",
@@ -5694,14 +5712,22 @@ _dynamic_imports: dict[str, str] = {
"ImageGenCompletedEvent": ".imagegencompletedevent",
"ImageGenCompletedEventType": ".imagegencompletedevent",
"ImageGenCompletedEventTypedDict": ".imagegencompletedevent",
"ImageGenerationProviderPreferences": ".imagegenerationproviderpreferences",
"ImageGenerationProviderPreferencesIgnore": ".imagegenerationproviderpreferences",
"ImageGenerationProviderPreferencesIgnoreTypedDict": ".imagegenerationproviderpreferences",
"ImageGenerationProviderPreferencesOnly": ".imagegenerationproviderpreferences",
"ImageGenerationProviderPreferencesOnlyTypedDict": ".imagegenerationproviderpreferences",
"ImageGenerationProviderPreferencesOptions": ".imagegenerationproviderpreferences",
"ImageGenerationProviderPreferencesOptionsTypedDict": ".imagegenerationproviderpreferences",
"ImageGenerationProviderPreferencesOrder": ".imagegenerationproviderpreferences",
"ImageGenerationProviderPreferencesOrderTypedDict": ".imagegenerationproviderpreferences",
"ImageGenerationProviderPreferencesSort": ".imagegenerationproviderpreferences",
"ImageGenerationProviderPreferencesSortTypedDict": ".imagegenerationproviderpreferences",
"ImageGenerationProviderPreferencesTypedDict": ".imagegenerationproviderpreferences",
"ImageGenerationRequest": ".imagegenerationrequest",
"ImageGenerationRequestAspectRatio": ".imagegenerationrequest",
"ImageGenerationRequestBackground": ".imagegenerationrequest",
"ImageGenerationRequestOptions": ".imagegenerationrequest",
"ImageGenerationRequestOptionsTypedDict": ".imagegenerationrequest",
"ImageGenerationRequestOutputFormat": ".imagegenerationrequest",
"ImageGenerationRequestProvider": ".imagegenerationrequest",
"ImageGenerationRequestProviderTypedDict": ".imagegenerationrequest",
"ImageGenerationRequestQuality": ".imagegenerationrequest",
"ImageGenerationRequestResolution": ".imagegenerationrequest",
"ImageGenerationRequestTypedDict": ".imagegenerationrequest",
@@ -6529,18 +6555,18 @@ _dynamic_imports: dict[str, str] = {
"ProviderOverloadedResponseErrorData": ".provideroverloadedresponseerrordata",
"ProviderOverloadedResponseErrorDataTypedDict": ".provideroverloadedresponseerrordata",
"DataCollection": ".providerpreferences",
"Ignore": ".providerpreferences",
"IgnoreTypedDict": ".providerpreferences",
"MaxPrice": ".providerpreferences",
"MaxPriceTypedDict": ".providerpreferences",
"Only": ".providerpreferences",
"OnlyTypedDict": ".providerpreferences",
"Order": ".providerpreferences",
"OrderTypedDict": ".providerpreferences",
"ProviderPreferences": ".providerpreferences",
"ProviderPreferencesIgnore": ".providerpreferences",
"ProviderPreferencesIgnoreTypedDict": ".providerpreferences",
"ProviderPreferencesOnly": ".providerpreferences",
"ProviderPreferencesOnlyTypedDict": ".providerpreferences",
"ProviderPreferencesOrder": ".providerpreferences",
"ProviderPreferencesOrderTypedDict": ".providerpreferences",
"ProviderPreferencesSort": ".providerpreferences",
"ProviderPreferencesSortTypedDict": ".providerpreferences",
"ProviderPreferencesTypedDict": ".providerpreferences",
"Sort": ".providerpreferences",
"SortTypedDict": ".providerpreferences",
"ProviderResponse": ".providerresponse",
"ProviderResponseProviderName": ".providerresponse",
"ProviderResponseTypedDict": ".providerresponse",
@@ -0,0 +1,699 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .providername import ProviderName
from .providersort import ProviderSort
from .providersortconfig import ProviderSortConfig, ProviderSortConfigTypedDict
from openrouter.types import (
BaseModel,
Nullable,
OptionalNullable,
UNSET,
UNSET_SENTINEL,
)
import pydantic
from pydantic import model_serializer
from typing import Any, Dict, List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
ImageGenerationProviderPreferencesIgnoreTypedDict = TypeAliasType(
"ImageGenerationProviderPreferencesIgnoreTypedDict", Union[ProviderName, str]
)
ImageGenerationProviderPreferencesIgnore = TypeAliasType(
"ImageGenerationProviderPreferencesIgnore", Union[ProviderName, str]
)
ImageGenerationProviderPreferencesOnlyTypedDict = TypeAliasType(
"ImageGenerationProviderPreferencesOnlyTypedDict", Union[ProviderName, str]
)
ImageGenerationProviderPreferencesOnly = TypeAliasType(
"ImageGenerationProviderPreferencesOnly", Union[ProviderName, str]
)
class ImageGenerationProviderPreferencesOptionsTypedDict(TypedDict):
r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."""
oneai: NotRequired[Dict[str, Nullable[Any]]]
ai21: NotRequired[Dict[str, Nullable[Any]]]
aion_labs: NotRequired[Dict[str, Nullable[Any]]]
akashml: NotRequired[Dict[str, Nullable[Any]]]
alibaba: NotRequired[Dict[str, Nullable[Any]]]
amazon_bedrock: NotRequired[Dict[str, Nullable[Any]]]
amazon_nova: NotRequired[Dict[str, Nullable[Any]]]
ambient: NotRequired[Dict[str, Nullable[Any]]]
anthropic: NotRequired[Dict[str, Nullable[Any]]]
anyscale: NotRequired[Dict[str, Nullable[Any]]]
arcee_ai: NotRequired[Dict[str, Nullable[Any]]]
atlas_cloud: NotRequired[Dict[str, Nullable[Any]]]
atoma: NotRequired[Dict[str, Nullable[Any]]]
avian: NotRequired[Dict[str, Nullable[Any]]]
azure: NotRequired[Dict[str, Nullable[Any]]]
baidu: NotRequired[Dict[str, Nullable[Any]]]
baseten: NotRequired[Dict[str, Nullable[Any]]]
black_forest_labs: NotRequired[Dict[str, Nullable[Any]]]
byteplus: NotRequired[Dict[str, Nullable[Any]]]
centml: NotRequired[Dict[str, Nullable[Any]]]
cerebras: NotRequired[Dict[str, Nullable[Any]]]
chutes: NotRequired[Dict[str, Nullable[Any]]]
cirrascale: NotRequired[Dict[str, Nullable[Any]]]
clarifai: NotRequired[Dict[str, Nullable[Any]]]
cloudflare: NotRequired[Dict[str, Nullable[Any]]]
cohere: NotRequired[Dict[str, Nullable[Any]]]
crofai: NotRequired[Dict[str, Nullable[Any]]]
crucible: NotRequired[Dict[str, Nullable[Any]]]
crusoe: NotRequired[Dict[str, Nullable[Any]]]
darkbloom: NotRequired[Dict[str, Nullable[Any]]]
decart: NotRequired[Dict[str, Nullable[Any]]]
deepgram: NotRequired[Dict[str, Nullable[Any]]]
deepinfra: NotRequired[Dict[str, Nullable[Any]]]
deepseek: NotRequired[Dict[str, Nullable[Any]]]
dekallm: NotRequired[Dict[str, Nullable[Any]]]
digitalocean: NotRequired[Dict[str, Nullable[Any]]]
enfer: NotRequired[Dict[str, Nullable[Any]]]
fake_provider: NotRequired[Dict[str, Nullable[Any]]]
featherless: NotRequired[Dict[str, Nullable[Any]]]
fireworks: NotRequired[Dict[str, Nullable[Any]]]
friendli: NotRequired[Dict[str, Nullable[Any]]]
gmicloud: NotRequired[Dict[str, Nullable[Any]]]
google_ai_studio: NotRequired[Dict[str, Nullable[Any]]]
google_vertex: NotRequired[Dict[str, Nullable[Any]]]
gopomelo: NotRequired[Dict[str, Nullable[Any]]]
groq: NotRequired[Dict[str, Nullable[Any]]]
heygen: NotRequired[Dict[str, Nullable[Any]]]
huggingface: NotRequired[Dict[str, Nullable[Any]]]
hyperbolic: NotRequired[Dict[str, Nullable[Any]]]
hyperbolic_quantized: NotRequired[Dict[str, Nullable[Any]]]
inception: NotRequired[Dict[str, Nullable[Any]]]
inceptron: NotRequired[Dict[str, Nullable[Any]]]
inferact_vllm: NotRequired[Dict[str, Nullable[Any]]]
inference_net: NotRequired[Dict[str, Nullable[Any]]]
infermatic: NotRequired[Dict[str, Nullable[Any]]]
inflection: NotRequired[Dict[str, Nullable[Any]]]
inocloud: NotRequired[Dict[str, Nullable[Any]]]
io_net: NotRequired[Dict[str, Nullable[Any]]]
ionstream: NotRequired[Dict[str, Nullable[Any]]]
klusterai: NotRequired[Dict[str, Nullable[Any]]]
lambda_: NotRequired[Dict[str, Nullable[Any]]]
lepton: NotRequired[Dict[str, Nullable[Any]]]
liquid: NotRequired[Dict[str, Nullable[Any]]]
lynn: NotRequired[Dict[str, Nullable[Any]]]
lynn_private: NotRequired[Dict[str, Nullable[Any]]]
mancer: NotRequired[Dict[str, Nullable[Any]]]
mancer_old: NotRequired[Dict[str, Nullable[Any]]]
mara: NotRequired[Dict[str, Nullable[Any]]]
meta: NotRequired[Dict[str, Nullable[Any]]]
minimax: NotRequired[Dict[str, Nullable[Any]]]
mistral: NotRequired[Dict[str, Nullable[Any]]]
modal: NotRequired[Dict[str, Nullable[Any]]]
modelrun: NotRequired[Dict[str, Nullable[Any]]]
modular: NotRequired[Dict[str, Nullable[Any]]]
moonshotai: NotRequired[Dict[str, Nullable[Any]]]
morph: NotRequired[Dict[str, Nullable[Any]]]
ncompass: NotRequired[Dict[str, Nullable[Any]]]
nebius: NotRequired[Dict[str, Nullable[Any]]]
nex_agi: NotRequired[Dict[str, Nullable[Any]]]
nextbit: NotRequired[Dict[str, Nullable[Any]]]
nineteen: NotRequired[Dict[str, Nullable[Any]]]
novita: NotRequired[Dict[str, Nullable[Any]]]
nvidia: NotRequired[Dict[str, Nullable[Any]]]
octoai: NotRequired[Dict[str, Nullable[Any]]]
open_inference: NotRequired[Dict[str, Nullable[Any]]]
openai: NotRequired[Dict[str, Nullable[Any]]]
parasail: NotRequired[Dict[str, Nullable[Any]]]
perceptron: NotRequired[Dict[str, Nullable[Any]]]
perplexity: NotRequired[Dict[str, Nullable[Any]]]
phala: NotRequired[Dict[str, Nullable[Any]]]
poolside: NotRequired[Dict[str, Nullable[Any]]]
quiver: NotRequired[Dict[str, Nullable[Any]]]
recraft: NotRequired[Dict[str, Nullable[Any]]]
recursal: NotRequired[Dict[str, Nullable[Any]]]
reflection: NotRequired[Dict[str, Nullable[Any]]]
reka: NotRequired[Dict[str, Nullable[Any]]]
relace: NotRequired[Dict[str, Nullable[Any]]]
replicate: NotRequired[Dict[str, Nullable[Any]]]
sakana: NotRequired[Dict[str, Nullable[Any]]]
sambanova: NotRequired[Dict[str, Nullable[Any]]]
sambanova_cloaked: NotRequired[Dict[str, Nullable[Any]]]
seed: NotRequired[Dict[str, Nullable[Any]]]
sf_compute: NotRequired[Dict[str, Nullable[Any]]]
siliconflow: NotRequired[Dict[str, Nullable[Any]]]
sourceful: NotRequired[Dict[str, Nullable[Any]]]
stealth: NotRequired[Dict[str, Nullable[Any]]]
stepfun: NotRequired[Dict[str, Nullable[Any]]]
streamlake: NotRequired[Dict[str, Nullable[Any]]]
switchpoint: NotRequired[Dict[str, Nullable[Any]]]
targon: NotRequired[Dict[str, Nullable[Any]]]
tenstorrent: NotRequired[Dict[str, Nullable[Any]]]
together: NotRequired[Dict[str, Nullable[Any]]]
together_lite: NotRequired[Dict[str, Nullable[Any]]]
ubicloud: NotRequired[Dict[str, Nullable[Any]]]
upstage: NotRequired[Dict[str, Nullable[Any]]]
venice: NotRequired[Dict[str, Nullable[Any]]]
wafer: NotRequired[Dict[str, Nullable[Any]]]
wandb: NotRequired[Dict[str, Nullable[Any]]]
xai: NotRequired[Dict[str, Nullable[Any]]]
xiaomi: NotRequired[Dict[str, Nullable[Any]]]
z_ai: NotRequired[Dict[str, Nullable[Any]]]
class ImageGenerationProviderPreferencesOptions(BaseModel):
r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."""
oneai: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="01ai")
] = None
ai21: Optional[Dict[str, Nullable[Any]]] = None
aion_labs: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="aion-labs")
] = None
akashml: Optional[Dict[str, Nullable[Any]]] = None
alibaba: Optional[Dict[str, Nullable[Any]]] = None
amazon_bedrock: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="amazon-bedrock")
] = None
amazon_nova: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="amazon-nova")
] = None
ambient: Optional[Dict[str, Nullable[Any]]] = None
anthropic: Optional[Dict[str, Nullable[Any]]] = None
anyscale: Optional[Dict[str, Nullable[Any]]] = None
arcee_ai: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="arcee-ai")
] = None
atlas_cloud: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="atlas-cloud")
] = None
atoma: Optional[Dict[str, Nullable[Any]]] = None
avian: Optional[Dict[str, Nullable[Any]]] = None
azure: Optional[Dict[str, Nullable[Any]]] = None
baidu: Optional[Dict[str, Nullable[Any]]] = None
baseten: Optional[Dict[str, Nullable[Any]]] = None
black_forest_labs: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="black-forest-labs")
] = None
byteplus: Optional[Dict[str, Nullable[Any]]] = None
centml: Optional[Dict[str, Nullable[Any]]] = None
cerebras: Optional[Dict[str, Nullable[Any]]] = None
chutes: Optional[Dict[str, Nullable[Any]]] = None
cirrascale: Optional[Dict[str, Nullable[Any]]] = None
clarifai: Optional[Dict[str, Nullable[Any]]] = None
cloudflare: Optional[Dict[str, Nullable[Any]]] = None
cohere: Optional[Dict[str, Nullable[Any]]] = None
crofai: Optional[Dict[str, Nullable[Any]]] = None
crucible: Optional[Dict[str, Nullable[Any]]] = None
crusoe: Optional[Dict[str, Nullable[Any]]] = None
darkbloom: Optional[Dict[str, Nullable[Any]]] = None
decart: Optional[Dict[str, Nullable[Any]]] = None
deepgram: Optional[Dict[str, Nullable[Any]]] = None
deepinfra: Optional[Dict[str, Nullable[Any]]] = None
deepseek: Optional[Dict[str, Nullable[Any]]] = None
dekallm: Optional[Dict[str, Nullable[Any]]] = None
digitalocean: Optional[Dict[str, Nullable[Any]]] = None
enfer: Optional[Dict[str, Nullable[Any]]] = None
fake_provider: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="fake-provider")
] = None
featherless: Optional[Dict[str, Nullable[Any]]] = None
fireworks: Optional[Dict[str, Nullable[Any]]] = None
friendli: Optional[Dict[str, Nullable[Any]]] = None
gmicloud: Optional[Dict[str, Nullable[Any]]] = None
google_ai_studio: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="google-ai-studio")
] = None
google_vertex: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="google-vertex")
] = None
gopomelo: Optional[Dict[str, Nullable[Any]]] = None
groq: Optional[Dict[str, Nullable[Any]]] = None
heygen: Optional[Dict[str, Nullable[Any]]] = None
huggingface: Optional[Dict[str, Nullable[Any]]] = None
hyperbolic: Optional[Dict[str, Nullable[Any]]] = None
hyperbolic_quantized: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="hyperbolic-quantized")
] = None
inception: Optional[Dict[str, Nullable[Any]]] = None
inceptron: Optional[Dict[str, Nullable[Any]]] = None
inferact_vllm: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inferact-vllm")
] = None
inference_net: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inference-net")
] = None
infermatic: Optional[Dict[str, Nullable[Any]]] = None
inflection: Optional[Dict[str, Nullable[Any]]] = None
inocloud: Optional[Dict[str, Nullable[Any]]] = None
io_net: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="io-net")
] = None
ionstream: Optional[Dict[str, Nullable[Any]]] = None
klusterai: Optional[Dict[str, Nullable[Any]]] = None
lambda_: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="lambda")
] = None
lepton: Optional[Dict[str, Nullable[Any]]] = None
liquid: Optional[Dict[str, Nullable[Any]]] = None
lynn: Optional[Dict[str, Nullable[Any]]] = None
lynn_private: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="lynn-private")
] = None
mancer: Optional[Dict[str, Nullable[Any]]] = None
mancer_old: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="mancer-old")
] = None
mara: Optional[Dict[str, Nullable[Any]]] = None
meta: Optional[Dict[str, Nullable[Any]]] = None
minimax: Optional[Dict[str, Nullable[Any]]] = None
mistral: Optional[Dict[str, Nullable[Any]]] = None
modal: Optional[Dict[str, Nullable[Any]]] = None
modelrun: Optional[Dict[str, Nullable[Any]]] = None
modular: Optional[Dict[str, Nullable[Any]]] = None
moonshotai: Optional[Dict[str, Nullable[Any]]] = None
morph: Optional[Dict[str, Nullable[Any]]] = None
ncompass: Optional[Dict[str, Nullable[Any]]] = None
nebius: Optional[Dict[str, Nullable[Any]]] = None
nex_agi: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="nex-agi")
] = None
nextbit: Optional[Dict[str, Nullable[Any]]] = None
nineteen: Optional[Dict[str, Nullable[Any]]] = None
novita: Optional[Dict[str, Nullable[Any]]] = None
nvidia: Optional[Dict[str, Nullable[Any]]] = None
octoai: Optional[Dict[str, Nullable[Any]]] = None
open_inference: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="open-inference")
] = None
openai: Optional[Dict[str, Nullable[Any]]] = None
parasail: Optional[Dict[str, Nullable[Any]]] = None
perceptron: Optional[Dict[str, Nullable[Any]]] = None
perplexity: Optional[Dict[str, Nullable[Any]]] = None
phala: Optional[Dict[str, Nullable[Any]]] = None
poolside: Optional[Dict[str, Nullable[Any]]] = None
quiver: Optional[Dict[str, Nullable[Any]]] = None
recraft: Optional[Dict[str, Nullable[Any]]] = None
recursal: Optional[Dict[str, Nullable[Any]]] = None
reflection: Optional[Dict[str, Nullable[Any]]] = None
reka: Optional[Dict[str, Nullable[Any]]] = None
relace: Optional[Dict[str, Nullable[Any]]] = None
replicate: Optional[Dict[str, Nullable[Any]]] = None
sakana: Optional[Dict[str, Nullable[Any]]] = None
sambanova: Optional[Dict[str, Nullable[Any]]] = None
sambanova_cloaked: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sambanova-cloaked")
] = None
seed: Optional[Dict[str, Nullable[Any]]] = None
sf_compute: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sf-compute")
] = None
siliconflow: Optional[Dict[str, Nullable[Any]]] = None
sourceful: Optional[Dict[str, Nullable[Any]]] = None
stealth: Optional[Dict[str, Nullable[Any]]] = None
stepfun: Optional[Dict[str, Nullable[Any]]] = None
streamlake: Optional[Dict[str, Nullable[Any]]] = None
switchpoint: Optional[Dict[str, Nullable[Any]]] = None
targon: Optional[Dict[str, Nullable[Any]]] = None
tenstorrent: Optional[Dict[str, Nullable[Any]]] = None
together: Optional[Dict[str, Nullable[Any]]] = None
together_lite: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="together-lite")
] = None
ubicloud: Optional[Dict[str, Nullable[Any]]] = None
upstage: Optional[Dict[str, Nullable[Any]]] = None
venice: Optional[Dict[str, Nullable[Any]]] = None
wafer: Optional[Dict[str, Nullable[Any]]] = None
wandb: Optional[Dict[str, Nullable[Any]]] = None
xai: Optional[Dict[str, Nullable[Any]]] = None
xiaomi: Optional[Dict[str, Nullable[Any]]] = None
z_ai: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="z-ai")
] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
[
"01ai",
"ai21",
"aion-labs",
"akashml",
"alibaba",
"amazon-bedrock",
"amazon-nova",
"ambient",
"anthropic",
"anyscale",
"arcee-ai",
"atlas-cloud",
"atoma",
"avian",
"azure",
"baidu",
"baseten",
"black-forest-labs",
"byteplus",
"centml",
"cerebras",
"chutes",
"cirrascale",
"clarifai",
"cloudflare",
"cohere",
"crofai",
"crucible",
"crusoe",
"darkbloom",
"decart",
"deepgram",
"deepinfra",
"deepseek",
"dekallm",
"digitalocean",
"enfer",
"fake-provider",
"featherless",
"fireworks",
"friendli",
"gmicloud",
"google-ai-studio",
"google-vertex",
"gopomelo",
"groq",
"heygen",
"huggingface",
"hyperbolic",
"hyperbolic-quantized",
"inception",
"inceptron",
"inferact-vllm",
"inference-net",
"infermatic",
"inflection",
"inocloud",
"io-net",
"ionstream",
"klusterai",
"lambda",
"lepton",
"liquid",
"lynn",
"lynn-private",
"mancer",
"mancer-old",
"mara",
"meta",
"minimax",
"mistral",
"modal",
"modelrun",
"modular",
"moonshotai",
"morph",
"ncompass",
"nebius",
"nex-agi",
"nextbit",
"nineteen",
"novita",
"nvidia",
"octoai",
"open-inference",
"openai",
"parasail",
"perceptron",
"perplexity",
"phala",
"poolside",
"quiver",
"recraft",
"recursal",
"reflection",
"reka",
"relace",
"replicate",
"sakana",
"sambanova",
"sambanova-cloaked",
"seed",
"sf-compute",
"siliconflow",
"sourceful",
"stealth",
"stepfun",
"streamlake",
"switchpoint",
"targon",
"tenstorrent",
"together",
"together-lite",
"ubicloud",
"upstage",
"venice",
"wafer",
"wandb",
"xai",
"xiaomi",
"z-ai",
]
)
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k, serialized.get(n))
if val != UNSET_SENTINEL:
if val is not None or k not in optional_fields:
m[k] = val
return m
ImageGenerationProviderPreferencesOrderTypedDict = TypeAliasType(
"ImageGenerationProviderPreferencesOrderTypedDict", Union[ProviderName, str]
)
ImageGenerationProviderPreferencesOrder = TypeAliasType(
"ImageGenerationProviderPreferencesOrder", Union[ProviderName, str]
)
ImageGenerationProviderPreferencesSortTypedDict = TypeAliasType(
"ImageGenerationProviderPreferencesSortTypedDict",
Union[ProviderSortConfigTypedDict, ProviderSort, Any],
)
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
ImageGenerationProviderPreferencesSort = TypeAliasType(
"ImageGenerationProviderPreferencesSort",
Union[ProviderSortConfig, ProviderSort, Any],
)
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
class ImageGenerationProviderPreferencesTypedDict(TypedDict):
r"""Provider routing preferences and provider-specific passthrough configuration."""
allow_fallbacks: NotRequired[Nullable[bool]]
r"""Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
"""
ignore: NotRequired[
Nullable[List[ImageGenerationProviderPreferencesIgnoreTypedDict]]
]
r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
only: NotRequired[Nullable[List[ImageGenerationProviderPreferencesOnlyTypedDict]]]
r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
options: NotRequired[ImageGenerationProviderPreferencesOptionsTypedDict]
order: NotRequired[Nullable[List[ImageGenerationProviderPreferencesOrderTypedDict]]]
r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."""
sort: NotRequired[Nullable[ImageGenerationProviderPreferencesSortTypedDict]]
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
class ImageGenerationProviderPreferences(BaseModel):
r"""Provider routing preferences and provider-specific passthrough configuration."""
allow_fallbacks: OptionalNullable[bool] = UNSET
r"""Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
"""
ignore: OptionalNullable[List[ImageGenerationProviderPreferencesIgnore]] = UNSET
r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
only: OptionalNullable[List[ImageGenerationProviderPreferencesOnly]] = UNSET
r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
options: Optional[ImageGenerationProviderPreferencesOptions] = None
order: OptionalNullable[List[ImageGenerationProviderPreferencesOrder]] = UNSET
r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."""
sort: OptionalNullable[ImageGenerationProviderPreferencesSort] = UNSET
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
["allow_fallbacks", "ignore", "only", "options", "order", "sort"]
)
nullable_fields = set(["allow_fallbacks", "ignore", "only", "order", "sort"])
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k, serialized.get(n))
is_nullable_and_explicitly_set = (
k in nullable_fields
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
)
if val != UNSET_SENTINEL:
if (
val is not None
or k not in optional_fields
or is_nullable_and_explicitly_set
):
m[k] = val
return m
try:
ImageGenerationProviderPreferencesOptions.model_rebuild()
except NameError:
pass
@@ -2,11 +2,14 @@
from __future__ import annotations
from .contentpartimage import ContentPartImage, ContentPartImageTypedDict
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr
import pydantic
from .imagegenerationproviderpreferences import (
ImageGenerationProviderPreferences,
ImageGenerationProviderPreferencesTypedDict,
)
from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr
from pydantic import model_serializer
from typing import Any, Dict, List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict
from typing import List, Literal, Optional, Union
from typing_extensions import NotRequired, TypedDict
ImageGenerationRequestAspectRatio = Union[
@@ -62,592 +65,6 @@ ImageGenerationRequestOutputFormat = Union[
r"""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`."""
class ImageGenerationRequestOptionsTypedDict(TypedDict):
r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."""
oneai: NotRequired[Dict[str, Nullable[Any]]]
ai21: NotRequired[Dict[str, Nullable[Any]]]
aion_labs: NotRequired[Dict[str, Nullable[Any]]]
akashml: NotRequired[Dict[str, Nullable[Any]]]
alibaba: NotRequired[Dict[str, Nullable[Any]]]
amazon_bedrock: NotRequired[Dict[str, Nullable[Any]]]
amazon_nova: NotRequired[Dict[str, Nullable[Any]]]
ambient: NotRequired[Dict[str, Nullable[Any]]]
anthropic: NotRequired[Dict[str, Nullable[Any]]]
anyscale: NotRequired[Dict[str, Nullable[Any]]]
arcee_ai: NotRequired[Dict[str, Nullable[Any]]]
atlas_cloud: NotRequired[Dict[str, Nullable[Any]]]
atoma: NotRequired[Dict[str, Nullable[Any]]]
avian: NotRequired[Dict[str, Nullable[Any]]]
azure: NotRequired[Dict[str, Nullable[Any]]]
baidu: NotRequired[Dict[str, Nullable[Any]]]
baseten: NotRequired[Dict[str, Nullable[Any]]]
black_forest_labs: NotRequired[Dict[str, Nullable[Any]]]
byteplus: NotRequired[Dict[str, Nullable[Any]]]
centml: NotRequired[Dict[str, Nullable[Any]]]
cerebras: NotRequired[Dict[str, Nullable[Any]]]
chutes: NotRequired[Dict[str, Nullable[Any]]]
cirrascale: NotRequired[Dict[str, Nullable[Any]]]
clarifai: NotRequired[Dict[str, Nullable[Any]]]
cloudflare: NotRequired[Dict[str, Nullable[Any]]]
cohere: NotRequired[Dict[str, Nullable[Any]]]
crofai: NotRequired[Dict[str, Nullable[Any]]]
crucible: NotRequired[Dict[str, Nullable[Any]]]
crusoe: NotRequired[Dict[str, Nullable[Any]]]
darkbloom: NotRequired[Dict[str, Nullable[Any]]]
decart: NotRequired[Dict[str, Nullable[Any]]]
deepgram: NotRequired[Dict[str, Nullable[Any]]]
deepinfra: NotRequired[Dict[str, Nullable[Any]]]
deepseek: NotRequired[Dict[str, Nullable[Any]]]
dekallm: NotRequired[Dict[str, Nullable[Any]]]
digitalocean: NotRequired[Dict[str, Nullable[Any]]]
enfer: NotRequired[Dict[str, Nullable[Any]]]
fake_provider: NotRequired[Dict[str, Nullable[Any]]]
featherless: NotRequired[Dict[str, Nullable[Any]]]
fireworks: NotRequired[Dict[str, Nullable[Any]]]
friendli: NotRequired[Dict[str, Nullable[Any]]]
gmicloud: NotRequired[Dict[str, Nullable[Any]]]
google_ai_studio: NotRequired[Dict[str, Nullable[Any]]]
google_vertex: NotRequired[Dict[str, Nullable[Any]]]
gopomelo: NotRequired[Dict[str, Nullable[Any]]]
groq: NotRequired[Dict[str, Nullable[Any]]]
heygen: NotRequired[Dict[str, Nullable[Any]]]
huggingface: NotRequired[Dict[str, Nullable[Any]]]
hyperbolic: NotRequired[Dict[str, Nullable[Any]]]
hyperbolic_quantized: NotRequired[Dict[str, Nullable[Any]]]
inception: NotRequired[Dict[str, Nullable[Any]]]
inceptron: NotRequired[Dict[str, Nullable[Any]]]
inferact_vllm: NotRequired[Dict[str, Nullable[Any]]]
inference_net: NotRequired[Dict[str, Nullable[Any]]]
infermatic: NotRequired[Dict[str, Nullable[Any]]]
inflection: NotRequired[Dict[str, Nullable[Any]]]
inocloud: NotRequired[Dict[str, Nullable[Any]]]
io_net: NotRequired[Dict[str, Nullable[Any]]]
ionstream: NotRequired[Dict[str, Nullable[Any]]]
klusterai: NotRequired[Dict[str, Nullable[Any]]]
lambda_: NotRequired[Dict[str, Nullable[Any]]]
lepton: NotRequired[Dict[str, Nullable[Any]]]
liquid: NotRequired[Dict[str, Nullable[Any]]]
lynn: NotRequired[Dict[str, Nullable[Any]]]
lynn_private: NotRequired[Dict[str, Nullable[Any]]]
mancer: NotRequired[Dict[str, Nullable[Any]]]
mancer_old: NotRequired[Dict[str, Nullable[Any]]]
mara: NotRequired[Dict[str, Nullable[Any]]]
meta: NotRequired[Dict[str, Nullable[Any]]]
minimax: NotRequired[Dict[str, Nullable[Any]]]
mistral: NotRequired[Dict[str, Nullable[Any]]]
modal: NotRequired[Dict[str, Nullable[Any]]]
modelrun: NotRequired[Dict[str, Nullable[Any]]]
modular: NotRequired[Dict[str, Nullable[Any]]]
moonshotai: NotRequired[Dict[str, Nullable[Any]]]
morph: NotRequired[Dict[str, Nullable[Any]]]
ncompass: NotRequired[Dict[str, Nullable[Any]]]
nebius: NotRequired[Dict[str, Nullable[Any]]]
nex_agi: NotRequired[Dict[str, Nullable[Any]]]
nextbit: NotRequired[Dict[str, Nullable[Any]]]
nineteen: NotRequired[Dict[str, Nullable[Any]]]
novita: NotRequired[Dict[str, Nullable[Any]]]
nvidia: NotRequired[Dict[str, Nullable[Any]]]
octoai: NotRequired[Dict[str, Nullable[Any]]]
open_inference: NotRequired[Dict[str, Nullable[Any]]]
openai: NotRequired[Dict[str, Nullable[Any]]]
parasail: NotRequired[Dict[str, Nullable[Any]]]
perceptron: NotRequired[Dict[str, Nullable[Any]]]
perplexity: NotRequired[Dict[str, Nullable[Any]]]
phala: NotRequired[Dict[str, Nullable[Any]]]
poolside: NotRequired[Dict[str, Nullable[Any]]]
quiver: NotRequired[Dict[str, Nullable[Any]]]
recraft: NotRequired[Dict[str, Nullable[Any]]]
recursal: NotRequired[Dict[str, Nullable[Any]]]
reflection: NotRequired[Dict[str, Nullable[Any]]]
reka: NotRequired[Dict[str, Nullable[Any]]]
relace: NotRequired[Dict[str, Nullable[Any]]]
replicate: NotRequired[Dict[str, Nullable[Any]]]
sakana: NotRequired[Dict[str, Nullable[Any]]]
sambanova: NotRequired[Dict[str, Nullable[Any]]]
sambanova_cloaked: NotRequired[Dict[str, Nullable[Any]]]
seed: NotRequired[Dict[str, Nullable[Any]]]
sf_compute: NotRequired[Dict[str, Nullable[Any]]]
siliconflow: NotRequired[Dict[str, Nullable[Any]]]
sourceful: NotRequired[Dict[str, Nullable[Any]]]
stealth: NotRequired[Dict[str, Nullable[Any]]]
stepfun: NotRequired[Dict[str, Nullable[Any]]]
streamlake: NotRequired[Dict[str, Nullable[Any]]]
switchpoint: NotRequired[Dict[str, Nullable[Any]]]
targon: NotRequired[Dict[str, Nullable[Any]]]
tenstorrent: NotRequired[Dict[str, Nullable[Any]]]
together: NotRequired[Dict[str, Nullable[Any]]]
together_lite: NotRequired[Dict[str, Nullable[Any]]]
ubicloud: NotRequired[Dict[str, Nullable[Any]]]
upstage: NotRequired[Dict[str, Nullable[Any]]]
venice: NotRequired[Dict[str, Nullable[Any]]]
wafer: NotRequired[Dict[str, Nullable[Any]]]
wandb: NotRequired[Dict[str, Nullable[Any]]]
xai: NotRequired[Dict[str, Nullable[Any]]]
xiaomi: NotRequired[Dict[str, Nullable[Any]]]
z_ai: NotRequired[Dict[str, Nullable[Any]]]
class ImageGenerationRequestOptions(BaseModel):
r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."""
oneai: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="01ai")
] = None
ai21: Optional[Dict[str, Nullable[Any]]] = None
aion_labs: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="aion-labs")
] = None
akashml: Optional[Dict[str, Nullable[Any]]] = None
alibaba: Optional[Dict[str, Nullable[Any]]] = None
amazon_bedrock: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="amazon-bedrock")
] = None
amazon_nova: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="amazon-nova")
] = None
ambient: Optional[Dict[str, Nullable[Any]]] = None
anthropic: Optional[Dict[str, Nullable[Any]]] = None
anyscale: Optional[Dict[str, Nullable[Any]]] = None
arcee_ai: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="arcee-ai")
] = None
atlas_cloud: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="atlas-cloud")
] = None
atoma: Optional[Dict[str, Nullable[Any]]] = None
avian: Optional[Dict[str, Nullable[Any]]] = None
azure: Optional[Dict[str, Nullable[Any]]] = None
baidu: Optional[Dict[str, Nullable[Any]]] = None
baseten: Optional[Dict[str, Nullable[Any]]] = None
black_forest_labs: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="black-forest-labs")
] = None
byteplus: Optional[Dict[str, Nullable[Any]]] = None
centml: Optional[Dict[str, Nullable[Any]]] = None
cerebras: Optional[Dict[str, Nullable[Any]]] = None
chutes: Optional[Dict[str, Nullable[Any]]] = None
cirrascale: Optional[Dict[str, Nullable[Any]]] = None
clarifai: Optional[Dict[str, Nullable[Any]]] = None
cloudflare: Optional[Dict[str, Nullable[Any]]] = None
cohere: Optional[Dict[str, Nullable[Any]]] = None
crofai: Optional[Dict[str, Nullable[Any]]] = None
crucible: Optional[Dict[str, Nullable[Any]]] = None
crusoe: Optional[Dict[str, Nullable[Any]]] = None
darkbloom: Optional[Dict[str, Nullable[Any]]] = None
decart: Optional[Dict[str, Nullable[Any]]] = None
deepgram: Optional[Dict[str, Nullable[Any]]] = None
deepinfra: Optional[Dict[str, Nullable[Any]]] = None
deepseek: Optional[Dict[str, Nullable[Any]]] = None
dekallm: Optional[Dict[str, Nullable[Any]]] = None
digitalocean: Optional[Dict[str, Nullable[Any]]] = None
enfer: Optional[Dict[str, Nullable[Any]]] = None
fake_provider: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="fake-provider")
] = None
featherless: Optional[Dict[str, Nullable[Any]]] = None
fireworks: Optional[Dict[str, Nullable[Any]]] = None
friendli: Optional[Dict[str, Nullable[Any]]] = None
gmicloud: Optional[Dict[str, Nullable[Any]]] = None
google_ai_studio: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="google-ai-studio")
] = None
google_vertex: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="google-vertex")
] = None
gopomelo: Optional[Dict[str, Nullable[Any]]] = None
groq: Optional[Dict[str, Nullable[Any]]] = None
heygen: Optional[Dict[str, Nullable[Any]]] = None
huggingface: Optional[Dict[str, Nullable[Any]]] = None
hyperbolic: Optional[Dict[str, Nullable[Any]]] = None
hyperbolic_quantized: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="hyperbolic-quantized")
] = None
inception: Optional[Dict[str, Nullable[Any]]] = None
inceptron: Optional[Dict[str, Nullable[Any]]] = None
inferact_vllm: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inferact-vllm")
] = None
inference_net: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inference-net")
] = None
infermatic: Optional[Dict[str, Nullable[Any]]] = None
inflection: Optional[Dict[str, Nullable[Any]]] = None
inocloud: Optional[Dict[str, Nullable[Any]]] = None
io_net: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="io-net")
] = None
ionstream: Optional[Dict[str, Nullable[Any]]] = None
klusterai: Optional[Dict[str, Nullable[Any]]] = None
lambda_: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="lambda")
] = None
lepton: Optional[Dict[str, Nullable[Any]]] = None
liquid: Optional[Dict[str, Nullable[Any]]] = None
lynn: Optional[Dict[str, Nullable[Any]]] = None
lynn_private: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="lynn-private")
] = None
mancer: Optional[Dict[str, Nullable[Any]]] = None
mancer_old: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="mancer-old")
] = None
mara: Optional[Dict[str, Nullable[Any]]] = None
meta: Optional[Dict[str, Nullable[Any]]] = None
minimax: Optional[Dict[str, Nullable[Any]]] = None
mistral: Optional[Dict[str, Nullable[Any]]] = None
modal: Optional[Dict[str, Nullable[Any]]] = None
modelrun: Optional[Dict[str, Nullable[Any]]] = None
modular: Optional[Dict[str, Nullable[Any]]] = None
moonshotai: Optional[Dict[str, Nullable[Any]]] = None
morph: Optional[Dict[str, Nullable[Any]]] = None
ncompass: Optional[Dict[str, Nullable[Any]]] = None
nebius: Optional[Dict[str, Nullable[Any]]] = None
nex_agi: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="nex-agi")
] = None
nextbit: Optional[Dict[str, Nullable[Any]]] = None
nineteen: Optional[Dict[str, Nullable[Any]]] = None
novita: Optional[Dict[str, Nullable[Any]]] = None
nvidia: Optional[Dict[str, Nullable[Any]]] = None
octoai: Optional[Dict[str, Nullable[Any]]] = None
open_inference: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="open-inference")
] = None
openai: Optional[Dict[str, Nullable[Any]]] = None
parasail: Optional[Dict[str, Nullable[Any]]] = None
perceptron: Optional[Dict[str, Nullable[Any]]] = None
perplexity: Optional[Dict[str, Nullable[Any]]] = None
phala: Optional[Dict[str, Nullable[Any]]] = None
poolside: Optional[Dict[str, Nullable[Any]]] = None
quiver: Optional[Dict[str, Nullable[Any]]] = None
recraft: Optional[Dict[str, Nullable[Any]]] = None
recursal: Optional[Dict[str, Nullable[Any]]] = None
reflection: Optional[Dict[str, Nullable[Any]]] = None
reka: Optional[Dict[str, Nullable[Any]]] = None
relace: Optional[Dict[str, Nullable[Any]]] = None
replicate: Optional[Dict[str, Nullable[Any]]] = None
sakana: Optional[Dict[str, Nullable[Any]]] = None
sambanova: Optional[Dict[str, Nullable[Any]]] = None
sambanova_cloaked: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sambanova-cloaked")
] = None
seed: Optional[Dict[str, Nullable[Any]]] = None
sf_compute: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sf-compute")
] = None
siliconflow: Optional[Dict[str, Nullable[Any]]] = None
sourceful: Optional[Dict[str, Nullable[Any]]] = None
stealth: Optional[Dict[str, Nullable[Any]]] = None
stepfun: Optional[Dict[str, Nullable[Any]]] = None
streamlake: Optional[Dict[str, Nullable[Any]]] = None
switchpoint: Optional[Dict[str, Nullable[Any]]] = None
targon: Optional[Dict[str, Nullable[Any]]] = None
tenstorrent: Optional[Dict[str, Nullable[Any]]] = None
together: Optional[Dict[str, Nullable[Any]]] = None
together_lite: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="together-lite")
] = None
ubicloud: Optional[Dict[str, Nullable[Any]]] = None
upstage: Optional[Dict[str, Nullable[Any]]] = None
venice: Optional[Dict[str, Nullable[Any]]] = None
wafer: Optional[Dict[str, Nullable[Any]]] = None
wandb: Optional[Dict[str, Nullable[Any]]] = None
xai: Optional[Dict[str, Nullable[Any]]] = None
xiaomi: Optional[Dict[str, Nullable[Any]]] = None
z_ai: Annotated[
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="z-ai")
] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
[
"01ai",
"ai21",
"aion-labs",
"akashml",
"alibaba",
"amazon-bedrock",
"amazon-nova",
"ambient",
"anthropic",
"anyscale",
"arcee-ai",
"atlas-cloud",
"atoma",
"avian",
"azure",
"baidu",
"baseten",
"black-forest-labs",
"byteplus",
"centml",
"cerebras",
"chutes",
"cirrascale",
"clarifai",
"cloudflare",
"cohere",
"crofai",
"crucible",
"crusoe",
"darkbloom",
"decart",
"deepgram",
"deepinfra",
"deepseek",
"dekallm",
"digitalocean",
"enfer",
"fake-provider",
"featherless",
"fireworks",
"friendli",
"gmicloud",
"google-ai-studio",
"google-vertex",
"gopomelo",
"groq",
"heygen",
"huggingface",
"hyperbolic",
"hyperbolic-quantized",
"inception",
"inceptron",
"inferact-vllm",
"inference-net",
"infermatic",
"inflection",
"inocloud",
"io-net",
"ionstream",
"klusterai",
"lambda",
"lepton",
"liquid",
"lynn",
"lynn-private",
"mancer",
"mancer-old",
"mara",
"meta",
"minimax",
"mistral",
"modal",
"modelrun",
"modular",
"moonshotai",
"morph",
"ncompass",
"nebius",
"nex-agi",
"nextbit",
"nineteen",
"novita",
"nvidia",
"octoai",
"open-inference",
"openai",
"parasail",
"perceptron",
"perplexity",
"phala",
"poolside",
"quiver",
"recraft",
"recursal",
"reflection",
"reka",
"relace",
"replicate",
"sakana",
"sambanova",
"sambanova-cloaked",
"seed",
"sf-compute",
"siliconflow",
"sourceful",
"stealth",
"stepfun",
"streamlake",
"switchpoint",
"targon",
"tenstorrent",
"together",
"together-lite",
"ubicloud",
"upstage",
"venice",
"wafer",
"wandb",
"xai",
"xiaomi",
"z-ai",
]
)
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k, serialized.get(n))
if val != UNSET_SENTINEL:
if val is not None or k not in optional_fields:
m[k] = val
return m
class ImageGenerationRequestProviderTypedDict(TypedDict):
r"""Provider-specific passthrough configuration"""
options: NotRequired[ImageGenerationRequestOptionsTypedDict]
class ImageGenerationRequestProvider(BaseModel):
r"""Provider-specific passthrough configuration"""
options: Optional[ImageGenerationRequestOptions] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["options"])
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k, serialized.get(n))
if val != UNSET_SENTINEL:
if val is not None or k not in optional_fields:
m[k] = val
return m
ImageGenerationRequestQuality = Union[
Literal[
"auto",
@@ -691,8 +108,8 @@ class ImageGenerationRequestTypedDict(TypedDict):
r"""Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob."""
output_format: NotRequired[ImageGenerationRequestOutputFormat]
r"""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`."""
provider: NotRequired[ImageGenerationRequestProviderTypedDict]
r"""Provider-specific passthrough configuration"""
provider: NotRequired[ImageGenerationProviderPreferencesTypedDict]
r"""Provider routing preferences and provider-specific passthrough configuration."""
quality: NotRequired[ImageGenerationRequestQuality]
r"""Rendering quality. Providers without a quality knob ignore this."""
resolution: NotRequired[ImageGenerationRequestResolution]
@@ -732,8 +149,8 @@ class ImageGenerationRequest(BaseModel):
output_format: Optional[ImageGenerationRequestOutputFormat] = None
r"""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`."""
provider: Optional[ImageGenerationRequestProvider] = None
r"""Provider-specific passthrough configuration"""
provider: Optional[ImageGenerationProviderPreferences] = None
r"""Provider routing preferences and provider-specific passthrough configuration."""
quality: Optional[ImageGenerationRequestQuality] = None
r"""Rendering quality. Providers without a quality knob ignore this."""
@@ -780,9 +197,3 @@ class ImageGenerationRequest(BaseModel):
m[k] = val
return m
try:
ImageGenerationRequestOptions.model_rebuild()
except NameError:
pass
@@ -37,10 +37,14 @@ r"""Data collection setting. If no available model provider meets the requiremen
"""
IgnoreTypedDict = TypeAliasType("IgnoreTypedDict", Union[ProviderName, str])
ProviderPreferencesIgnoreTypedDict = TypeAliasType(
"ProviderPreferencesIgnoreTypedDict", Union[ProviderName, str]
)
Ignore = TypeAliasType("Ignore", Union[ProviderName, str])
ProviderPreferencesIgnore = TypeAliasType(
"ProviderPreferencesIgnore", Union[ProviderName, str]
)
class MaxPriceTypedDict(TypedDict):
@@ -93,25 +97,36 @@ class MaxPrice(BaseModel):
return m
OnlyTypedDict = TypeAliasType("OnlyTypedDict", Union[ProviderName, str])
ProviderPreferencesOnlyTypedDict = TypeAliasType(
"ProviderPreferencesOnlyTypedDict", Union[ProviderName, str]
)
Only = TypeAliasType("Only", Union[ProviderName, str])
ProviderPreferencesOnly = TypeAliasType(
"ProviderPreferencesOnly", Union[ProviderName, str]
)
OrderTypedDict = TypeAliasType("OrderTypedDict", Union[ProviderName, str])
ProviderPreferencesOrderTypedDict = TypeAliasType(
"ProviderPreferencesOrderTypedDict", Union[ProviderName, str]
)
Order = TypeAliasType("Order", Union[ProviderName, str])
ProviderPreferencesOrder = TypeAliasType(
"ProviderPreferencesOrder", Union[ProviderName, str]
)
SortTypedDict = TypeAliasType(
"SortTypedDict", Union[ProviderSortConfigTypedDict, ProviderSort, Any]
ProviderPreferencesSortTypedDict = TypeAliasType(
"ProviderPreferencesSortTypedDict",
Union[ProviderSortConfigTypedDict, ProviderSort, Any],
)
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
Sort = TypeAliasType("Sort", Union[ProviderSortConfig, ProviderSort, Any])
ProviderPreferencesSort = TypeAliasType(
"ProviderPreferencesSort", Union[ProviderSortConfig, ProviderSort, Any]
)
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
@@ -132,13 +147,13 @@ class ProviderPreferencesTypedDict(TypedDict):
"""
enforce_distillable_text: NotRequired[Nullable[bool]]
r"""Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used."""
ignore: NotRequired[Nullable[List[IgnoreTypedDict]]]
ignore: NotRequired[Nullable[List[ProviderPreferencesIgnoreTypedDict]]]
r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
max_price: NotRequired[MaxPriceTypedDict]
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
only: NotRequired[Nullable[List[OnlyTypedDict]]]
only: NotRequired[Nullable[List[ProviderPreferencesOnlyTypedDict]]]
r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
order: NotRequired[Nullable[List[OrderTypedDict]]]
order: NotRequired[Nullable[List[ProviderPreferencesOrderTypedDict]]]
r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."""
preferred_max_latency: NotRequired[Nullable[PreferredMaxLatencyTypedDict]]
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
@@ -148,7 +163,7 @@ class ProviderPreferencesTypedDict(TypedDict):
r"""A list of quantization levels to filter the provider by."""
require_parameters: NotRequired[Nullable[bool]]
r"""Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest."""
sort: NotRequired[Nullable[SortTypedDict]]
sort: NotRequired[Nullable[ProviderPreferencesSortTypedDict]]
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
zdr: NotRequired[Nullable[bool]]
r"""Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used."""
@@ -174,16 +189,16 @@ class ProviderPreferences(BaseModel):
enforce_distillable_text: OptionalNullable[bool] = UNSET
r"""Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used."""
ignore: OptionalNullable[List[Ignore]] = UNSET
ignore: OptionalNullable[List[ProviderPreferencesIgnore]] = UNSET
r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
max_price: Optional[MaxPrice] = None
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
only: OptionalNullable[List[Only]] = UNSET
only: OptionalNullable[List[ProviderPreferencesOnly]] = UNSET
r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
order: OptionalNullable[List[Order]] = UNSET
order: OptionalNullable[List[ProviderPreferencesOrder]] = UNSET
r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."""
preferred_max_latency: OptionalNullable[PreferredMaxLatency] = UNSET
@@ -198,7 +213,7 @@ class ProviderPreferences(BaseModel):
require_parameters: OptionalNullable[bool] = UNSET
r"""Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest."""
sort: OptionalNullable[Sort] = UNSET
sort: OptionalNullable[ProviderPreferencesSort] = UNSET
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
zdr: OptionalNullable[bool] = UNSET
+26 -26
View File
@@ -34,8 +34,8 @@ class Images(BaseSDK):
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
provider: Optional[
Union[
components.ImageGenerationRequestProvider,
components.ImageGenerationRequestProviderTypedDict,
components.ImageGenerationProviderPreferences,
components.ImageGenerationProviderPreferencesTypedDict,
]
] = None,
quality: Optional[components.ImageGenerationRequestQuality] = None,
@@ -67,7 +67,7 @@ class Images(BaseSDK):
:param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.
:param output_format: 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`.
:param provider: Provider-specific passthrough configuration
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
:param 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.
@@ -101,8 +101,8 @@ class Images(BaseSDK):
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
provider: Optional[
Union[
components.ImageGenerationRequestProvider,
components.ImageGenerationRequestProviderTypedDict,
components.ImageGenerationProviderPreferences,
components.ImageGenerationProviderPreferencesTypedDict,
]
] = None,
quality: Optional[components.ImageGenerationRequestQuality] = None,
@@ -134,7 +134,7 @@ class Images(BaseSDK):
:param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.
:param output_format: 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`.
:param provider: Provider-specific passthrough configuration
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
:param 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.
@@ -168,8 +168,8 @@ class Images(BaseSDK):
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
provider: Optional[
Union[
components.ImageGenerationRequestProvider,
components.ImageGenerationRequestProviderTypedDict,
components.ImageGenerationProviderPreferences,
components.ImageGenerationProviderPreferencesTypedDict,
]
] = None,
quality: Optional[components.ImageGenerationRequestQuality] = None,
@@ -204,7 +204,7 @@ class Images(BaseSDK):
:param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.
:param output_format: 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`.
:param provider: Provider-specific passthrough configuration
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
:param 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.
@@ -237,8 +237,8 @@ class Images(BaseSDK):
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
provider: Optional[
Union[
components.ImageGenerationRequestProvider,
components.ImageGenerationRequestProviderTypedDict,
components.ImageGenerationProviderPreferences,
components.ImageGenerationProviderPreferencesTypedDict,
]
] = None,
quality: Optional[components.ImageGenerationRequestQuality] = None,
@@ -273,7 +273,7 @@ class Images(BaseSDK):
:param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.
:param output_format: 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`.
:param provider: Provider-specific passthrough configuration
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
:param 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.
@@ -310,7 +310,7 @@ class Images(BaseSDK):
output_format=output_format,
prompt=prompt,
provider=utils.get_pydantic_model(
provider, Optional[components.ImageGenerationRequestProvider]
provider, Optional[components.ImageGenerationProviderPreferences]
),
quality=quality,
resolution=resolution,
@@ -514,8 +514,8 @@ class Images(BaseSDK):
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
provider: Optional[
Union[
components.ImageGenerationRequestProvider,
components.ImageGenerationRequestProviderTypedDict,
components.ImageGenerationProviderPreferences,
components.ImageGenerationProviderPreferencesTypedDict,
]
] = None,
quality: Optional[components.ImageGenerationRequestQuality] = None,
@@ -547,7 +547,7 @@ class Images(BaseSDK):
:param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.
:param output_format: 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`.
:param provider: Provider-specific passthrough configuration
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
:param 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.
@@ -581,8 +581,8 @@ class Images(BaseSDK):
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
provider: Optional[
Union[
components.ImageGenerationRequestProvider,
components.ImageGenerationRequestProviderTypedDict,
components.ImageGenerationProviderPreferences,
components.ImageGenerationProviderPreferencesTypedDict,
]
] = None,
quality: Optional[components.ImageGenerationRequestQuality] = None,
@@ -614,7 +614,7 @@ class Images(BaseSDK):
:param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.
:param output_format: 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`.
:param provider: Provider-specific passthrough configuration
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
:param 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.
@@ -648,8 +648,8 @@ class Images(BaseSDK):
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
provider: Optional[
Union[
components.ImageGenerationRequestProvider,
components.ImageGenerationRequestProviderTypedDict,
components.ImageGenerationProviderPreferences,
components.ImageGenerationProviderPreferencesTypedDict,
]
] = None,
quality: Optional[components.ImageGenerationRequestQuality] = None,
@@ -684,7 +684,7 @@ class Images(BaseSDK):
:param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.
:param output_format: 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`.
:param provider: Provider-specific passthrough configuration
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
:param 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.
@@ -717,8 +717,8 @@ class Images(BaseSDK):
output_format: Optional[components.ImageGenerationRequestOutputFormat] = None,
provider: Optional[
Union[
components.ImageGenerationRequestProvider,
components.ImageGenerationRequestProviderTypedDict,
components.ImageGenerationProviderPreferences,
components.ImageGenerationProviderPreferencesTypedDict,
]
] = None,
quality: Optional[components.ImageGenerationRequestQuality] = None,
@@ -753,7 +753,7 @@ class Images(BaseSDK):
:param n: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1.
:param output_compression: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob.
:param output_format: 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`.
:param provider: Provider-specific passthrough configuration
:param provider: Provider routing preferences and provider-specific passthrough configuration.
:param quality: Rendering quality. Providers without a quality knob ignore this.
:param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.
:param 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.
@@ -790,7 +790,7 @@ class Images(BaseSDK):
output_format=output_format,
prompt=prompt,
provider=utils.get_pydantic_model(
provider, Optional[components.ImageGenerationRequestProvider]
provider, Optional[components.ImageGenerationProviderPreferences]
),
quality=quality,
resolution=resolution,