mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
Co-authored-by: speakeasybot <bot@speakeasyapi.dev> Co-authored-by: speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
730 lines
25 KiB
Python
730 lines
25 KiB
Python
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
|
|
from __future__ import annotations
|
|
from .frameimage import FrameImage, FrameImageTypedDict
|
|
from .inputreference import InputReference, InputReferenceTypedDict
|
|
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr
|
|
import pydantic
|
|
from pydantic import model_serializer
|
|
from typing import Any, Dict, List, Literal, Optional, Union
|
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
|
|
|
|
VideoGenerationRequestAspectRatio = Union[
|
|
Literal[
|
|
"16:9",
|
|
"9:16",
|
|
"1:1",
|
|
"4:3",
|
|
"3:4",
|
|
"3:2",
|
|
"2:3",
|
|
"21:9",
|
|
"9:21",
|
|
],
|
|
UnrecognizedStr,
|
|
]
|
|
r"""Aspect ratio of the generated video"""
|
|
|
|
|
|
class VideoGenerationRequestOptionsTypedDict(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]]]
|
|
sail_research: 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 VideoGenerationRequestOptions(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
|
|
|
|
sail_research: Annotated[
|
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sail-research")
|
|
] = 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",
|
|
"sail-research",
|
|
"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 VideoGenerationRequestProviderTypedDict(TypedDict):
|
|
r"""Provider-specific passthrough configuration"""
|
|
|
|
options: NotRequired[VideoGenerationRequestOptionsTypedDict]
|
|
|
|
|
|
class VideoGenerationRequestProvider(BaseModel):
|
|
r"""Provider-specific passthrough configuration"""
|
|
|
|
options: Optional[VideoGenerationRequestOptions] = 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
|
|
|
|
|
|
VideoGenerationRequestResolution = Union[
|
|
Literal[
|
|
"480p",
|
|
"720p",
|
|
"1080p",
|
|
"1K",
|
|
"2K",
|
|
"4K",
|
|
],
|
|
UnrecognizedStr,
|
|
]
|
|
r"""Resolution of the generated video"""
|
|
|
|
|
|
class VideoGenerationRequestTypedDict(TypedDict):
|
|
model: str
|
|
prompt: str
|
|
aspect_ratio: NotRequired[VideoGenerationRequestAspectRatio]
|
|
r"""Aspect ratio of the generated video"""
|
|
callback_url: NotRequired[str]
|
|
r"""URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS."""
|
|
duration: NotRequired[int]
|
|
r"""Duration of the generated video in seconds"""
|
|
frame_images: NotRequired[List[FrameImageTypedDict]]
|
|
r"""Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame."""
|
|
generate_audio: NotRequired[bool]
|
|
r"""Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set."""
|
|
input_references: NotRequired[List[InputReferenceTypedDict]]
|
|
r"""Reference assets to guide video generation. Accepts image, audio, and video references. Audio and video references are only honored by providers that support them (currently BytePlus Seedance 2.0); other providers use image references and ignore the rest."""
|
|
provider: NotRequired[VideoGenerationRequestProviderTypedDict]
|
|
r"""Provider-specific passthrough configuration"""
|
|
resolution: NotRequired[VideoGenerationRequestResolution]
|
|
r"""Resolution of the generated video"""
|
|
seed: NotRequired[int]
|
|
r"""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."""
|
|
size: NotRequired[str]
|
|
r"""Exact pixel dimensions of the generated video in \"WIDTHxHEIGHT\" format (e.g. \"1280x720\"). Interchangeable with resolution + aspect_ratio."""
|
|
|
|
|
|
class VideoGenerationRequest(BaseModel):
|
|
model: str
|
|
|
|
prompt: str
|
|
|
|
aspect_ratio: Optional[VideoGenerationRequestAspectRatio] = None
|
|
r"""Aspect ratio of the generated video"""
|
|
|
|
callback_url: Optional[str] = None
|
|
r"""URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS."""
|
|
|
|
duration: Optional[int] = None
|
|
r"""Duration of the generated video in seconds"""
|
|
|
|
frame_images: Optional[List[FrameImage]] = None
|
|
r"""Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame."""
|
|
|
|
generate_audio: Optional[bool] = None
|
|
r"""Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set."""
|
|
|
|
input_references: Optional[List[InputReference]] = None
|
|
r"""Reference assets to guide video generation. Accepts image, audio, and video references. Audio and video references are only honored by providers that support them (currently BytePlus Seedance 2.0); other providers use image references and ignore the rest."""
|
|
|
|
provider: Optional[VideoGenerationRequestProvider] = None
|
|
r"""Provider-specific passthrough configuration"""
|
|
|
|
resolution: Optional[VideoGenerationRequestResolution] = None
|
|
r"""Resolution of the generated video"""
|
|
|
|
seed: Optional[int] = None
|
|
r"""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."""
|
|
|
|
size: Optional[str] = None
|
|
r"""Exact pixel dimensions of the generated video in \"WIDTHxHEIGHT\" format (e.g. \"1280x720\"). Interchangeable with resolution + aspect_ratio."""
|
|
|
|
@model_serializer(mode="wrap")
|
|
def serialize_model(self, handler):
|
|
optional_fields = set(
|
|
[
|
|
"aspect_ratio",
|
|
"callback_url",
|
|
"duration",
|
|
"frame_images",
|
|
"generate_audio",
|
|
"input_references",
|
|
"provider",
|
|
"resolution",
|
|
"seed",
|
|
"size",
|
|
]
|
|
)
|
|
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
|
|
|
|
|
|
try:
|
|
VideoGenerationRequestOptions.model_rebuild()
|
|
except NameError:
|
|
pass
|