INNER CODE UNIT · Python
_endpoint
SamurAIGPT/Seedance-2.5-API · seedance_api.py:60
def _endpoint(family, variant="standard", resolution=None):
"""Build and validate one of the public Seedance 2.5 route slugs."""
if variant == "standard":
variant_prefix = ""
elif variant in ("intl", "spicy"):
variant_prefix = variant + "-"
else:
raise ValueError("variant must be 'standard', 'intl', or 'spicy'")
normalized_resolution = resolution.lower() if isinstance(resolution, str) else resolution
if normalized_resolution not in _RESOLUTION_SUFFIXES:
raise ValueError("resolution must be one of: 480p, 720p, 1080p, or 4k")
endpoint = "seedance-2.5-{}{}{}".format(
variant_prefix,
family,
_RESOLUTION_SUFFIXES[normalized_resolution],
)