## Fetch a Gateway `client.AIGateway.Get(ctx, id, query) (*AIGatewayGetResponse, error)` **get** `/accounts/{account_id}/ai-gateway/gateways/{id}` Retrieves details for a specific AI Gateway dataset. ### Parameters - `id string` gateway id - `query AIGatewayGetParams` - `AccountID param.Field[string]` ### Returns - `type AIGatewayGetResponse struct{…}` - `ID string` gateway id - `CacheInvalidateOnUpdate bool` - `CacheTTL int64` - `CollectLogs bool` - `CreatedAt Time` - `ModifiedAt Time` - `RateLimitingInterval int64` - `RateLimitingLimit int64` - `Authentication bool` - `DLP AIGatewayGetResponseDLP` - `type AIGatewayGetResponseDLPObject struct{…}` - `Action AIGatewayGetResponseDLPObjectAction` - `const AIGatewayGetResponseDLPObjectActionBlock AIGatewayGetResponseDLPObjectAction = "BLOCK"` - `const AIGatewayGetResponseDLPObjectActionFlag AIGatewayGetResponseDLPObjectAction = "FLAG"` - `Enabled bool` - `Profiles []string` - `type AIGatewayGetResponseDLPObject struct{…}` - `Enabled bool` - `Policies []AIGatewayGetResponseDLPObjectPolicy` - `ID string` - `Action AIGatewayGetResponseDLPObjectPoliciesAction` - `const AIGatewayGetResponseDLPObjectPoliciesActionFlag AIGatewayGetResponseDLPObjectPoliciesAction = "FLAG"` - `const AIGatewayGetResponseDLPObjectPoliciesActionBlock AIGatewayGetResponseDLPObjectPoliciesAction = "BLOCK"` - `Check []AIGatewayGetResponseDLPObjectPoliciesCheck` - `const AIGatewayGetResponseDLPObjectPoliciesCheckRequest AIGatewayGetResponseDLPObjectPoliciesCheck = "REQUEST"` - `const AIGatewayGetResponseDLPObjectPoliciesCheckResponse AIGatewayGetResponseDLPObjectPoliciesCheck = "RESPONSE"` - `Enabled bool` - `Profiles []string` - `IsDefault bool` - `LogManagement int64` - `LogManagementStrategy AIGatewayGetResponseLogManagementStrategy` - `const AIGatewayGetResponseLogManagementStrategyStopInserting AIGatewayGetResponseLogManagementStrategy = "STOP_INSERTING"` - `const AIGatewayGetResponseLogManagementStrategyDeleteOldest AIGatewayGetResponseLogManagementStrategy = "DELETE_OLDEST"` - `Logpush bool` - `LogpushPublicKey string` - `Otel []AIGatewayGetResponseOtel` - `Authorization string` - `Headers map[string, string]` - `URL string` - `ContentType AIGatewayGetResponseOtelContentType` - `const AIGatewayGetResponseOtelContentTypeJson AIGatewayGetResponseOtelContentType = "json"` - `const AIGatewayGetResponseOtelContentTypeProtobuf AIGatewayGetResponseOtelContentType = "protobuf"` - `RateLimitingTechnique AIGatewayGetResponseRateLimitingTechnique` - `const AIGatewayGetResponseRateLimitingTechniqueFixed AIGatewayGetResponseRateLimitingTechnique = "fixed"` - `const AIGatewayGetResponseRateLimitingTechniqueSliding AIGatewayGetResponseRateLimitingTechnique = "sliding"` - `RetryBackoff AIGatewayGetResponseRetryBackoff` Backoff strategy for retry delays - `const AIGatewayGetResponseRetryBackoffConstant AIGatewayGetResponseRetryBackoff = "constant"` - `const AIGatewayGetResponseRetryBackoffLinear AIGatewayGetResponseRetryBackoff = "linear"` - `const AIGatewayGetResponseRetryBackoffExponential AIGatewayGetResponseRetryBackoff = "exponential"` - `RetryDelay int64` Delay between retry attempts in milliseconds (0-5000) - `RetryMaxAttempts int64` Maximum number of retry attempts for failed requests (1-5) - `StoreID string` - `Stripe AIGatewayGetResponseStripe` - `Authorization string` - `UsageEvents []AIGatewayGetResponseStripeUsageEvent` - `Payload string` - `WorkersAIBillingMode AIGatewayGetResponseWorkersAIBillingMode` Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported. - `const AIGatewayGetResponseWorkersAIBillingModePostpaid AIGatewayGetResponseWorkersAIBillingMode = "postpaid"` - `Zdr 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"), ) aiGateway, err := client.AIGateway.Get( context.TODO(), "my-gateway", ai_gateway.AIGatewayGetParams{ AccountID: cloudflare.F("3ebbcb006d4d46d7bb6a8c7f14676cb0"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", aiGateway.ID) } ``` #### Response ```json { "result": { "id": "my-gateway", "cache_invalidate_on_update": true, "cache_ttl": 0, "collect_logs": true, "created_at": "2019-12-27T18:11:19.117Z", "modified_at": "2019-12-27T18:11:19.117Z", "rate_limiting_interval": 0, "rate_limiting_limit": 0, "authentication": true, "dlp": { "action": "BLOCK", "enabled": true, "profiles": [ "string" ] }, "is_default": true, "log_management": 10000, "log_management_strategy": "STOP_INSERTING", "logpush": true, "logpush_public_key": "xxxxxxxxxxxxxxxx", "otel": [ { "authorization": "authorization", "headers": { "foo": "string" }, "url": "url", "content_type": "json" } ], "rate_limiting_technique": "fixed", "retry_backoff": "constant", "retry_delay": 0, "retry_max_attempts": 1, "store_id": "store_id", "stripe": { "authorization": "authorization", "usage_events": [ { "payload": "payload" } ] }, "workers_ai_billing_mode": "postpaid", "zdr": true }, "success": true } ```