pydo.genai.create_model_router()
Generated on 3 Aug 2026
from pydo version
v0.40.0
Usage
client.genai.create_model_router(
body={
"description": "\"My Model Router Description\"",
"fallback_models": [...],
"name": "\"my-model-router\"",
...,
},
)Description
To create a model router, send a POST request to /v2/gen-ai/models/routers.
Parameters
descriptionstring optionalExample:
"My Model Router Description"Model router description
fallback_modelsarray of strings optionalExample:
['example string']At least one fallback model is required; order defines failover priority
namestring optionalExample:
"my-model-router"Model router name: lowercase, at most 255 characters, only a-z, 0-9, and hyphens
policiesarray of objects optionalRouter policies
Show child properties
custom_taskobject optionalTask definition embedded in a model router config.
Show child properties
descriptionstring optionalExample:
"Summarize long-form text"Short task description
namestring optionalExample:
"Custom Summarization"Task name
modelsarray of strings optionalExample:
['example string']Models assigned to the task
selection_policyobject optionalSelection policy preference for choosing among assigned models.
Show child properties
preferstring optionalExample:
"cheapest"One of: none, cheapest, fastest
task_slugstring optionalExample:
"summarization"Task slug
regionsarray of strings optionalExample:
['example string']DEPRECATED: this field does not affect deployment and model routers are always
deployed to all regions. Must be omitted or set to ["all"].
Request Sample
Response Example
More Information
See /v2/gen-ai/models/routers in the API reference for additional detail on responses, headers, parameters, and more.