Skip to content
Start here

Update a Gateway

client.AIGateway.Update(ctx, id, params) (*AIGatewayUpdateResponse, error)
PUT/accounts/{account_id}/ai-gateway/gateways/{id}

Updates an existing AI Gateway dataset.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
AI Gateway Write
ParametersExpand Collapse
id string

gateway id

maxLength64
minLength1
params AIGatewayUpdateParams
AccountID param.Field[string]

Path param

CacheInvalidateOnUpdate param.Field[bool]

Body param

CacheTTL param.Field[int64]

Body param

minimum0
CollectLogs param.Field[bool]

Body param

RateLimitingInterval param.Field[int64]

Body param

minimum0
RateLimitingLimit param.Field[int64]

Body param

minimum0
Authentication param.Field[bool]Optional

Body param

DLP param.Field[AIGatewayUpdateParamsDLP]Optional

Body param

type AIGatewayUpdateParamsDLPObject struct{…}
Action AIGatewayUpdateParamsDLPObjectAction
One of the following:
const AIGatewayUpdateParamsDLPObjectActionBlock AIGatewayUpdateParamsDLPObjectAction = "BLOCK"
const AIGatewayUpdateParamsDLPObjectActionFlag AIGatewayUpdateParamsDLPObjectAction = "FLAG"
Enabled bool
Profiles []string
type AIGatewayUpdateParamsDLPObject struct{…}
Enabled bool
Policies []AIGatewayUpdateParamsDLPObjectPolicy
ID string
Action AIGatewayUpdateParamsDLPObjectPoliciesAction
One of the following:
const AIGatewayUpdateParamsDLPObjectPoliciesActionFlag AIGatewayUpdateParamsDLPObjectPoliciesAction = "FLAG"
const AIGatewayUpdateParamsDLPObjectPoliciesActionBlock AIGatewayUpdateParamsDLPObjectPoliciesAction = "BLOCK"
Check []AIGatewayUpdateParamsDLPObjectPoliciesCheck
One of the following:
const AIGatewayUpdateParamsDLPObjectPoliciesCheckRequest AIGatewayUpdateParamsDLPObjectPoliciesCheck = "REQUEST"
const AIGatewayUpdateParamsDLPObjectPoliciesCheckResponse AIGatewayUpdateParamsDLPObjectPoliciesCheck = "RESPONSE"
Enabled bool
Profiles []string
Guardrails param.Field[AIGatewayUpdateParamsGuardrails]Optional

Body param

