# Dynamic Routing ## List all AI Gateway Dynamic Routes. `ai_gateway.dynamic_routing.list(strgateway_id, DynamicRoutingListParams**kwargs) -> DynamicRoutingListResponse` **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes` List all AI Gateway Dynamic Routes. ### Parameters - `account_id: str` - `gateway_id: str` ### Returns - `class DynamicRoutingListResponse: …` - `data: Data` - `order_by: str` - `order_by_direction: str` - `page: float` - `per_page: float` - `routes: List[DataRoute]` - `id: str` - `account_tag: str` - `created_at: datetime` - `deployment: DataRouteDeployment` - `created_at: str` - `deployment_id: str` - `version_id: str` - `elements: List[DataRouteElement]` - `class DataRouteElementUnionMember0: …` - `id: str` - `outputs: DataRouteElementUnionMember0Outputs` - `next: DataRouteElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class DataRouteElementUnionMember1: …` - `id: str` - `outputs: DataRouteElementUnionMember1Outputs` - `false: DataRouteElementUnionMember1OutputsFalse_` - `element_id: str` - `true: DataRouteElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: DataRouteElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class DataRouteElementUnionMember2: …` - `id: str` - `outputs: Dict[str, DataRouteElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class DataRouteElementUnionMember3: …` - `id: str` - `outputs: DataRouteElementUnionMember3Outputs` - `fallback: DataRouteElementUnionMember3OutputsFallback` - `element_id: str` - `success: DataRouteElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: DataRouteElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class DataRouteElementUnionMember4: …` - `id: str` - `outputs: DataRouteElementUnionMember4Outputs` - `fallback: DataRouteElementUnionMember4OutputsFallback` - `element_id: str` - `success: DataRouteElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: DataRouteElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class DataRouteElementUnionMember5: …` - `id: str` - `outputs: Dict[str, DataRouteElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` - `version: DataRouteVersion` - `active: Literal["true", "false"]` - `"true"` - `"false"` - `created_at: str` - `data: str` - `version_id: str` - `success: bool` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) dynamic_routings = client.ai_gateway.dynamic_routing.list( gateway_id="54442216", account_id="0d37909e38d3e99c29fa2cd343ac421a", ) print(dynamic_routings.data) ``` #### Response ```json { "data": { "order_by": "order_by", "order_by_direction": "order_by_direction", "page": 0, "per_page": 0, "routes": [ { "id": "id", "account_tag": "account_tag", "created_at": "2019-12-27T18:11:19.117Z", "deployment": { "created_at": "created_at", "deployment_id": "deployment_id", "version_id": "version_id" }, "elements": [ { "id": "id", "outputs": { "next": { "elementId": "elementId" } }, "type": "start" } ], "gateway_id": "gateway_id", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "version": { "active": "true", "created_at": "created_at", "data": "data", "version_id": "version_id" } } ] }, "success": true } ``` ## Get an AI Gateway Dynamic Route. `ai_gateway.dynamic_routing.get(strid, DynamicRoutingGetParams**kwargs) -> DynamicRoutingGetResponse` **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}` Get an AI Gateway Dynamic Route. ### Parameters - `account_id: str` - `gateway_id: str` - `id: str` ### Returns - `class DynamicRoutingGetResponse: …` - `id: str` - `created_at: datetime` - `deployment: Deployment` - `created_at: str` - `deployment_id: str` - `version_id: str` - `elements: List[Element]` - `class ElementUnionMember0: …` - `id: str` - `outputs: ElementUnionMember0Outputs` - `next: ElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class ElementUnionMember1: …` - `id: str` - `outputs: ElementUnionMember1Outputs` - `false: ElementUnionMember1OutputsFalse_` - `element_id: str` - `true: ElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: ElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class ElementUnionMember2: …` - `id: str` - `outputs: Dict[str, ElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class ElementUnionMember3: …` - `id: str` - `outputs: ElementUnionMember3Outputs` - `fallback: ElementUnionMember3OutputsFallback` - `element_id: str` - `success: ElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class ElementUnionMember4: …` - `id: str` - `outputs: ElementUnionMember4Outputs` - `fallback: ElementUnionMember4OutputsFallback` - `element_id: str` - `success: ElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class ElementUnionMember5: …` - `id: str` - `outputs: Dict[str, ElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` - `version: Version` - `active: Literal["true", "false"]` - `"true"` - `"false"` - `created_at: str` - `data: str` - `version_id: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) dynamic_routing = client.ai_gateway.dynamic_routing.get( id="54442216", account_id="0d37909e38d3e99c29fa2cd343ac421a", gateway_id="54442216", ) print(dynamic_routing.id) ``` #### Response ```json { "result": { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "deployment": { "created_at": "created_at", "deployment_id": "deployment_id", "version_id": "version_id" }, "elements": [ { "id": "id", "outputs": { "next": { "elementId": "elementId" } }, "type": "start" } ], "gateway_id": "gateway_id", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "version": { "active": "true", "created_at": "created_at", "data": "data", "version_id": "version_id" } }, "success": true } ``` ## Create a new AI Gateway Dynamic Route. `ai_gateway.dynamic_routing.create(strgateway_id, DynamicRoutingCreateParams**kwargs) -> DynamicRoutingCreateResponse` **post** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes` Create a new AI Gateway Dynamic Route. ### Parameters - `account_id: str` - `gateway_id: str` - `elements: Iterable[Element]` - `class ElementUnionMember0: …` - `id: str` - `outputs: ElementUnionMember0Outputs` - `next: ElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class ElementUnionMember1: …` - `id: str` - `outputs: ElementUnionMember1Outputs` - `false: ElementUnionMember1OutputsFalse_` - `element_id: str` - `true: ElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: ElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class ElementUnionMember2: …` - `id: str` - `outputs: Dict[str, ElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class ElementUnionMember3: …` - `id: str` - `outputs: ElementUnionMember3Outputs` - `fallback: ElementUnionMember3OutputsFallback` - `element_id: str` - `success: ElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class ElementUnionMember4: …` - `id: str` - `outputs: ElementUnionMember4Outputs` - `fallback: ElementUnionMember4OutputsFallback` - `element_id: str` - `success: ElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class ElementUnionMember5: …` - `id: str` - `outputs: Dict[str, ElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `name: str` ### Returns - `class DynamicRoutingCreateResponse: …` - `id: str` - `created_at: datetime` - `deployment: Deployment` - `created_at: str` - `deployment_id: str` - `version_id: str` - `elements: List[Element]` - `class ElementUnionMember0: …` - `id: str` - `outputs: ElementUnionMember0Outputs` - `next: ElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class ElementUnionMember1: …` - `id: str` - `outputs: ElementUnionMember1Outputs` - `false: ElementUnionMember1OutputsFalse_` - `element_id: str` - `true: ElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: ElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class ElementUnionMember2: …` - `id: str` - `outputs: Dict[str, ElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class ElementUnionMember3: …` - `id: str` - `outputs: ElementUnionMember3Outputs` - `fallback: ElementUnionMember3OutputsFallback` - `element_id: str` - `success: ElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class ElementUnionMember4: …` - `id: str` - `outputs: ElementUnionMember4Outputs` - `fallback: ElementUnionMember4OutputsFallback` - `element_id: str` - `success: ElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class ElementUnionMember5: …` - `id: str` - `outputs: Dict[str, ElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` - `version: Version` - `active: Literal["true", "false"]` - `"true"` - `"false"` - `created_at: str` - `data: str` - `version_id: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) dynamic_routing = client.ai_gateway.dynamic_routing.create( gateway_id="54442216", account_id="0d37909e38d3e99c29fa2cd343ac421a", elements=[{ "id": "id", "outputs": { "next": { "element_id": "elementId" } }, "type": "start", }], name="name", ) print(dynamic_routing.id) ``` #### Response ```json { "result": { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "deployment": { "created_at": "created_at", "deployment_id": "deployment_id", "version_id": "version_id" }, "elements": [ { "id": "id", "outputs": { "next": { "elementId": "elementId" } }, "type": "start" } ], "gateway_id": "gateway_id", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "version": { "active": "true", "created_at": "created_at", "data": "data", "version_id": "version_id" } }, "success": true } ``` ## Update an AI Gateway Dynamic Route. `ai_gateway.dynamic_routing.update(strid, DynamicRoutingUpdateParams**kwargs) -> DynamicRoutingUpdateResponse` **patch** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}` Update an AI Gateway Dynamic Route. ### Parameters - `account_id: str` - `gateway_id: str` - `id: str` - `name: str` ### Returns - `class DynamicRoutingUpdateResponse: …` - `route: Route` - `id: str` - `account_tag: str` - `created_at: datetime` - `deployment: RouteDeployment` - `created_at: str` - `deployment_id: str` - `version_id: str` - `elements: List[RouteElement]` - `class RouteElementUnionMember0: …` - `id: str` - `outputs: RouteElementUnionMember0Outputs` - `next: RouteElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class RouteElementUnionMember1: …` - `id: str` - `outputs: RouteElementUnionMember1Outputs` - `false: RouteElementUnionMember1OutputsFalse_` - `element_id: str` - `true: RouteElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: RouteElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class RouteElementUnionMember2: …` - `id: str` - `outputs: Dict[str, RouteElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class RouteElementUnionMember3: …` - `id: str` - `outputs: RouteElementUnionMember3Outputs` - `fallback: RouteElementUnionMember3OutputsFallback` - `element_id: str` - `success: RouteElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: RouteElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class RouteElementUnionMember4: …` - `id: str` - `outputs: RouteElementUnionMember4Outputs` - `fallback: RouteElementUnionMember4OutputsFallback` - `element_id: str` - `success: RouteElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: RouteElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class RouteElementUnionMember5: …` - `id: str` - `outputs: Dict[str, RouteElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` - `version: RouteVersion` - `active: Literal["true", "false"]` - `"true"` - `"false"` - `created_at: str` - `data: str` - `version_id: str` - `success: bool` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) dynamic_routing = client.ai_gateway.dynamic_routing.update( id="54442216", account_id="0d37909e38d3e99c29fa2cd343ac421a", gateway_id="54442216", name="Route Name", ) print(dynamic_routing.route) ``` #### Response ```json { "route": { "id": "id", "account_tag": "account_tag", "created_at": "2019-12-27T18:11:19.117Z", "deployment": { "created_at": "created_at", "deployment_id": "deployment_id", "version_id": "version_id" }, "elements": [ { "id": "id", "outputs": { "next": { "elementId": "elementId" } }, "type": "start" } ], "gateway_id": "gateway_id", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "version": { "active": "true", "created_at": "created_at", "data": "data", "version_id": "version_id" } }, "success": true } ``` ## Delete an AI Gateway Dynamic Route. `ai_gateway.dynamic_routing.delete(strid, DynamicRoutingDeleteParams**kwargs) -> DynamicRoutingDeleteResponse` **delete** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}` Delete an AI Gateway Dynamic Route. ### Parameters - `account_id: str` - `gateway_id: str` - `id: str` ### Returns - `class DynamicRoutingDeleteResponse: …` - `id: str` - `created_at: datetime` - `elements: List[Element]` - `class ElementUnionMember0: …` - `id: str` - `outputs: ElementUnionMember0Outputs` - `next: ElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class ElementUnionMember1: …` - `id: str` - `outputs: ElementUnionMember1Outputs` - `false: ElementUnionMember1OutputsFalse_` - `element_id: str` - `true: ElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: ElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class ElementUnionMember2: …` - `id: str` - `outputs: Dict[str, ElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class ElementUnionMember3: …` - `id: str` - `outputs: ElementUnionMember3Outputs` - `fallback: ElementUnionMember3OutputsFallback` - `element_id: str` - `success: ElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class ElementUnionMember4: …` - `id: str` - `outputs: ElementUnionMember4Outputs` - `fallback: ElementUnionMember4OutputsFallback` - `element_id: str` - `success: ElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class ElementUnionMember5: …` - `id: str` - `outputs: Dict[str, ElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) dynamic_routing = client.ai_gateway.dynamic_routing.delete( id="54442216", account_id="0d37909e38d3e99c29fa2cd343ac421a", gateway_id="54442216", ) print(dynamic_routing.id) ``` #### Response ```json { "result": { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "elements": [ { "id": "id", "outputs": { "next": { "elementId": "elementId" } }, "type": "start" } ], "gateway_id": "gateway_id", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name" }, "success": true } ``` ## List all AI Gateway Dynamic Route Deployments. `ai_gateway.dynamic_routing.list_deployments(strid, DynamicRoutingListDeploymentsParams**kwargs) -> DynamicRoutingListDeploymentsResponse` **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments` List all AI Gateway Dynamic Route Deployments. ### Parameters - `account_id: str` - `gateway_id: str` - `id: str` ### Returns - `class DynamicRoutingListDeploymentsResponse: …` - `data: Data` - `deployments: List[DataDeployment]` - `created_at: str` - `deployment_id: str` - `version_id: str` - `order_by: str` - `order_by_direction: str` - `page: float` - `per_page: float` - `success: bool` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.ai_gateway.dynamic_routing.list_deployments( id="54442216", account_id="0d37909e38d3e99c29fa2cd343ac421a", gateway_id="54442216", ) print(response.data) ``` #### Response ```json { "data": { "deployments": [ { "created_at": "created_at", "deployment_id": "deployment_id", "version_id": "version_id" } ], "order_by": "order_by", "order_by_direction": "order_by_direction", "page": 0, "per_page": 0 }, "success": true } ``` ## Create a new AI Gateway Dynamic Route Deployment. `ai_gateway.dynamic_routing.create_deployment(strid, DynamicRoutingCreateDeploymentParams**kwargs) -> DynamicRoutingCreateDeploymentResponse` **post** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments` Create a new AI Gateway Dynamic Route Deployment. ### Parameters - `account_id: str` - `gateway_id: str` - `id: str` - `version_id: str` ### Returns - `class DynamicRoutingCreateDeploymentResponse: …` - `id: str` - `created_at: datetime` - `elements: List[Element]` - `class ElementUnionMember0: …` - `id: str` - `outputs: ElementUnionMember0Outputs` - `next: ElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class ElementUnionMember1: …` - `id: str` - `outputs: ElementUnionMember1Outputs` - `false: ElementUnionMember1OutputsFalse_` - `element_id: str` - `true: ElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: ElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class ElementUnionMember2: …` - `id: str` - `outputs: Dict[str, ElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class ElementUnionMember3: …` - `id: str` - `outputs: ElementUnionMember3Outputs` - `fallback: ElementUnionMember3OutputsFallback` - `element_id: str` - `success: ElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class ElementUnionMember4: …` - `id: str` - `outputs: ElementUnionMember4Outputs` - `fallback: ElementUnionMember4OutputsFallback` - `element_id: str` - `success: ElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class ElementUnionMember5: …` - `id: str` - `outputs: Dict[str, ElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.ai_gateway.dynamic_routing.create_deployment( id="54442216", account_id="0d37909e38d3e99c29fa2cd343ac421a", gateway_id="54442216", version_id="54442216", ) print(response.id) ``` #### Response ```json { "result": { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "elements": [ { "id": "id", "outputs": { "next": { "elementId": "elementId" } }, "type": "start" } ], "gateway_id": "gateway_id", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name" }, "success": true } ``` ## List all AI Gateway Dynamic Route Versions. `ai_gateway.dynamic_routing.list_versions(strid, DynamicRoutingListVersionsParams**kwargs) -> DynamicRoutingListVersionsResponse` **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions` List all AI Gateway Dynamic Route Versions. ### Parameters - `account_id: str` - `gateway_id: str` - `id: str` ### Returns - `class DynamicRoutingListVersionsResponse: …` - `data: Data` - `order_by: str` - `order_by_direction: str` - `page: float` - `per_page: float` - `versions: List[DataVersion]` - `active: Literal["true", "false"]` - `"true"` - `"false"` - `created_at: str` - `data: str` - `version_id: str` - `success: bool` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.ai_gateway.dynamic_routing.list_versions( id="54442216", account_id="0d37909e38d3e99c29fa2cd343ac421a", gateway_id="54442216", ) print(response.data) ``` #### Response ```json { "data": { "order_by": "order_by", "order_by_direction": "order_by_direction", "page": 0, "per_page": 0, "versions": [ { "active": "true", "created_at": "created_at", "data": "data", "version_id": "version_id" } ] }, "success": true } ``` ## Create a new AI Gateway Dynamic Route Version. `ai_gateway.dynamic_routing.create_version(strid, DynamicRoutingCreateVersionParams**kwargs) -> DynamicRoutingCreateVersionResponse` **post** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions` Create a new AI Gateway Dynamic Route Version. ### Parameters - `account_id: str` - `gateway_id: str` - `id: str` - `elements: Iterable[Element]` - `class ElementUnionMember0: …` - `id: str` - `outputs: ElementUnionMember0Outputs` - `next: ElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class ElementUnionMember1: …` - `id: str` - `outputs: ElementUnionMember1Outputs` - `false: ElementUnionMember1OutputsFalse_` - `element_id: str` - `true: ElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: ElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class ElementUnionMember2: …` - `id: str` - `outputs: Dict[str, ElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class ElementUnionMember3: …` - `id: str` - `outputs: ElementUnionMember3Outputs` - `fallback: ElementUnionMember3OutputsFallback` - `element_id: str` - `success: ElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class ElementUnionMember4: …` - `id: str` - `outputs: ElementUnionMember4Outputs` - `fallback: ElementUnionMember4OutputsFallback` - `element_id: str` - `success: ElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class ElementUnionMember5: …` - `id: str` - `outputs: Dict[str, ElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` ### Returns - `class DynamicRoutingCreateVersionResponse: …` - `id: str` - `created_at: datetime` - `elements: List[Element]` - `class ElementUnionMember0: …` - `id: str` - `outputs: ElementUnionMember0Outputs` - `next: ElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class ElementUnionMember1: …` - `id: str` - `outputs: ElementUnionMember1Outputs` - `false: ElementUnionMember1OutputsFalse_` - `element_id: str` - `true: ElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: ElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class ElementUnionMember2: …` - `id: str` - `outputs: Dict[str, ElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class ElementUnionMember3: …` - `id: str` - `outputs: ElementUnionMember3Outputs` - `fallback: ElementUnionMember3OutputsFallback` - `element_id: str` - `success: ElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class ElementUnionMember4: …` - `id: str` - `outputs: ElementUnionMember4Outputs` - `fallback: ElementUnionMember4OutputsFallback` - `element_id: str` - `success: ElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class ElementUnionMember5: …` - `id: str` - `outputs: Dict[str, ElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.ai_gateway.dynamic_routing.create_version( id="54442216", account_id="0d37909e38d3e99c29fa2cd343ac421a", gateway_id="54442216", elements=[{ "id": "id", "outputs": { "next": { "element_id": "elementId" } }, "type": "start", }], ) print(response.id) ``` #### Response ```json { "result": { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "elements": [ { "id": "id", "outputs": { "next": { "elementId": "elementId" } }, "type": "start" } ], "gateway_id": "gateway_id", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name" }, "success": true } ``` ## Get an AI Gateway Dynamic Route Version. `ai_gateway.dynamic_routing.get_version(strversion_id, DynamicRoutingGetVersionParams**kwargs) -> DynamicRoutingGetVersionResponse` **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions/{version_id}` Get an AI Gateway Dynamic Route Version. ### Parameters - `account_id: str` - `gateway_id: str` - `id: str` - `version_id: str` ### Returns - `class DynamicRoutingGetVersionResponse: …` - `id: str` - `active: Literal["true", "false"]` - `"true"` - `"false"` - `created_at: str` - `data: str` - `elements: List[Element]` - `class ElementUnionMember0: …` - `id: str` - `outputs: ElementUnionMember0Outputs` - `next: ElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class ElementUnionMember1: …` - `id: str` - `outputs: ElementUnionMember1Outputs` - `false: ElementUnionMember1OutputsFalse_` - `element_id: str` - `true: ElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: ElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class ElementUnionMember2: …` - `id: str` - `outputs: Dict[str, ElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class ElementUnionMember3: …` - `id: str` - `outputs: ElementUnionMember3Outputs` - `fallback: ElementUnionMember3OutputsFallback` - `element_id: str` - `success: ElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class ElementUnionMember4: …` - `id: str` - `outputs: ElementUnionMember4Outputs` - `fallback: ElementUnionMember4OutputsFallback` - `element_id: str` - `success: ElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class ElementUnionMember5: …` - `id: str` - `outputs: Dict[str, ElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` - `version_id: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.ai_gateway.dynamic_routing.get_version( version_id="54442216", account_id="0d37909e38d3e99c29fa2cd343ac421a", gateway_id="54442216", id="54442216", ) print(response.id) ``` #### Response ```json { "result": { "id": "id", "active": "true", "created_at": "created_at", "data": "data", "elements": [ { "id": "id", "outputs": { "next": { "elementId": "elementId" } }, "type": "start" } ], "gateway_id": "gateway_id", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "version_id": "version_id" }, "success": true } ``` ## Domain Types ### Dynamic Routing List Response - `class DynamicRoutingListResponse: …` - `data: Data` - `order_by: str` - `order_by_direction: str` - `page: float` - `per_page: float` - `routes: List[DataRoute]` - `id: str` - `account_tag: str` - `created_at: datetime` - `deployment: DataRouteDeployment` - `created_at: str` - `deployment_id: str` - `version_id: str` - `elements: List[DataRouteElement]` - `class DataRouteElementUnionMember0: …` - `id: str` - `outputs: DataRouteElementUnionMember0Outputs` - `next: DataRouteElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class DataRouteElementUnionMember1: …` - `id: str` - `outputs: DataRouteElementUnionMember1Outputs` - `false: DataRouteElementUnionMember1OutputsFalse_` - `element_id: str` - `true: DataRouteElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: DataRouteElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class DataRouteElementUnionMember2: …` - `id: str` - `outputs: Dict[str, DataRouteElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class DataRouteElementUnionMember3: …` - `id: str` - `outputs: DataRouteElementUnionMember3Outputs` - `fallback: DataRouteElementUnionMember3OutputsFallback` - `element_id: str` - `success: DataRouteElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: DataRouteElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class DataRouteElementUnionMember4: …` - `id: str` - `outputs: DataRouteElementUnionMember4Outputs` - `fallback: DataRouteElementUnionMember4OutputsFallback` - `element_id: str` - `success: DataRouteElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: DataRouteElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class DataRouteElementUnionMember5: …` - `id: str` - `outputs: Dict[str, DataRouteElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` - `version: DataRouteVersion` - `active: Literal["true", "false"]` - `"true"` - `"false"` - `created_at: str` - `data: str` - `version_id: str` - `success: bool` ### Dynamic Routing Get Response - `class DynamicRoutingGetResponse: …` - `id: str` - `created_at: datetime` - `deployment: Deployment` - `created_at: str` - `deployment_id: str` - `version_id: str` - `elements: List[Element]` - `class ElementUnionMember0: …` - `id: str` - `outputs: ElementUnionMember0Outputs` - `next: ElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class ElementUnionMember1: …` - `id: str` - `outputs: ElementUnionMember1Outputs` - `false: ElementUnionMember1OutputsFalse_` - `element_id: str` - `true: ElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: ElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class ElementUnionMember2: …` - `id: str` - `outputs: Dict[str, ElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class ElementUnionMember3: …` - `id: str` - `outputs: ElementUnionMember3Outputs` - `fallback: ElementUnionMember3OutputsFallback` - `element_id: str` - `success: ElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class ElementUnionMember4: …` - `id: str` - `outputs: ElementUnionMember4Outputs` - `fallback: ElementUnionMember4OutputsFallback` - `element_id: str` - `success: ElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class ElementUnionMember5: …` - `id: str` - `outputs: Dict[str, ElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` - `version: Version` - `active: Literal["true", "false"]` - `"true"` - `"false"` - `created_at: str` - `data: str` - `version_id: str` ### Dynamic Routing Create Response - `class DynamicRoutingCreateResponse: …` - `id: str` - `created_at: datetime` - `deployment: Deployment` - `created_at: str` - `deployment_id: str` - `version_id: str` - `elements: List[Element]` - `class ElementUnionMember0: …` - `id: str` - `outputs: ElementUnionMember0Outputs` - `next: ElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class ElementUnionMember1: …` - `id: str` - `outputs: ElementUnionMember1Outputs` - `false: ElementUnionMember1OutputsFalse_` - `element_id: str` - `true: ElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: ElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class ElementUnionMember2: …` - `id: str` - `outputs: Dict[str, ElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class ElementUnionMember3: …` - `id: str` - `outputs: ElementUnionMember3Outputs` - `fallback: ElementUnionMember3OutputsFallback` - `element_id: str` - `success: ElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class ElementUnionMember4: …` - `id: str` - `outputs: ElementUnionMember4Outputs` - `fallback: ElementUnionMember4OutputsFallback` - `element_id: str` - `success: ElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class ElementUnionMember5: …` - `id: str` - `outputs: Dict[str, ElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` - `version: Version` - `active: Literal["true", "false"]` - `"true"` - `"false"` - `created_at: str` - `data: str` - `version_id: str` ### Dynamic Routing Update Response - `class DynamicRoutingUpdateResponse: …` - `route: Route` - `id: str` - `account_tag: str` - `created_at: datetime` - `deployment: RouteDeployment` - `created_at: str` - `deployment_id: str` - `version_id: str` - `elements: List[RouteElement]` - `class RouteElementUnionMember0: …` - `id: str` - `outputs: RouteElementUnionMember0Outputs` - `next: RouteElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class RouteElementUnionMember1: …` - `id: str` - `outputs: RouteElementUnionMember1Outputs` - `false: RouteElementUnionMember1OutputsFalse_` - `element_id: str` - `true: RouteElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: RouteElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class RouteElementUnionMember2: …` - `id: str` - `outputs: Dict[str, RouteElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class RouteElementUnionMember3: …` - `id: str` - `outputs: RouteElementUnionMember3Outputs` - `fallback: RouteElementUnionMember3OutputsFallback` - `element_id: str` - `success: RouteElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: RouteElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class RouteElementUnionMember4: …` - `id: str` - `outputs: RouteElementUnionMember4Outputs` - `fallback: RouteElementUnionMember4OutputsFallback` - `element_id: str` - `success: RouteElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: RouteElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class RouteElementUnionMember5: …` - `id: str` - `outputs: Dict[str, RouteElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` - `version: RouteVersion` - `active: Literal["true", "false"]` - `"true"` - `"false"` - `created_at: str` - `data: str` - `version_id: str` - `success: bool` ### Dynamic Routing Delete Response - `class DynamicRoutingDeleteResponse: …` - `id: str` - `created_at: datetime` - `elements: List[Element]` - `class ElementUnionMember0: …` - `id: str` - `outputs: ElementUnionMember0Outputs` - `next: ElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class ElementUnionMember1: …` - `id: str` - `outputs: ElementUnionMember1Outputs` - `false: ElementUnionMember1OutputsFalse_` - `element_id: str` - `true: ElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: ElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class ElementUnionMember2: …` - `id: str` - `outputs: Dict[str, ElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class ElementUnionMember3: …` - `id: str` - `outputs: ElementUnionMember3Outputs` - `fallback: ElementUnionMember3OutputsFallback` - `element_id: str` - `success: ElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class ElementUnionMember4: …` - `id: str` - `outputs: ElementUnionMember4Outputs` - `fallback: ElementUnionMember4OutputsFallback` - `element_id: str` - `success: ElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class ElementUnionMember5: …` - `id: str` - `outputs: Dict[str, ElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` ### Dynamic Routing List Deployments Response - `class DynamicRoutingListDeploymentsResponse: …` - `data: Data` - `deployments: List[DataDeployment]` - `created_at: str` - `deployment_id: str` - `version_id: str` - `order_by: str` - `order_by_direction: str` - `page: float` - `per_page: float` - `success: bool` ### Dynamic Routing Create Deployment Response - `class DynamicRoutingCreateDeploymentResponse: …` - `id: str` - `created_at: datetime` - `elements: List[Element]` - `class ElementUnionMember0: …` - `id: str` - `outputs: ElementUnionMember0Outputs` - `next: ElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class ElementUnionMember1: …` - `id: str` - `outputs: ElementUnionMember1Outputs` - `false: ElementUnionMember1OutputsFalse_` - `element_id: str` - `true: ElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: ElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class ElementUnionMember2: …` - `id: str` - `outputs: Dict[str, ElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class ElementUnionMember3: …` - `id: str` - `outputs: ElementUnionMember3Outputs` - `fallback: ElementUnionMember3OutputsFallback` - `element_id: str` - `success: ElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class ElementUnionMember4: …` - `id: str` - `outputs: ElementUnionMember4Outputs` - `fallback: ElementUnionMember4OutputsFallback` - `element_id: str` - `success: ElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class ElementUnionMember5: …` - `id: str` - `outputs: Dict[str, ElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` ### Dynamic Routing List Versions Response - `class DynamicRoutingListVersionsResponse: …` - `data: Data` - `order_by: str` - `order_by_direction: str` - `page: float` - `per_page: float` - `versions: List[DataVersion]` - `active: Literal["true", "false"]` - `"true"` - `"false"` - `created_at: str` - `data: str` - `version_id: str` - `success: bool` ### Dynamic Routing Create Version Response - `class DynamicRoutingCreateVersionResponse: …` - `id: str` - `created_at: datetime` - `elements: List[Element]` - `class ElementUnionMember0: …` - `id: str` - `outputs: ElementUnionMember0Outputs` - `next: ElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class ElementUnionMember1: …` - `id: str` - `outputs: ElementUnionMember1Outputs` - `false: ElementUnionMember1OutputsFalse_` - `element_id: str` - `true: ElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: ElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class ElementUnionMember2: …` - `id: str` - `outputs: Dict[str, ElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class ElementUnionMember3: …` - `id: str` - `outputs: ElementUnionMember3Outputs` - `fallback: ElementUnionMember3OutputsFallback` - `element_id: str` - `success: ElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class ElementUnionMember4: …` - `id: str` - `outputs: ElementUnionMember4Outputs` - `fallback: ElementUnionMember4OutputsFallback` - `element_id: str` - `success: ElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class ElementUnionMember5: …` - `id: str` - `outputs: Dict[str, ElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` ### Dynamic Routing Get Version Response - `class DynamicRoutingGetVersionResponse: …` - `id: str` - `active: Literal["true", "false"]` - `"true"` - `"false"` - `created_at: str` - `data: str` - `elements: List[Element]` - `class ElementUnionMember0: …` - `id: str` - `outputs: ElementUnionMember0Outputs` - `next: ElementUnionMember0OutputsNext` - `element_id: str` - `type: Literal["start"]` - `"start"` - `class ElementUnionMember1: …` - `id: str` - `outputs: ElementUnionMember1Outputs` - `false: ElementUnionMember1OutputsFalse_` - `element_id: str` - `true: ElementUnionMember1OutputsTrue_` - `element_id: str` - `properties: ElementUnionMember1Properties` - `conditions: Optional[object]` - `type: Literal["conditional"]` - `"conditional"` - `class ElementUnionMember2: …` - `id: str` - `outputs: Dict[str, ElementUnionMember2Outputs]` - `element_id: str` - `type: Literal["percentage"]` - `"percentage"` - `class ElementUnionMember3: …` - `id: str` - `outputs: ElementUnionMember3Outputs` - `fallback: ElementUnionMember3OutputsFallback` - `element_id: str` - `success: ElementUnionMember3OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember3Properties` - `key: str` - `limit: float` - `limit_type: Literal["count", "cost"]` - `"count"` - `"cost"` - `window: float` - `type: Literal["rate"]` - `"rate"` - `class ElementUnionMember4: …` - `id: str` - `outputs: ElementUnionMember4Outputs` - `fallback: ElementUnionMember4OutputsFallback` - `element_id: str` - `success: ElementUnionMember4OutputsSuccess` - `element_id: str` - `properties: ElementUnionMember4Properties` - `model: str` - `provider: str` - `retries: float` - `timeout: float` - `type: Literal["model"]` - `"model"` - `class ElementUnionMember5: …` - `id: str` - `outputs: Dict[str, ElementUnionMember5Outputs]` - `element_id: str` - `type: Literal["end"]` - `"end"` - `gateway_id: str` - `modified_at: datetime` - `name: str` - `version_id: str`