All Products
Search
Document Center

API Gateway:HttpApiPolicyConfigs

Last Updated:Apr 08, 2026

Parameter

Type

Description

Example

object

body

type

string

Policy Type

K8S

enable

boolean

Policy Enable

false

semanticRouterConfig

object

SemanticRouterConfig

timeoutMillisecond

integer

Timeout in milliseconds

2000

aiFallbackConfig

object

AiFallbackConfig

serviceConfigs

array

List of fallback service configurations

object

object

serviceId

string

Fallback service ID

svc-d54fcbm******

name

string

Service name for frontend display

174174482Z****

targetModelName

string

Target model name for fallback

gpt-4o

passThroughModelName

boolean

Whether to pass through the original model name

true

onlyRedirectUpstreamCode

boolean

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

true

routeEmbedded

boolean

Whether the policy is generated from route embedded configuration

true

aiSecurityGuardConfig

object

AiSecurityGuardConfig

serviceAddress

string

Security guard service endpoint URL

https://api.example.com/v1

checkRequest

boolean

Enable request content checking

true

checkResponse

boolean

Enable response content checking

true

checkRequestImage

boolean

Enable request image checking

true

checkResponseImage

boolean

Enable response image checking

true

requestCheckService

string

Request text check service type

content-moderation-service

responseCheckService

string

Response text check service type

output-moderation-service

requestImageCheckService

string

Request image check service type

image-moderation-service

responseImageCheckService

string

Response image check service type

generated-image-scanner

riskAlertLevel

string

Global risk alert level

low

riskConfig

array

RiskConfig

object

object

type

string

Risk type

K8S

level

string

Risk level

max

consumerRules

object

consumerRules

pattern

string

pattern