Prompt AIGatewayUpdateParamsGuardrailsPrompt
P1 AIGatewayUpdateParamsGuardrailsPromptP1Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsPromptP1Flag AIGatewayUpdateParamsGuardrailsPromptP1 = "FLAG"
const AIGatewayUpdateParamsGuardrailsPromptP1Block AIGatewayUpdateParamsGuardrailsPromptP1 = "BLOCK"
S1 AIGatewayUpdateParamsGuardrailsPromptS1Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsPromptS1Flag AIGatewayUpdateParamsGuardrailsPromptS1 = "FLAG"
const AIGatewayUpdateParamsGuardrailsPromptS1Block AIGatewayUpdateParamsGuardrailsPromptS1 = "BLOCK"
S10 AIGatewayUpdateParamsGuardrailsPromptS10Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsPromptS10Flag AIGatewayUpdateParamsGuardrailsPromptS10 = "FLAG"
const AIGatewayUpdateParamsGuardrailsPromptS10Block AIGatewayUpdateParamsGuardrailsPromptS10 = "BLOCK"
S11 AIGatewayUpdateParamsGuardrailsPromptS11Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsPromptS11Flag AIGatewayUpdateParamsGuardrailsPromptS11 = "FLAG"
const AIGatewayUpdateParamsGuardrailsPromptS11Block AIGatewayUpdateParamsGuardrailsPromptS11 = "BLOCK"
S12 AIGatewayUpdateParamsGuardrailsPromptS12Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsPromptS12Flag AIGatewayUpdateParamsGuardrailsPromptS12 = "FLAG"
const AIGatewayUpdateParamsGuardrailsPromptS12Block AIGatewayUpdateParamsGuardrailsPromptS12 = "BLOCK"
S13 AIGatewayUpdateParamsGuardrailsPromptS13Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsPromptS13Flag AIGatewayUpdateParamsGuardrailsPromptS13 = "FLAG"
const AIGatewayUpdateParamsGuardrailsPromptS13Block AIGatewayUpdateParamsGuardrailsPromptS13 = "BLOCK"
S2 AIGatewayUpdateParamsGuardrailsPromptS2Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsPromptS2Flag AIGatewayUpdateParamsGuardrailsPromptS2 = "FLAG"
const AIGatewayUpdateParamsGuardrailsPromptS2Block AIGatewayUpdateParamsGuardrailsPromptS2 = "BLOCK"
S3 AIGatewayUpdateParamsGuardrailsPromptS3Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsPromptS3Flag AIGatewayUpdateParamsGuardrailsPromptS3 = "FLAG"
const AIGatewayUpdateParamsGuardrailsPromptS3Block AIGatewayUpdateParamsGuardrailsPromptS3 = "BLOCK"
S4 AIGatewayUpdateParamsGuardrailsPromptS4Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsPromptS4Flag AIGatewayUpdateParamsGuardrailsPromptS4 = "FLAG"
const AIGatewayUpdateParamsGuardrailsPromptS4Block AIGatewayUpdateParamsGuardrailsPromptS4 = "BLOCK"
S5 AIGatewayUpdateParamsGuardrailsPromptS5Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsPromptS5Flag AIGatewayUpdateParamsGuardrailsPromptS5 = "FLAG"
const AIGatewayUpdateParamsGuardrailsPromptS5Block AIGatewayUpdateParamsGuardrailsPromptS5 = "BLOCK"
S6 AIGatewayUpdateParamsGuardrailsPromptS6Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsPromptS6Flag AIGatewayUpdateParamsGuardrailsPromptS6 = "FLAG"
const AIGatewayUpdateParamsGuardrailsPromptS6Block AIGatewayUpdateParamsGuardrailsPromptS6 = "BLOCK"
S7 AIGatewayUpdateParamsGuardrailsPromptS7Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsPromptS7Flag AIGatewayUpdateParamsGuardrailsPromptS7 = "FLAG"
const AIGatewayUpdateParamsGuardrailsPromptS7Block AIGatewayUpdateParamsGuardrailsPromptS7 = "BLOCK"
S8 AIGatewayUpdateParamsGuardrailsPromptS8Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsPromptS8Flag AIGatewayUpdateParamsGuardrailsPromptS8 = "FLAG"
const AIGatewayUpdateParamsGuardrailsPromptS8Block AIGatewayUpdateParamsGuardrailsPromptS8 = "BLOCK"
S9 AIGatewayUpdateParamsGuardrailsPromptS9Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsPromptS9Flag AIGatewayUpdateParamsGuardrailsPromptS9 = "FLAG"
const AIGatewayUpdateParamsGuardrailsPromptS9Block AIGatewayUpdateParamsGuardrailsPromptS9 = "BLOCK"
Response AIGatewayUpdateParamsGuardrailsResponse
P1 AIGatewayUpdateParamsGuardrailsResponseP1Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsResponseP1Flag AIGatewayUpdateParamsGuardrailsResponseP1 = "FLAG"
const AIGatewayUpdateParamsGuardrailsResponseP1Block AIGatewayUpdateParamsGuardrailsResponseP1 = "BLOCK"
S1 AIGatewayUpdateParamsGuardrailsResponseS1Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsResponseS1Flag AIGatewayUpdateParamsGuardrailsResponseS1 = "FLAG"
const AIGatewayUpdateParamsGuardrailsResponseS1Block AIGatewayUpdateParamsGuardrailsResponseS1 = "BLOCK"
S10 AIGatewayUpdateParamsGuardrailsResponseS10Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsResponseS10Flag AIGatewayUpdateParamsGuardrailsResponseS10 = "FLAG"
const AIGatewayUpdateParamsGuardrailsResponseS10Block AIGatewayUpdateParamsGuardrailsResponseS10 = "BLOCK"
S11 AIGatewayUpdateParamsGuardrailsResponseS11Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsResponseS11Flag AIGatewayUpdateParamsGuardrailsResponseS11 = "FLAG"
const AIGatewayUpdateParamsGuardrailsResponseS11Block AIGatewayUpdateParamsGuardrailsResponseS11 = "BLOCK"
S12 AIGatewayUpdateParamsGuardrailsResponseS12Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsResponseS12Flag AIGatewayUpdateParamsGuardrailsResponseS12 = "FLAG"
const AIGatewayUpdateParamsGuardrailsResponseS12Block AIGatewayUpdateParamsGuardrailsResponseS12 = "BLOCK"
S13 AIGatewayUpdateParamsGuardrailsResponseS13Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsResponseS13Flag AIGatewayUpdateParamsGuardrailsResponseS13 = "FLAG"
const AIGatewayUpdateParamsGuardrailsResponseS13Block AIGatewayUpdateParamsGuardrailsResponseS13 = "BLOCK"
S2 AIGatewayUpdateParamsGuardrailsResponseS2Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsResponseS2Flag AIGatewayUpdateParamsGuardrailsResponseS2 = "FLAG"
const AIGatewayUpdateParamsGuardrailsResponseS2Block AIGatewayUpdateParamsGuardrailsResponseS2 = "BLOCK"
S3 AIGatewayUpdateParamsGuardrailsResponseS3Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsResponseS3Flag AIGatewayUpdateParamsGuardrailsResponseS3 = "FLAG"
const AIGatewayUpdateParamsGuardrailsResponseS3Block AIGatewayUpdateParamsGuardrailsResponseS3 = "BLOCK"
S4 AIGatewayUpdateParamsGuardrailsResponseS4Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsResponseS4Flag AIGatewayUpdateParamsGuardrailsResponseS4 = "FLAG"
const AIGatewayUpdateParamsGuardrailsResponseS4Block AIGatewayUpdateParamsGuardrailsResponseS4 = "BLOCK"
S5 AIGatewayUpdateParamsGuardrailsResponseS5Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsResponseS5Flag AIGatewayUpdateParamsGuardrailsResponseS5 = "FLAG"
const AIGatewayUpdateParamsGuardrailsResponseS5Block AIGatewayUpdateParamsGuardrailsResponseS5 = "BLOCK"
S6 AIGatewayUpdateParamsGuardrailsResponseS6Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsResponseS6Flag AIGatewayUpdateParamsGuardrailsResponseS6 = "FLAG"
const AIGatewayUpdateParamsGuardrailsResponseS6Block AIGatewayUpdateParamsGuardrailsResponseS6 = "BLOCK"
S7 AIGatewayUpdateParamsGuardrailsResponseS7Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsResponseS7Flag AIGatewayUpdateParamsGuardrailsResponseS7 = "FLAG"
const AIGatewayUpdateParamsGuardrailsResponseS7Block AIGatewayUpdateParamsGuardrailsResponseS7 = "BLOCK"
S8 AIGatewayUpdateParamsGuardrailsResponseS8Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsResponseS8Flag AIGatewayUpdateParamsGuardrailsResponseS8 = "FLAG"
const AIGatewayUpdateParamsGuardrailsResponseS8Block AIGatewayUpdateParamsGuardrailsResponseS8 = "BLOCK"
S9 AIGatewayUpdateParamsGuardrailsResponseS9Optional
One of the following:
const AIGatewayUpdateParamsGuardrailsResponseS9Flag AIGatewayUpdateParamsGuardrailsResponseS9 = "FLAG"
const AIGatewayUpdateParamsGuardrailsResponseS9Block AIGatewayUpdateParamsGuardrailsResponseS9 = "BLOCK"
LogManagement param.Field[int64]Optional

