All Products
Search
Document Center

API Gateway:HttpApiPolicyConfigs

Last Updated:Feb 04, 2026
ParameterTypeDescriptionExample
object

body

typestring

Policy Type

AiCache
enableboolean

Policy Enable

true
aiFallbackConfigobject

AiFallbackConfig

serviceConfigsarray<object>

List of fallback service configurations

object

object

serviceIdstring

Fallback service ID

svc-123456
namestring

Service name for frontend display

azure.ai
targetModelNamestring

Target model name for fallback

kimi-fallback-test
passThroughModelNameboolean

Whether to pass through the original model name

true
onlyRedirectUpstreamCodeboolean

Only trigger fallback when backend returns 4xx/5xx status codes

true
routeEmbeddedboolean

Whether the policy is generated from route embedded configuration

true
aiSecurityGuardConfigobject

AiSecurityGuardConfig

serviceAddressstring

Security guard service endpoint URL

https://api.example.com/v1
checkRequestboolean

Enable request content checking

true
checkResponseboolean

Enable response content checking

true
checkRequestImageboolean

Enable request image checking

true
checkResponseImageboolean

Enable response image checking

true
requestCheckServicestring

Request text check service type

content-moderation-service
responseCheckServicestring

Response text check service type

output-moderation-service
requestImageCheckServicestring

Request image check service type

image-moderation-service
responseImageCheckServicestring

Response image check service type

generated-image-scanner
riskAlertLevelstring

Global risk alert level

high
riskConfigarray<object>

RiskConfig

object

object

typestring

Risk type

ContentModeration
levelstring

Risk level

high
consumerRulesobject

consumerRules

patternstring

pattern