/v1/chat/*

matchType

string

matchType

All

bufferLimit

integer

Buffer limit for content checking

1024

pluginStatus

object

pluginStatus

errorLogs

object

errorLogs

string

string

Failed to connect to server

serviceHealthy

boolean

serviceHealthy

true

pluginId

string

pluginId

pl-cvmuoiem1h******

consumerRequestCheckService

array

consumerRequestCheckService

object

object

name

string

Consumer name

oldUI-17590******

requestCheckService

string

requestCheckService

rate-limit-check

requestImageCheckService

string

requestImageCheckService

nsfw-image-detector

matchType

string

Match type

all

modalityType

string

Modality type

text

consumerResponseCheckService

array

consumerResponseCheckService

object

object

name

string

Consumer name

1744250******

responseCheckService

string

responseCheckService

pii-redaction

responseImageCheckService

string

responseImageCheckService

watermark-detector

matchType

string

Match type

all

modalityType

string

Modality type

text

consumerRiskLevel

array

consumerRiskLevel

object

object

name

string

Consumer name

1742090******

matchType

string

Match type

all

type

string

Risk type

K8S

level

string

Risk level

max

aiTokenRateLimitConfig

object

AiTokenRateLimitConfig

rules

array

List of rate limit rules

object

object

limitType

string

Limit type

fixed

matchKey

string

Match key

user_id

matchType

string

Match type

all

matchValue

string

Match value

12345

limitMode

string

Limit mode

local

limitValue

string

Limit value

100

enableGlobalRules

boolean

Enable global rate limit rules

true

globalRules

array

List of global rate limit rules

object

object

limitType

string

Limit type

fixed

matchKey

string

Match key

user_id

matchType

string

Match type

all

matchValue

string

Match value

12345

limitMode

string

Limit mode

local

limitValue

string

Limit value

100

redisConfig

object

Redis Config

host

string

Redis host

0.0.0.0

port

integer

Redis port

6379

username

string

Redis username

root

password

string

Redis password

******

timeout

integer

Redis timeout

60

databaseNumber

integer

Redis database number

1

pluginStatus

object

pluginStatus

errorLogs

object

Array of plugin execution error logs

string

string

auth-failed

serviceHealthy

boolean

Health status of the cache service

true

pluginId

string

Plugin instance unique identifier

pl-cvmuoiem1h******

aiCacheConfig

object

AiCacheConfig

cacheTTL

integer

Cache time-to-live in seconds

300

redisConfig

object

Redis configuration for cache storage

host

string

Redis host

0.0.0.0

port

integer

Redis port

6379

username

string

Redis username

root

password

string

Redis password

******

timeout

integer

Redis timeout

60

databaseNumber

integer

Redis database number

1

vectorConfig

object

vectorConfig

type

string

Vector database service type

K8S

serviceHost

string

Vector database service host address

localhost

apiKey

string

Vector database API key for authentication

sk-wRN******

timeout

integer

Vector database request timeout in milliseconds

60

collectionId

string

Vector database collection ID for storing vector embeddings

col_12345

threshold

number

Similarity threshold for semantic matching

100

embeddingConfig

object

Embedding Config

type

string

Embedding service provider type

K8S

serviceId

string

Embedding service ID

svc-d5tgnoum1******

timeout

integer

Embedding service request timeout in milliseconds

60

modelName

string

Embedding model name

custom_model

cacheKeyStrategy

string

Strategy for generating cache keys

input-hash

cacheMode

string

Cache mode type

read-write

pluginStatus

object

pluginStatus

errorLogs

object

errorLogs

string

string

timeout

serviceHealthy

boolean

serviceHealthy

true

pluginId

string

pluginId

pl-d1selpem1h******

aiNetworkSearchConfig

object

AiNetworkSearchConfig

needReference

boolean

Add reference sources in answer

true

referenceFormat

string

Reference format

APA

referenceLocation

string

Reference location

end

defaultLang

string

Default search language code

zh

defaultEnable

boolean

Default enable

true

searchFrom

array

Search engine list

object

object

type

string

Search engine type

K8S

apiKey

string

Search engine API key

asdfjoY87-******

count

integer

Result count

2

start

integer

Result offset

1740153600000

timeoutMillisecond

integer

API call timeout in milliseconds

5000

optionArgs

object

Additional parameters

string

string

temperature

endpoint

string

Search engine endpoint

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

contentMode

string

Content mode

text

industry

string

Industry

content

timeRange

string

Time range

last-7-days

searchEngineConfig

object

Search engine configuration

type

string

Search engine type: Bing/aliyunQuark

K8S

apiKey

string

Search engine API key

***

count

integer

Result count

2

start

integer

Result offset

1741829226090

timeoutMillisecond

integer

API call timeout in milliseconds

3000

optionArgs

object

Additional parameters

string

string

temperature

endpoint

string

Search engine endpoint

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

contentMode

string

Content mode

text

industry

string

Industry

content

timeRange

string

Time range

last-24h

searchRewrite

object

Search rewrite configuration

enable

boolean

Enable search rewrite

true

serviceId

string

Service ID

svc-cvj05lmm*******

modelName

string

Model name

aa

timeoutMillisecond

integer

Timeout in milliseconds

2000

maxCount

integer

Max rewrite count (1-5)

10

pluginStatus

object

pluginStatus

errorLogs

object

errorLogs

string

string

timeout

serviceHealthy

boolean

serviceHealthy

true

pluginId

string

pluginId

pl-cvmuoiem1******

aiToolSelectionConfig

object

AiToolSelectionConfig

enableConditions

object

Enable conditions configuration

toolCountThreshold

integer

Tool count threshold

3

toolReranking

object

Tool reranking configuration

modelService

object

Model service configuration

serviceId

string

Service ID

svc-cv21nj6m1hkk******

modelName

string

Model name

custom_model

timeoutMillisecond

integer

Timeout in milliseconds

3000

filteringMethod

string

Filtering method: topK/topN/combined

keyword

topKPercent

integer

TopK percentage (1-100)

0.1

topNCount

integer

TopN count

5

scoreThreshold

number

Score threshold (0.0-1.0, 0 means disabled)

0.5

fallbackStrategy

string

Fallback strategy: skip/error

none

queryRewriting

object

Query rewriting configuration

enabled

boolean

Enable query rewriting

true

modelService

object

Model service configuration

serviceId

string

Service ID

svc-d51m42um1******

modelName

string

Model name

custom_image_embedding

timeoutMillisecond

integer

Timeout in milliseconds

2000

promptConfig

object

Prompt configuration

type

string

Prompt type: builtIn/custom

K8S

customPrompt

string

Custom prompt (required when type=custom)

略带搞笑的语气,编写一段推广语,提高阅读兴趣。

maxOutputTokens

integer

Max output tokens

256

triggerConditions

object

Trigger conditions

messageCountThreshold

integer

Message count threshold (≥0)

5

contextSelection

object

Context selection

type

string

Context type

K8S

value

integer

Value

1

fallbackStrategy

string

Fallback strategy

none

pluginStatus

object

Plugin status

errorLogs

object

errorLogs

string

string

timeout

serviceHealthy

boolean

serviceHealthy

true

pluginId

string

pluginId

pl-d4ijmu6m1hk******

aiStatisticsConfig

object

AiStatisticsConfig

logRequestContent

boolean

Log request content

true

logResponseContent

boolean

Log response content

true