Body param

maximum10000000
minimum10000
LogManagementStrategy param.Field[AIGatewayUpdateParamsLogManagementStrategy]Optional

Body param

const AIGatewayUpdateParamsLogManagementStrategyStopInserting AIGatewayUpdateParamsLogManagementStrategy = "STOP_INSERTING"
const AIGatewayUpdateParamsLogManagementStrategyDeleteOldest AIGatewayUpdateParamsLogManagementStrategy = "DELETE_OLDEST"
Logpush param.Field[bool]Optional

Body param

LogpushPublicKey param.Field[string]Optional

Body param

maxLength1024
minLength16
Otel param.Field[[]AIGatewayUpdateParamsOtel]Optional

Body param

Authorization string
maxLength256
Headers map[string, string]
URL string
formaturi
maxLength2048
ContentType AIGatewayUpdateParamsOtelContentTypeOptional
One of the following:
const AIGatewayUpdateParamsOtelContentTypeJson AIGatewayUpdateParamsOtelContentType = "json"
const AIGatewayUpdateParamsOtelContentTypeProtobuf AIGatewayUpdateParamsOtelContentType = "protobuf"
RateLimitingTechnique param.Field[AIGatewayUpdateParamsRateLimitingTechnique]Optional

Body param

const AIGatewayUpdateParamsRateLimitingTechniqueFixed AIGatewayUpdateParamsRateLimitingTechnique = "fixed"
const AIGatewayUpdateParamsRateLimitingTechniqueSliding AIGatewayUpdateParamsRateLimitingTechnique = "sliding"
RetryBackoff param.Field[AIGatewayUpdateParamsRetryBackoff]Optional

