## List all AI Gateway Dynamic Routes. `client.AIGateway.DynamicRouting.List(ctx, gatewayID, query) (*DynamicRoutingListResponse, error)` **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes` List all AI Gateway Dynamic Routes. ### Parameters - `gatewayID string` - `query DynamicRoutingListParams` - `AccountID param.Field[string]` ### Returns - `type DynamicRoutingListResponse struct{…}` - `Data DynamicRoutingListResponseData` - `OrderBy string` - `OrderByDirection string` - `Page float64` - `PerPage float64` - `Routes []DynamicRoutingListResponseDataRoute` - `ID string` - `AccountTag string` - `CreatedAt Time` - `Deployment DynamicRoutingListResponseDataRoutesDeployment` - `CreatedAt string` - `DeploymentID string` - `VersionID string` - `Elements []DynamicRoutingListResponseDataRoutesElement` - `type DynamicRoutingListResponseDataRoutesElementsObject struct{…}` - `ID string` - `Outputs DynamicRoutingListResponseDataRoutesElementsObjectOutputs` - `Next DynamicRoutingListResponseDataRoutesElementsObjectOutputsNext` - `ElementID string` - `Type DynamicRoutingListResponseDataRoutesElementsObjectType` - `const DynamicRoutingListResponseDataRoutesElementsObjectTypeStart DynamicRoutingListResponseDataRoutesElementsObjectType = "start"` - `type DynamicRoutingListResponseDataRoutesElementsObject struct{…}` - `ID string` - `Outputs DynamicRoutingListResponseDataRoutesElementsObjectOutputs` - `False DynamicRoutingListResponseDataRoutesElementsObjectOutputsFalse` - `ElementID string` - `True DynamicRoutingListResponseDataRoutesElementsObjectOutputsTrue` - `ElementID string` - `Properties DynamicRoutingListResponseDataRoutesElementsObjectProperties` - `Conditions unknown` - `Type DynamicRoutingListResponseDataRoutesElementsObjectType` - `const DynamicRoutingListResponseDataRoutesElementsObjectTypeConditional DynamicRoutingListResponseDataRoutesElementsObjectType = "conditional"` - `type DynamicRoutingListResponseDataRoutesElementsObject struct{…}` - `ID string` - `Outputs map[string, DynamicRoutingListResponseDataRoutesElementsObjectOutput]` - `ElementID string` - `Type DynamicRoutingListResponseDataRoutesElementsObjectType` - `const DynamicRoutingListResponseDataRoutesElementsObjectTypePercentage DynamicRoutingListResponseDataRoutesElementsObjectType = "percentage"` - `type DynamicRoutingListResponseDataRoutesElementsObject struct{…}` - `ID string` - `Outputs DynamicRoutingListResponseDataRoutesElementsObjectOutputs` - `Fallback DynamicRoutingListResponseDataRoutesElementsObjectOutputsFallback` - `ElementID string` - `Success DynamicRoutingListResponseDataRoutesElementsObjectOutputsSuccess` - `ElementID string` - `Properties DynamicRoutingListResponseDataRoutesElementsObjectProperties` - `Key string` - `Limit float64` - `LimitType DynamicRoutingListResponseDataRoutesElementsObjectPropertiesLimitType` - `const DynamicRoutingListResponseDataRoutesElementsObjectPropertiesLimitTypeCount DynamicRoutingListResponseDataRoutesElementsObjectPropertiesLimitType = "count"` - `const DynamicRoutingListResponseDataRoutesElementsObjectPropertiesLimitTypeCost DynamicRoutingListResponseDataRoutesElementsObjectPropertiesLimitType = "cost"` - `Window float64` - `Type DynamicRoutingListResponseDataRoutesElementsObjectType` - `const DynamicRoutingListResponseDataRoutesElementsObjectTypeRate DynamicRoutingListResponseDataRoutesElementsObjectType = "rate"` - `type DynamicRoutingListResponseDataRoutesElementsObject struct{…}` - `ID string` - `Outputs DynamicRoutingListResponseDataRoutesElementsObjectOutputs` - `Fallback DynamicRoutingListResponseDataRoutesElementsObjectOutputsFallback` - `ElementID string` - `Success DynamicRoutingListResponseDataRoutesElementsObjectOutputsSuccess` - `ElementID string` - `Properties DynamicRoutingListResponseDataRoutesElementsObjectProperties` - `Model string` - `Provider string` - `Retries float64` - `Timeout float64` - `Type DynamicRoutingListResponseDataRoutesElementsObjectType` - `const DynamicRoutingListResponseDataRoutesElementsObjectTypeModel DynamicRoutingListResponseDataRoutesElementsObjectType = "model"` - `type DynamicRoutingListResponseDataRoutesElementsObject struct{…}` - `ID string` - `Outputs map[string, DynamicRoutingListResponseDataRoutesElementsObjectOutput]` - `ElementID string` - `Type DynamicRoutingListResponseDataRoutesElementsObjectType` - `const DynamicRoutingListResponseDataRoutesElementsObjectTypeEnd DynamicRoutingListResponseDataRoutesElementsObjectType = "end"` - `GatewayID string` - `ModifiedAt Time` - `Name string` - `Version DynamicRoutingListResponseDataRoutesVersion` - `Active DynamicRoutingListResponseDataRoutesVersionActive` - `const DynamicRoutingListResponseDataRoutesVersionActiveTrue DynamicRoutingListResponseDataRoutesVersionActive = "true"` - `const DynamicRoutingListResponseDataRoutesVersionActiveFalse DynamicRoutingListResponseDataRoutesVersionActive = "false"` - `CreatedAt string` - `Data string` - `VersionID string` - `Success bool` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ai_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) dynamicRoutings, err := client.AIGateway.DynamicRouting.List( context.TODO(), "54442216", ai_gateway.DynamicRoutingListParams{ AccountID: cloudflare.F("0d37909e38d3e99c29fa2cd343ac421a"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", dynamicRoutings.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 } ```