/v1/chat/*
matchTypestring

matchType

Exact
bufferLimitinteger

Buffer limit for content checking

1000
pluginStatusobject

pluginStatus

errorLogsobject

errorLogs

string

string

Failed to connect to server
serviceHealthyboolean

serviceHealthy

true
pluginIdstring

pluginId

pl-123456
consumerRequestCheckServicearray<object>

consumerRequestCheckService

object

object

namestring

Consumer name

consumer-1
requestCheckServicestring

requestCheckService

query_security_check
requestImageCheckServicestring

requestImageCheckService

nsfw-image-detector
matchTypestring

Match type

Exact
modalityTypestring

Modality type

Text
consumerResponseCheckServicearray<object>

consumerResponseCheckService

object

object

namestring

Consumer name

consumer-1
responseCheckServicestring

responseCheckService

response_security_check
responseImageCheckServicestring

responseImageCheckService

watermark-detector
matchTypestring

Match type

Exact
modalityTypestring

Modality type

Text
consumerRiskLevelarray<object>

consumerRiskLevel

object

object

namestring

Consumer name

consumer-1
matchTypestring

Match type

Exact
typestring

Risk type

ContentModeration
levelstring

Risk level

high
aiTokenRateLimitConfigobject

AiTokenRateLimitConfig

rulesarray<object>

List of rate limit rules

object

object

limitTypestring

Limit type

Header
matchKeystring

Match key

x-api-key
matchTypestring

Match type

Exact
matchValuestring

Match value

test-value
limitModestring

Limit mode

TokenPerSecond
limitValuestring

Limit value

100
enableGlobalRulesboolean

Enable global rate limit rules

true
globalRulesarray<object>

List of global rate limit rules

object

object

limitTypestring

Limit type

Global
matchKeystring

Match key

user_id
matchTypestring

Match type

Exact
matchValuestring

Match value

12345
limitModestring

Limit mode

TokenPerSecond
limitValuestring

Limit value

100
redisConfigobject

Redis Config

hoststring

Redis host

redis.example.com
portinteger

Redis port

6379
usernamestring

Redis username

username
passwordstring

Redis password

******
timeoutinteger

Redis timeout

60
databaseNumberinteger

Redis database number

1
pluginStatusobject

pluginStatus

errorLogsobject

Array of plugin execution error logs

string

string

auth-failed
serviceHealthyboolean

Health status of the cache service

true
pluginIdstring

Plugin instance unique identifier

pl-123456
aiCacheConfigobject

AiCacheConfig

cacheTTLinteger

Cache time-to-live in seconds

3600
redisConfigobject

Redis configuration for cache storage

hoststring

Redis host

redis.example.com
portinteger

Redis port

6379
usernamestring

Redis username

username
passwordstring

Redis password

******
timeoutinteger

Redis timeout

60
databaseNumberinteger

Redis database number

1
vectorConfigobject

vectorConfig

typestring

Vector database service type

dashvector
serviceHoststring

Vector database service host address

vec.example.com
apiKeystring

Vector database API key for authentication

vec-api-key-123
timeoutinteger

Vector database request timeout in milliseconds

1000
collectionIdstring

Vector database collection ID for storing vector embeddings

col-1
thresholdfloat

Similarity threshold for semantic matching

0.8
embeddingConfigobject

Embedding Config

typestring

Embedding service provider type

dashscope
serviceIdstring

Embedding service ID

svc-1
timeoutinteger

Embedding service request timeout in milliseconds

2000
modelNamestring

Embedding model name

model-1
cacheKeyStrategystring

Strategy for generating cache keys

default
cacheModestring

Cache mode type

exact
pluginStatusobject

pluginStatus

errorLogsobject

errorLogs

string

string

timeout
serviceHealthyboolean

serviceHealthy

true
pluginIdstring

pluginId

pl-123456
aiNetworkSearchConfigobject

AiNetworkSearchConfig

needReferenceboolean

Add reference sources in answer

true
referenceFormatstring

Reference format

Reference: %s
referenceLocationstring

Reference location

head
defaultLangstring

Default search language code

zh-CN
defaultEnableboolean

Default enable

true
searchFromarray<object>

Search engine list

object

object

typestring

Search engine type

Bing
apiKeystring

Search engine API key

xxx
countinteger

Result count

10
startinteger

Result offset

0
timeoutMillisecondinteger

API call timeout in milliseconds

5000
optionArgsobject

Additional parameters

string

string

value
endpointstring

Search engine endpoint

******-hangzhou.aliyuncs.com
contentModestring

Content mode

summary
industrystring

Industry

tech
timeRangestring

Time range

7d
searchEngineConfigobject

Search engine configuration

typestring

Search engine type: Bing/aliyunQuark

Bing
apiKeystring

Search engine API key

xxx
countinteger

Result count

10
startinteger

Result offset

0
timeoutMillisecondinteger

API call timeout in milliseconds

5000
optionArgsobject

Additional parameters

string

string

value
endpointstring

Search engine endpoint

******-hangzhou.aliyuncs.com
contentModestring

Content mode

summary
industrystring

Industry

tech
timeRangestring

Time range

7d
searchRewriteobject

Search rewrite configuration

enableboolean

Enable search rewrite

true
serviceIdstring

Service ID

svc-123456
modelNamestring

Model name

qwen-turbo
timeoutMillisecondinteger

Timeout in milliseconds

5000
maxCountinteger

Max rewrite count (1-5)

3
pluginStatusobject

pluginStatus

errorLogsobject

errorLogs

string

string

timeout
serviceHealthyboolean

serviceHealthy

true
pluginIdstring

pluginId

pl-123456
aiToolSelectionConfigobject

AiToolSelectionConfig

enableConditionsobject

Enable conditions configuration

toolCountThresholdinteger

Tool count threshold

10
toolRerankingobject

Tool reranking configuration

modelServiceobject

Model service configuration

serviceIdstring

Service ID

svc-123456
modelNamestring

Model name

gte-rerank-v2
timeoutMillisecondinteger

Timeout in milliseconds

5000
filteringMethodstring

Filtering method: topK/topN/combined

topK
topKPercentinteger

TopK percentage (1-100)

50
topNCountinteger

TopN count

5
scoreThresholdfloat

Score threshold (0.0-1.0, 0 means disabled)

0.5
fallbackStrategystring

Fallback strategy: skip/error

skip
queryRewritingobject

Query rewriting configuration

enabledboolean

Enable query rewriting

true
modelServiceobject

Model service configuration

serviceIdstring

Service ID

svc-123456
modelNamestring

Model name

qwen-turbo
timeoutMillisecondinteger

Timeout in milliseconds

5000
promptConfigobject

Prompt configuration

typestring

Prompt type: builtIn/custom

builtIn
customPromptstring

Custom prompt (required when type=custom)

Custom prompt
maxOutputTokensinteger

Max output tokens

50
triggerConditionsobject

Trigger conditions

messageCountThresholdinteger

Message count threshold (≥0)

1
contextSelectionobject

Context selection

typestring

Context type

recentMessages
valueinteger

Value

5
fallbackStrategystring

Fallback strategy

skip
pluginStatusobject

Plugin status

errorLogsobject

errorLogs

string

string

timeout
serviceHealthyboolean

serviceHealthy

true
pluginIdstring

pluginId

pl-123456
aiStatisticsConfigobject

AiStatisticsConfig

logRequestContentboolean

Log request content

true
logResponseContentboolean

Log response content

true
semanticRouterConfigobject

SemanticRouterConfig

timeoutMillisecondinteger

Timeout in milliseconds

2000