Body param: Backoff strategy for retry delays

const AIGatewayUpdateParamsRetryBackoffConstant AIGatewayUpdateParamsRetryBackoff = "constant"
const AIGatewayUpdateParamsRetryBackoffLinear AIGatewayUpdateParamsRetryBackoff = "linear"
const AIGatewayUpdateParamsRetryBackoffExponential AIGatewayUpdateParamsRetryBackoff = "exponential"
RetryDelay param.Field[int64]Optional

Body param: Delay between retry attempts in milliseconds (0-5000)

maximum5000
minimum0
RetryMaxAttempts param.Field[int64]Optional

Body param: Maximum number of retry attempts for failed requests (1-5)

maximum5
minimum1
StoreID param.Field[string]Optional

Body param

Stripe param.Field[AIGatewayUpdateParamsStripe]Optional

Body param

Authorization string
UsageEvents []AIGatewayUpdateParamsStripeUsageEvent
Payload string
WorkersAIBillingMode param.Field[AIGatewayUpdateParamsWorkersAIBillingMode]Optional

Body param: Controls how Workers AI inference calls routed through this gateway are billed. Only ‘postpaid’ is currently supported.

const AIGatewayUpdateParamsWorkersAIBillingModePostpaid AIGatewayUpdateParamsWorkersAIBillingMode = "postpaid"
Zdr param.Field[bool]Optional

Body param

ReturnsExpand Collapse
type AIGatewayUpdateResponse struct{…}
ID string

gateway id

maxLength64
minLength1
CacheInvalidateOnUpdate bool
CacheTTL int64
minimum0
CollectLogs bool
CreatedAt Time
formatdate-time
ModifiedAt Time
formatdate-time
RateLimitingInterval int64
minimum0
RateLimitingLimit int64
minimum0
Authentication boolOptional
DLP AIGatewayUpdateResponseDLPOptional
One of the following:
type AIGatewayUpdateResponseDLPObject struct{…}
Action AIGatewayUpdateResponseDLPObjectAction
One of the following:
const AIGatewayUpdateResponseDLPObjectActionBlock AIGatewayUpdateResponseDLPObjectAction = "BLOCK"
const AIGatewayUpdateResponseDLPObjectActionFlag AIGatewayUpdateResponseDLPObjectAction = "FLAG"
Enabled bool
Profiles []string
type AIGatewayUpdateResponseDLPObject struct{…}
Enabled bool
Policies []AIGatewayUpdateResponseDLPObjectPolicy
ID string
Action AIGatewayUpdateResponseDLPObjectPoliciesAction
One of the following:
const AIGatewayUpdateResponseDLPObjectPoliciesActionFlag AIGatewayUpdateResponseDLPObjectPoliciesAction = "FLAG"
const AIGatewayUpdateResponseDLPObjectPoliciesActionBlock AIGatewayUpdateResponseDLPObjectPoliciesAction = "BLOCK"
Check []AIGatewayUpdateResponseDLPObjectPoliciesCheck
One of the following:
const AIGatewayUpdateResponseDLPObjectPoliciesCheckRequest AIGatewayUpdateResponseDLPObjectPoliciesCheck = "REQUEST"
const AIGatewayUpdateResponseDLPObjectPoliciesCheckResponse AIGatewayUpdateResponseDLPObjectPoliciesCheck = "RESPONSE"
Enabled bool
Profiles []string
Guardrails AIGatewayUpdateResponseGuardrailsOptional
Prompt AIGatewayUpdateResponseGuardrailsPrompt
P1 AIGatewayUpdateResponseGuardrailsPromptP1Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsPromptP1Flag AIGatewayUpdateResponseGuardrailsPromptP1 = "FLAG"
const AIGatewayUpdateResponseGuardrailsPromptP1Block AIGatewayUpdateResponseGuardrailsPromptP1 = "BLOCK"
S1 AIGatewayUpdateResponseGuardrailsPromptS1Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsPromptS1Flag AIGatewayUpdateResponseGuardrailsPromptS1 = "FLAG"
const AIGatewayUpdateResponseGuardrailsPromptS1Block AIGatewayUpdateResponseGuardrailsPromptS1 = "BLOCK"
S10 AIGatewayUpdateResponseGuardrailsPromptS10Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsPromptS10Flag AIGatewayUpdateResponseGuardrailsPromptS10 = "FLAG"
const AIGatewayUpdateResponseGuardrailsPromptS10Block AIGatewayUpdateResponseGuardrailsPromptS10 = "BLOCK"
S11 AIGatewayUpdateResponseGuardrailsPromptS11Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsPromptS11Flag AIGatewayUpdateResponseGuardrailsPromptS11 = "FLAG"
const AIGatewayUpdateResponseGuardrailsPromptS11Block AIGatewayUpdateResponseGuardrailsPromptS11 = "BLOCK"
S12 AIGatewayUpdateResponseGuardrailsPromptS12Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsPromptS12Flag AIGatewayUpdateResponseGuardrailsPromptS12 = "FLAG"
const AIGatewayUpdateResponseGuardrailsPromptS12Block AIGatewayUpdateResponseGuardrailsPromptS12 = "BLOCK"
S13 AIGatewayUpdateResponseGuardrailsPromptS13Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsPromptS13Flag AIGatewayUpdateResponseGuardrailsPromptS13 = "FLAG"
const AIGatewayUpdateResponseGuardrailsPromptS13Block AIGatewayUpdateResponseGuardrailsPromptS13 = "BLOCK"
S2 AIGatewayUpdateResponseGuardrailsPromptS2Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsPromptS2Flag AIGatewayUpdateResponseGuardrailsPromptS2 = "FLAG"
const AIGatewayUpdateResponseGuardrailsPromptS2Block AIGatewayUpdateResponseGuardrailsPromptS2 = "BLOCK"
S3 AIGatewayUpdateResponseGuardrailsPromptS3Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsPromptS3Flag AIGatewayUpdateResponseGuardrailsPromptS3 = "FLAG"
const AIGatewayUpdateResponseGuardrailsPromptS3Block AIGatewayUpdateResponseGuardrailsPromptS3 = "BLOCK"
S4 AIGatewayUpdateResponseGuardrailsPromptS4Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsPromptS4Flag AIGatewayUpdateResponseGuardrailsPromptS4 = "FLAG"
const AIGatewayUpdateResponseGuardrailsPromptS4Block AIGatewayUpdateResponseGuardrailsPromptS4 = "BLOCK"
S5 AIGatewayUpdateResponseGuardrailsPromptS5Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsPromptS5Flag AIGatewayUpdateResponseGuardrailsPromptS5 = "FLAG"
const AIGatewayUpdateResponseGuardrailsPromptS5Block AIGatewayUpdateResponseGuardrailsPromptS5 = "BLOCK"
S6 AIGatewayUpdateResponseGuardrailsPromptS6Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsPromptS6Flag AIGatewayUpdateResponseGuardrailsPromptS6 = "FLAG"
const AIGatewayUpdateResponseGuardrailsPromptS6Block AIGatewayUpdateResponseGuardrailsPromptS6 = "BLOCK"
S7 AIGatewayUpdateResponseGuardrailsPromptS7Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsPromptS7Flag AIGatewayUpdateResponseGuardrailsPromptS7 = "FLAG"
const AIGatewayUpdateResponseGuardrailsPromptS7Block AIGatewayUpdateResponseGuardrailsPromptS7 = "BLOCK"
S8 AIGatewayUpdateResponseGuardrailsPromptS8Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsPromptS8Flag AIGatewayUpdateResponseGuardrailsPromptS8 = "FLAG"
const AIGatewayUpdateResponseGuardrailsPromptS8Block AIGatewayUpdateResponseGuardrailsPromptS8 = "BLOCK"
S9 AIGatewayUpdateResponseGuardrailsPromptS9Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsPromptS9Flag AIGatewayUpdateResponseGuardrailsPromptS9 = "FLAG"
const AIGatewayUpdateResponseGuardrailsPromptS9Block AIGatewayUpdateResponseGuardrailsPromptS9 = "BLOCK"
Response AIGatewayUpdateResponseGuardrailsResponse
P1 AIGatewayUpdateResponseGuardrailsResponseP1Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsResponseP1Flag AIGatewayUpdateResponseGuardrailsResponseP1 = "FLAG"
const AIGatewayUpdateResponseGuardrailsResponseP1Block AIGatewayUpdateResponseGuardrailsResponseP1 = "BLOCK"
S1 AIGatewayUpdateResponseGuardrailsResponseS1Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsResponseS1Flag AIGatewayUpdateResponseGuardrailsResponseS1 = "FLAG"
const AIGatewayUpdateResponseGuardrailsResponseS1Block AIGatewayUpdateResponseGuardrailsResponseS1 = "BLOCK"
S10 AIGatewayUpdateResponseGuardrailsResponseS10Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsResponseS10Flag AIGatewayUpdateResponseGuardrailsResponseS10 = "FLAG"
const AIGatewayUpdateResponseGuardrailsResponseS10Block AIGatewayUpdateResponseGuardrailsResponseS10 = "BLOCK"
S11 AIGatewayUpdateResponseGuardrailsResponseS11Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsResponseS11Flag AIGatewayUpdateResponseGuardrailsResponseS11 = "FLAG"
const AIGatewayUpdateResponseGuardrailsResponseS11Block AIGatewayUpdateResponseGuardrailsResponseS11 = "BLOCK"
S12 AIGatewayUpdateResponseGuardrailsResponseS12Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsResponseS12Flag AIGatewayUpdateResponseGuardrailsResponseS12 = "FLAG"
const AIGatewayUpdateResponseGuardrailsResponseS12Block AIGatewayUpdateResponseGuardrailsResponseS12 = "BLOCK"
S13 AIGatewayUpdateResponseGuardrailsResponseS13Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsResponseS13Flag AIGatewayUpdateResponseGuardrailsResponseS13 = "FLAG"
const AIGatewayUpdateResponseGuardrailsResponseS13Block AIGatewayUpdateResponseGuardrailsResponseS13 = "BLOCK"
S2 AIGatewayUpdateResponseGuardrailsResponseS2Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsResponseS2Flag AIGatewayUpdateResponseGuardrailsResponseS2 = "FLAG"
const AIGatewayUpdateResponseGuardrailsResponseS2Block AIGatewayUpdateResponseGuardrailsResponseS2 = "BLOCK"
S3 AIGatewayUpdateResponseGuardrailsResponseS3Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsResponseS3Flag AIGatewayUpdateResponseGuardrailsResponseS3 = "FLAG"
const AIGatewayUpdateResponseGuardrailsResponseS3Block AIGatewayUpdateResponseGuardrailsResponseS3 = "BLOCK"
S4 AIGatewayUpdateResponseGuardrailsResponseS4Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsResponseS4Flag AIGatewayUpdateResponseGuardrailsResponseS4 = "FLAG"
const AIGatewayUpdateResponseGuardrailsResponseS4Block AIGatewayUpdateResponseGuardrailsResponseS4 = "BLOCK"
S5 AIGatewayUpdateResponseGuardrailsResponseS5Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsResponseS5Flag AIGatewayUpdateResponseGuardrailsResponseS5 = "FLAG"
const AIGatewayUpdateResponseGuardrailsResponseS5Block AIGatewayUpdateResponseGuardrailsResponseS5 = "BLOCK"
S6 AIGatewayUpdateResponseGuardrailsResponseS6Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsResponseS6Flag AIGatewayUpdateResponseGuardrailsResponseS6 = "FLAG"
const AIGatewayUpdateResponseGuardrailsResponseS6Block AIGatewayUpdateResponseGuardrailsResponseS6 = "BLOCK"
S7 AIGatewayUpdateResponseGuardrailsResponseS7Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsResponseS7Flag AIGatewayUpdateResponseGuardrailsResponseS7 = "FLAG"
const AIGatewayUpdateResponseGuardrailsResponseS7Block AIGatewayUpdateResponseGuardrailsResponseS7 = "BLOCK"
S8 AIGatewayUpdateResponseGuardrailsResponseS8Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsResponseS8Flag AIGatewayUpdateResponseGuardrailsResponseS8 = "FLAG"
const AIGatewayUpdateResponseGuardrailsResponseS8Block AIGatewayUpdateResponseGuardrailsResponseS8 = "BLOCK"
S9 AIGatewayUpdateResponseGuardrailsResponseS9Optional
One of the following:
const AIGatewayUpdateResponseGuardrailsResponseS9Flag AIGatewayUpdateResponseGuardrailsResponseS9 = "FLAG"
const AIGatewayUpdateResponseGuardrailsResponseS9Block AIGatewayUpdateResponseGuardrailsResponseS9 = "BLOCK"
IsDefault boolOptional
LogManagement int64Optional
maximum10000000
minimum10000
LogManagementStrategy AIGatewayUpdateResponseLogManagementStrategyOptional
One of the following:
const AIGatewayUpdateResponseLogManagementStrategyStopInserting AIGatewayUpdateResponseLogManagementStrategy = "STOP_INSERTING"
const AIGatewayUpdateResponseLogManagementStrategyDeleteOldest AIGatewayUpdateResponseLogManagementStrategy = "DELETE_OLDEST"
Logpush boolOptional
LogpushPublicKey stringOptional
maxLength1024
minLength16
Otel []AIGatewayUpdateResponseOtelOptional
Authorization string
maxLength256
Headers map[string, string]
URL string
formaturi
maxLength2048
ContentType AIGatewayUpdateResponseOtelContentTypeOptional
One of the following:
const AIGatewayUpdateResponseOtelContentTypeJson AIGatewayUpdateResponseOtelContentType = "json"
const AIGatewayUpdateResponseOtelContentTypeProtobuf AIGatewayUpdateResponseOtelContentType = "protobuf"
RateLimitingTechnique AIGatewayUpdateResponseRateLimitingTechniqueOptional
One of the following:
const AIGatewayUpdateResponseRateLimitingTechniqueFixed AIGatewayUpdateResponseRateLimitingTechnique = "fixed"
const AIGatewayUpdateResponseRateLimitingTechniqueSliding AIGatewayUpdateResponseRateLimitingTechnique = "sliding"
RetryBackoff AIGatewayUpdateResponseRetryBackoffOptional

Backoff strategy for retry delays

One of the following:
const AIGatewayUpdateResponseRetryBackoffConstant AIGatewayUpdateResponseRetryBackoff = "constant"
const AIGatewayUpdateResponseRetryBackoffLinear AIGatewayUpdateResponseRetryBackoff = "linear"
const AIGatewayUpdateResponseRetryBackoffExponential AIGatewayUpdateResponseRetryBackoff = "exponential"
RetryDelay int64Optional

Delay between retry attempts in milliseconds (0-5000)

maximum5000
minimum0
RetryMaxAttempts int64Optional

Maximum number of retry attempts for failed requests (1-5)

maximum5
minimum1
StoreID stringOptional
Stripe AIGatewayUpdateResponseStripeOptional
Authorization string
UsageEvents []AIGatewayUpdateResponseStripeUsageEvent
Payload string
WorkersAIBillingMode AIGatewayUpdateResponseWorkersAIBillingModeOptional

Controls how Workers AI inference calls routed through this gateway are billed. Only ‘postpaid’ is currently supported.

Zdr boolOptional

Update a Gateway

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.Update(
    context.TODO(),
    "my-gateway",
    ai_gateway.AIGatewayUpdateParams{
      AccountID: cloudflare.F("3ebbcb006d4d46d7bb6a8c7f14676cb0"),
      CacheInvalidateOnUpdate: cloudflare.F(true),
      CacheTTL: cloudflare.F(int64(0)),
      CollectLogs: cloudflare.F(true),
      RateLimitingInterval: cloudflare.F(int64(0)),
      RateLimitingLimit: cloudflare.F(int64(0)),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", aiGateway.ID)
}
{
  "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"
      ]
    },
    "guardrails": {
      "prompt": {
        "P1": "FLAG",
        "S1": "FLAG",
        "S10": "FLAG",
        "S11": "FLAG",
        "S12": "FLAG",
        "S13": "FLAG",
        "S2": "FLAG",
        "S3": "FLAG",
        "S4": "FLAG",
        "S5": "FLAG",
        "S6": "FLAG",
        "S7": "FLAG",
        "S8": "FLAG",
        "S9": "FLAG"
      },
      "response": {
        "P1": "FLAG",
        "S1": "FLAG",
        "S10": "FLAG",
        "S11": "FLAG",
        "S12": "FLAG",
        "S13": "FLAG",
        "S2": "FLAG",
        "S3": "FLAG",
        "S4": "FLAG",
        "S5": "FLAG",
        "S6": "FLAG",
        "S7": "FLAG",
        "S8": "FLAG",
        "S9": "FLAG"
      }
    },
    "is_default": true,
    "log_management": 10000,
    "log_management_strategy": "STOP_INSERTING",
    "logpush": true,
    "logpush_public_key": "xxxxxxxxxxxxxxxx",
    "otel": [
      {
        "authorization": "authorization",
        "headers": {
          "foo": "string"
        },
        "url": "https://example.com",
        "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
}
Returns Examples
{
  "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"
      ]
    },
    "guardrails": {
      "prompt": {
        "P1": "FLAG",
        "S1": "FLAG",
        "S10": "FLAG",
        "S11": "FLAG",
        "S12": "FLAG",
        "S13": "FLAG",
        "S2": "FLAG",
        "S3": "FLAG",
        "S4": "FLAG",
        "S5": "FLAG",
        "S6": "FLAG",
        "S7": "FLAG",
        "S8": "FLAG",
        "S9": "FLAG"
      },
      "response": {
        "P1": "FLAG",
        "S1": "FLAG",
        "S10": "FLAG",
        "S11": "FLAG",
        "S12": "FLAG",
        "S13": "FLAG",
        "S2": "FLAG",
        "S3": "FLAG",
        "S4": "FLAG",
        "S5": "FLAG",
        "S6": "FLAG",
        "S7": "FLAG",
        "S8": "FLAG",
        "S9": "FLAG"
      }
    },
    "is_default": true,
    "log_management": 10000,
    "log_management_strategy": "STOP_INSERTING",
    "logpush": true,
    "logpush_public_key": "xxxxxxxxxxxxxxxx",
    "otel": [
      {
        "authorization": "authorization",
        "headers": {
          "foo": "string"
        },
        "url": "https://example.com",
        "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
}