All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::APIG::HttpApi

Last Updated:Jul 24, 2026

The ALIYUN::APIG::HttpApi type is used to create an HTTP API.

Syntax

{
  "Type": "ALIYUN::APIG::HttpApi",
  "Properties": {
    "AuthConfig": Map,
    "AgentProtocols": List,
    "ResourceGroupId": String,
    "Strategy": String,
    "EnableAuth": Boolean,
    "BelongGatewayId": String,
    "IngressConfig": Map,
    "ModelCategory": String,
    "VersionConfig": Map,
    "OnlyChangeConfig": Boolean,
    "RemoveBasePathOnForward": Boolean,
    "FirstByteTimeout": Integer,
    "DeployConfigs": List,
    "BuiltinRouteNames": List,
    "AiProtocols": List,
    "HttpApiName": String,
    "Protocols": List,
    "BasePath": String,
    "Description": String,
    "Type": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraints

HttpApiName

String

Yes

No

The API name.

None.

AgentProtocols

List

No

Yes

The list of protocols supported by the agent.

None.

AiProtocols

List

No

Yes

The list of AI protocols.

None.

AuthConfig

Map

No

Yes

The authentication configuration.

For more information, see AuthConfig properties.

BasePath

String

No

Yes

The base path of the API.

Must start with /.

BelongGatewayId

String

No

No

The ID of the gateway to which the API belongs.

None.

BuiltinRouteNames

List

No

No

The list of built-in route names.

None.

DeployConfigs

List

No

Yes

The list of API deployment configurations.

For more information, see DeployConfigs properties.

Description

String

No

Yes

The API description.

None.

EnableAuth

Boolean

No

Yes

Whether to enable authentication.

None.

FirstByteTimeout

Integer

No

Yes

The timeout for the first byte.

None.

IngressConfig

Map

No

Yes

The configuration information for the HTTP Ingress API.

For more information, see IngressConfig properties.

ModelCategory

String

No

No

The model category.

None.

OnlyChangeConfig

Boolean

No

Yes

Whether to only modify the configuration.

None.

Protocols

List

No

Yes

The list of protocols for API access.

Valid values:

  • HTTP

  • HTTPS

RemoveBasePathOnForward

Boolean

No

Yes

Whether to remove the base path when forwarding.

None.

ResourceGroupId

String

No

No

The ID of the resource group.

None.

Strategy

String

No

No

The conflict merge strategy for import.

None.

Type

String

No

No

The type of the HTTP API.

Valid values:

  • Http

  • Rest

  • WebSocket

  • HttpIngress

VersionConfig

Map

No

Yes

The versioning configuration for the API.

For more information, see VersionConfig properties.

AuthConfig syntax

"AuthConfig":{
  "AuthType": String,
  "AuthMode": String
}

AuthConfig properties

Property

Type

Required

Editable

Description

Constraints

AuthMode

String

No

Yes

The authentication mode.

None.

AuthType

String

No

Yes

The authentication type.

None.

VersionConfig syntax

"VersionConfig":{
  "Enable": Boolean,
  "QueryName": String,
  "HeaderName": String,
  "Scheme": String,
  "Version": String
}

VersionConfig properties

Property

Type

Required

Editable

Description

Constraints

Enable

Boolean

No

Yes

Whether to enable versioning.

None.

HeaderName

String

No

Yes

The key in the Header parameter when using the Header versioning scheme.

None.

QueryName

String

No

Yes

The key in the Query parameter when using the Query versioning scheme.

None.

Scheme

String

No

Yes

The versioning scheme.

Valid values:

  • Path

  • Query

  • Header

Version

String

No

Yes

The version number.

None.

IngressConfig syntax

"IngressConfig":{
  "EnvironmentId": String,
  "WatchNamespace": String,
  "OverrideIngressIp": Boolean,
  "ClusterId": String,
  "IngressClass": String,
  "SourceId": String
}

IngressConfig properties

Property

Type

Required

Editable

Description

Constraints

ClusterId

String

No

Yes

The ID of the cluster.

None.

EnvironmentId

String

No

Yes

The ID of the environment.

None.

IngressClass

String

No

Yes

The Ingress Class to listen to.

None.

OverrideIngressIp

Boolean

No

Yes

Whether to update the address in the Ingress Status.

None.

SourceId

String

No

Yes

The ID of the source.

None.

WatchNamespace

String

No

Yes

The namespace to watch.

None.

DeployConfigs syntax

"DeployConfigs":
[{
  "AutoDeploy": Boolean,
  "Mock": Map,
  "GatewayType": String,
  "GatewayInfo": Map,
  "ServiceConfigs": List,
  "BackendScene": String,
  "CustomDomainIds": List,
  "SubDomains": List,
  "PolicyConfigs": List,
  "EnvironmentId": String,
  "CustomDomainInfos": List,
  "RouteBackend": Map,
  "GatewayId": String
}]

DeployConfigs properties

Property

Type

Required

Editable

Description

Constraints

AutoDeploy

Boolean

No

Yes

Whether to automatically deploy.

None.

BackendScene

String

No

Yes

The deployment scenario.

None.

CustomDomainIds

List

No

Yes

The list of custom domain IDs.

None.

CustomDomainInfos

List

No

Yes

The list of custom domain details.

For more information, see CustomDomainInfos properties.

EnvironmentId

String

No

Yes

The ID of the environment.

None.

GatewayId

String

No

Yes

The ID of the gateway instance.

None.

GatewayInfo

Map

No

Yes

The gateway information.

For more information, see GatewayInfo properties.

GatewayType

String

No

Yes

The type of the gateway.

None.

Mock

Map

No

Yes

The Mock configuration.

None.

PolicyConfigs

List

No

Yes

The list of policy configurations.

For more information, see PolicyConfigs properties.

RouteBackend

Map

No

Yes

The backend service information.

None.

ServiceConfigs

List

No

Yes

The list of service configurations.

For more information, see ServiceConfigs properties.

SubDomains

List

No

Yes

The list of subdomain details.

For more information, see SubDomains properties.

GatewayInfo syntax

"GatewayInfo":{
  "EngineVersion": String,
  "Name": String,
  "VpcInfo": Map,
  "GatewayId": String
}

GatewayInfo properties

Property

Type

Required

Editable

Description

Constraints

EngineVersion

String

No

Yes

The engine version of the gateway.

None.

GatewayId

String

No

Yes

The ID of the gateway.

None.

Name

String

No

Yes

The name of the gateway.

None.

VpcInfo

Map

No

Yes

The VPC information.

For more information, see VpcInfo properties.

VpcInfo syntax

"VpcInfo":{
  "VpcId": String,
  "Name": String
}

VpcInfo properties

Property

Type

Required

Editable

Description

Constraints

Name

String

No

Yes

The name of the VPC.

None.

VpcId

String

No

Yes

The ID of the VPC.

None.

SubDomains syntax

"SubDomains":[{
  "DomainId": String,
  "Protocol": String,
  "Name": String,
  "NetworkType": String
}]

SubDomains properties

Property

Type

Required

Editable

Description

Constraints

DomainId

String

No

Yes

The ID of the domain.

None.

Name

String

No

Yes

The domain name.

None.

NetworkType

String

No

Yes

The network type.

None.

Protocol

String

No

Yes

The protocol.

None.

ServiceConfigs syntax

"ServiceConfigs":[{
  "ServiceId": String,
  "PassThroughModelName": Boolean,
  "Name": String,
  "TargetModelName": String
}]

ServiceConfigs properties

Property

Type

Required

Editable

Description

Constraints

Name

String

No

Yes

The name of the service.

None.

PassThroughModelName

Boolean

No

Yes

Whether to pass through the model name.

None.

ServiceId

String

No

Yes

The ID of the service.

None.

TargetModelName

String

No

Yes

The target model name.

None.

CustomDomainInfos syntax

"CustomDomainInfos":[{
  "DomainId": String,
  "Protocol": String,
  "Name": String
}]

CustomDomainInfos properties

Property

Type

Required

Editable

Description

Constraints

DomainId

String

No

Yes

The ID of the domain.

None.

Name

String

No

Yes

The domain name.

None.

Protocol

String

No

Yes

The protocol.

None.

PolicyConfigs syntax

"PolicyConfigs":[{
    "Enable": Boolean,
    "SemanticRouterConfig": Map,
    "AiToolSelectionConfig": Map,
    "AiSecurityGuardConfig": Map,
    "Type": String,
    "AiStatisticsConfig": Map,
    "AiFallbackConfig": Map,
    "AiNetworkSearchConfig": Map,
    "AiTokenRateLimitConfig": Map,
    "AiCacheConfig": Map
}]

PolicyConfigs properties

Property

Type

Required

Editable

Description

Constraints

AiCacheConfig

Map

No

Yes

The AI cache configuration.

For more information, see AiCacheConfig properties.

AiFallbackConfig

Map

No

Yes

The AI fallback configuration.

For more information, see AiFallbackConfig properties.

AiNetworkSearchConfig

Map

No

Yes

The AI network search configuration.

For more information, see AiNetworkSearchConfig properties.

AiSecurityGuardConfig

Map

No

Yes

The AI security guard configuration.

For more information, see AiSecurityGuardConfig properties.

AiStatisticsConfig

Map

No

Yes

The AI statistics configuration.

For more information, see AiStatisticsConfig properties.

AiTokenRateLimitConfig

Map

No

Yes

The AI token rate limit configuration.

For more information, see AiTokenRateLimitConfig properties.

AiToolSelectionConfig

Map

No

Yes

The AI tool selection configuration.

For more information, see AiToolSelectionConfig properties.

Enable

Boolean

No

Yes

Whether to enable.

None.

SemanticRouterConfig

Map

No

Yes

The semantic router configuration.

For more information, see SemanticRouterConfig properties.

Type

String

No

Yes

The type of the policy template.

None.

AiStatisticsConfig syntax

"AiStatisticsConfig":{
  "LogResponseContent": Boolean,
  "PathFieldConfigs": List,
  "LogRequestContent": Boolean
}

AiStatisticsConfig properties

Property

Type

Required

Editable

Description

Constraints

LogRequestContent

Boolean

No

Yes

Whether to log request content.

None.

LogResponseContent

Boolean

No

Yes

Whether to log response content.

None.

PathFieldConfigs

List

No

Yes

The list of custom field collection configurations, configured by API path.

For more information, see PathFieldConfigs properties.

PathFieldConfigs syntax

"PathFieldConfigs":{
  "Path": String,
  "FieldPaths": List
}

PathFieldConfigs properties

Property

Type

Required

Editable

Description

Constraints

FieldPaths

List

No

Yes

The field collection configuration.

None.

Path

String

No

Yes

The API path.

None.

AiNetworkSearchConfig syntax

"AiNetworkSearchConfig":{
  "SearchFrom": Map,
  "NeedReference": Boolean,
  "SearchRewrite": Map,
  "PluginStatus": Map,
  "DefaultLang": String,
  "DefaultEnable": Boolean,
  "SearchEngineConfig": Map,
  "ReferenceFormat": String,
  "ReferenceLocation": String
}

AiNetworkSearchConfig properties

Property

Type

Required

Editable

Description

Constraints

DefaultEnable

Boolean

No

Yes

Whether to enable by default.

None.

DefaultLang

String

No

Yes

The default language.

None.

NeedReference

Boolean

No

Yes

Whether references are needed.

None.

ReferenceFormat

String

No

Yes

The reference format.

None.

ReferenceLocation

String

No

Yes

The reference location.

None.

SearchEngineConfig

Map

No

Yes

The search engine configuration.

For more information, see SearchEngineConfig properties.

SearchFrom

Map

No

Yes

The search source.

For more information, see SearchFrom properties.

SearchRewrite

Map

No

Yes

The search rewrite configuration.

For more information, see SearchRewrite properties.

PluginStatus

Map

No

Yes

The plugin status.

For more information, see PluginStatus properties.

SearchFrom syntax

"SearchFrom":{
  "ApiKey": String,
  "ContentMode": String,
  "Count": Integer,
  "Endpoint": String,
  "Industry": String,
  "OptionArgs": String,
  "Start": Integer,
  "TimeoutMillisecond": Integer,
  "TimeRange": Map,
  "Type": String
}

SearchFrom properties

Property

Type

Required

Editable

Description

Constraints

ApiKey

String

No

Yes

The API key.

None.

ContentMode

String

No

Yes

The content mode.

None.

Count

Integer

No

Yes

The count.

None.

Endpoint

String

No

Yes

The endpoint.

None.

Industry

String

No

Yes

The industry type of the instance.

None.

OptionArgs

String

No

Yes

The optional parameters.

None.

Start

Integer

No

Yes

The start time.

None.

TimeoutMillisecond

Integer

No

Yes

The timeout period.

None.

TimeRange

Map

No

Yes

The time range.

None.

Type

String

No

Yes

The type.

None.

PluginStatus syntax

"PluginStatus":{
  "ErrorLogs": String,
  "PluginId": String,
  "ServiceHealthy": String
}

PluginStatus properties

Property

Type

Required

Editable

Description

Constraints

ErrorLogs

String

No

Yes

The error logs.

None.

PluginId

String

No

Yes

The plugin ID.

None.

ServiceHealthy

String

No

Yes

The service health status.

None.

SearchEngineConfig syntax

"SearchEngineConfig":{
  "ApiKey": String,
  "ContentMode": String,
  "Count": Integer,
  "Endpoint": String,
  "Industry": String,
  "OptionArgs": String,
  "Start": Integer,
  "TimeoutMillisecond": Integer,
  "TimeRange": Map,
  "Type": String
}

SearchEngineConfig properties

Property

Type

Required

Editable

Description

Constraints

ApiKey

String

No

Yes

The API key.

None.

ContentMode

String

No

Yes

The content mode.

None.

Count

Integer

No

Yes

The count.

None.

Endpoint

String

No

Yes

The endpoint.

None.

Industry

String

No

Yes

The industry type of the instance.

None.

OptionArgs

String

No

Yes

The optional parameters.

None.

Start

Integer

No

Yes

The start time.

None.

TimeoutMillisecond

Integer

No

Yes

The timeout period.

None.

TimeRange

Map

No

Yes

The time range.

None.

Type

String

No

Yes

The plugin type.

None.

SearchRewrite syntax

"SearchRewrite":{
  "Enable": Boolean,
  "MaxCount": Integer,
  "ModelName": String,
  "ServiceId": String,
  "TimeoutMillisecond": Integer
}

SearchRewrite properties

Property

Type

Required

Editable

Description

Constraints

Enable

Boolean

No

Yes

Whether to enable.

None.

MaxCount

Integer

No

Yes

The maximum count.

None.

ModelName

String

No

Yes

The model name.

None.

ServiceId

String

No

Yes

The ID of the service.

None.

TimeoutMillisecond

Integer

No

Yes

The timeout period.

None.

AiFallbackConfig syntax

"AiFallbackConfig":{
  "OnlyRedirectUpstreamCode": Boolean,
  "ServiceConfigs": List,
  "RouteEmbedded": Boolean
}

AiFallbackConfig properties

Property

Type

Required

Editable

Description

Constraints

OnlyRedirectUpstreamCode

Boolean

No

Yes

Whether to only redirect upstream codes.

None.

RouteEmbedded

Boolean

No

Yes

Whether to embed the route.

None.

ServiceConfigs

List

No

Yes

The list of service configurations.

For more information, see ServiceConfigs properties.

AiTokenRateLimitConfig syntax

"AiTokenRateLimitConfig":{
  "GlobalRules": List,
  "RedisConfig": Map,
  "PluginStatus": Map,
  "EnableGlobalRules": Boolean,
  "Rules": List
}

AiTokenRateLimitConfig properties

Property

Type

Required

Editable

Description

Constraints

EnableGlobalRules

Boolean

No

Yes

Whether to enable global rules.

None.

GlobalRules

List

No

Yes

The global rules.

For more information, see GlobalRules properties.

PluginStatus

Map

No

Yes

The plugin status.

For more information, see PluginStatus properties.

RedisConfig

Map

No

Yes

The Redis configuration.

For more information, see RedisConfig properties.

Rules

List

No

Yes

The list of rules.

For more information, see Rules properties.

Rules syntax

"Rules":[{
  "LimitMode": String,
  "LimitType": String,
  "LimitValue": String,
  "MatchKey": String,
  "MatchType": String,
  "MatchValue": String
}]

Rules properties

Property

Type

Required

Editable

Description

Constraints

LimitMode

String

No

Yes

The rate limit mode.

None.

LimitType

String

No

Yes

The rate limit type.

None.

LimitValue

String

No

Yes

The rate limit value.

None.

MatchKey

String

No

Yes

The match key.

None.

MatchType

String

No

Yes

The match type.

None.

MatchValue

String

No

Yes

The match value.

None.

GlobalRules syntax

"GlobalRules":[{
  "LimitMode": String,
  "LimitType": String,
  "LimitValue": String,
  "MatchKey": String,
  "MatchType": String,
  "MatchValue": String
}]

GlobalRules properties

Property

Type

Required

Editable

Description

Constraints

LimitMode

String

No

Yes

The rate limit mode.

None.

LimitType

String

No

Yes

The rate limit type.

None.

LimitValue

String

No

Yes

The rate limit value.

None.

MatchKey

String

No

Yes

The match key.

None.

MatchType

String

No

Yes

The match type.

None.

MatchValue

String

No

Yes

The match value.

None.

RedisConfig syntax

"RedisConfig":{
  "Host": String,
  "Username": String,
  "Port": Integer,
  "Timeout": Integer,
  "DatabaseNumber": Integer,
  "Password": String
}

RedisConfig properties

Property

Type

Required

Editable

Description

Constraints

DatabaseNumber

Integer

No

Yes

The number of database connections.

None.

Host

String

No

Yes

The IP address of the node.

None.

Password

String

No

Yes

The password.

None.

Port

Integer

No

Yes

The port number.

None.

Timeout

Integer

No

Yes

The timeout for health check responses.

Unit: seconds.

Username

String

No

Yes

The username.

None.

AiCacheConfig syntax

"AiCacheConfig":{
  "CacheTTL": Integer,
  "CacheKeyStrategy": String,
  "VectorConfig": Map,
  "PluginStatus": Map,
  "RedisConfig": Map,
  "EmbeddingConfig": Map,
  "CacheMode": String
}

AiCacheConfig properties

Property

Type

Required

Editable

Description

Constraints

CacheKeyStrategy

String

No

Yes

The cache key strategy.

None.

CacheMode

String

No

Yes

The cache mode.

None.

CacheTTL

Integer

No

Yes

The time to live (TTL) for cache.

None.

EmbeddingConfig

Map

No

Yes

The embedding configuration.

For more information, see EmbeddingConfig properties.

PluginStatus

Map

No

Yes

The plugin status.

For more information, see PluginStatus properties.

RedisConfig

Map

No

Yes

The Redis configuration.

For more information, see RedisConfig properties.

VectorConfig

Map

No

Yes

The vector configuration.

For more information, see VectorConfig properties.

EmbeddingConfig syntax

"EmbeddingConfig":{
  "ModelName": String,
  "ServiceId": String,
  "Type": String,
  "Timeout": Integer
}

EmbeddingConfig properties

Property

Type

Required

Editable

Description

Constraints

ModelName

String

No

Yes

The model name.

None.

ServiceId

String

No

Yes

The ID of the service.

None.

Timeout

Integer

No

Yes

The timeout for health check responses.

Unit: seconds.

Type

String

No

Yes

The type.

None.

VectorConfig syntax

"VectorConfig":{
  "ApiKey": String,
  "Timeout": Integer,
  "ServiceHost": String,
  "Type": String,
  "Threshold": Number,
  "CollectionId": String
}

VectorConfig properties

Property

Type

Required

Editable

Description

Constraints

ApiKey

String

No

Yes

The API key.

None.

CollectionId

String

No

Yes

The ID of the collection.

None.

ServiceHost

String

No

Yes

The service host address.

None.

Threshold

Number

No

Yes

The threshold.

None.

Timeout

Integer

No

Yes

The timeout for health check responses.

Unit: seconds.

Type

Integer

No

Yes

The type.

None.

AiSecurityGuardConfig syntax

"AiSecurityGuardConfig":{
  "RiskConfig": List,
  "ConsumerRequestCheckService": List,
  "RequestImageCheckService": String,
  "CheckResponseImage": Boolean,
  "RiskAlertLevel": String,
  "CheckResponse": Boolean,
  "BufferLimit": Integer,
  "PluginStatus": Map,
  "RequestCheckService": String,
  "CheckRequest": Boolean,
  "ConsumerRiskLevel": List,
  "ResponseCheckService": String,
  "ConsumerResponseCheckService": List,
  "ResponseImageCheckService": String,
  "CheckRequestImage": Boolean,
  "ServiceAddress": String
}

AiSecurityGuardConfig properties

Property

Type

Required

Editable

Description

Constraints

BufferLimit

Integer

No

Yes

The buffer size limit.

None.

CheckRequest

Boolean

No

Yes

Whether to check requests.

None.

CheckRequestImage

Boolean

No

Yes

Whether to check images in requests.

None.

CheckResponse

Boolean

No

Yes

Whether to check responses.

None.

CheckResponseImage

Boolean

No

Yes

Whether to check images in responses.

None.

ConsumerRequestCheckService

List

No

Yes

The consumer request check service.

For more information, see ConsumerRequestCheckService properties.

ConsumerResponseCheckService

List

No

Yes

The consumer response check service.

For more information, see ConsumerResponseCheckService properties.

ConsumerRiskLevel

List

No

Yes

The consumer risk level.

For more information, see ConsumerRiskLevel properties.

PluginStatus

Map

No

Yes

The current plugin status.

For more information, see PluginStatus properties.

RequestCheckService

String

No

Yes

The request check service.

None.

RequestImageCheckService

String

No

Yes

The request image check service.

None.

ResponseCheckService

String

No

Yes

The response check service.

None.

ResponseImageCheckService

String

No

Yes

The response image check service.

None.

RiskAlertLevel

String

No

Yes

The risk alert level.

None.

RiskConfig

List

No

Yes

The risk configuration.

For more information, see RiskConfig properties.

ServiceAddress

String

No

Yes

The service address.

None.

ConsumerRiskLevel syntax

"ConsumerRiskLevel":[{
  "Level": String,
  "MatchType": String,
  "Name": String,
  "Type": String
}]

ConsumerRiskLevel properties

Property

Type

Required

Editable

Description

Constraints

Level

String

No

Yes

The risk level.

None.

MatchType

String

No

Yes

The match type.

None.

Name

String

No

Yes

The parameter name.

None.

Type

String

No

Yes

The type.

None.

RiskConfig syntax

"RiskConfig":[{
  "ConsumerRules": Map,
  "Level": String,
  "Type": String
}]

RiskConfig properties

Property

Type

Required

Editable

Description

Constraints

ConsumerRules

Map

No

Yes

The consumer rules.

For more information, see ConsumerRules properties.

Level

String

No

Yes

The risk level.

None.

Type

String

No

Yes

The plugin type.

None.

ConsumerRules syntax

"ConsumerRules":{
  "MatchType": String,
  "Pattern": String
}

ConsumerRules properties

Property

Type

Required

Editable

Description

Constraints

MatchType

String

No

Yes

The match type.

None.

Pattern

String

No

Yes

The match pattern.

None.

ConsumerRequestCheckService syntax

"ConsumerRequestCheckService":[{
  "MatchType": String,
  "ModalityType": String,
  "Name": String,
  "RequestCheckService": String,
  "RequestImageCheckService": String
}]

ConsumerRequestCheckService properties

Property

Type

Required

Editable

Description

Constraints

MatchType

String

No

Yes

The match type.

None.

ModalityType

String

No

Yes

The modality type.

None.

Name

String

No

Yes

The service name.

None.

RequestCheckService

String

No

Yes

The request check service.

None.

RequestImageCheckService

String

No

Yes

The request image check service.

None.

ConsumerResponseCheckService syntax

"ConsumerResponseCheckService":[{
  "MatchType": String,
  "ModalityType": String,
  "Name": String,
  "ResponseCheckService": String,
  "ResponseImageCheckService": String
}]

ConsumerResponseCheckService properties

Property

Type

Required

Editable

Description

Constraints

MatchType

String

No

Yes

The match type.

None.

ModalityType

String

No

Yes

The modality type.

None.

Name

String

No

Yes

The service name.

None.

ResponseCheckService

String

No

Yes

The response check service.

None.

ResponseImageCheckService

String

No

Yes

The response image check service.

None.

SemanticRouterConfig syntax

"SemanticRouterConfig":{
  "TimeoutMillisecond": Integer
}

SemanticRouterConfig properties

Property

Type

Required

Editable

Description

Constraints

TimeoutMillisecond

Integer

No

Yes

The timeout period.

None.

AiToolSelectionConfig syntax

"AiToolSelectionConfig":{
  "EnableConditions": Map,
  "QueryRewriting": Map,
  "ToolReranking": Map,
  "PluginStatus": Map
}

AiToolSelectionConfig properties

Property

Type

Required

Editable

Description

Constraints

EnableConditions

Map

No

Yes

The conditions for enabling.

For more information, see EnableConditions properties.

PluginStatus

Map

No

Yes

The plugin status.

For more information, see PluginStatus properties.

QueryRewriting

Map

No

Yes

The query rewriting configuration.

For more information, see QueryRewriting properties.

ToolReranking

Map

No

Yes

The tool reranking configuration.

For more information, see ToolReranking properties.

QueryRewriting syntax

"QueryRewriting":{
  "FallbackStrategy": String,
  "TriggerConditions": Map,
  "ContextSelection": Map,
  "MaxOutputTokens": Integer,
  "ModelService": Map,
  "Enabled": Boolean,
  "PromptConfig": Map
}

QueryRewriting properties

Property

Type

Required

Editable

Description

Constraints

ContextSelection

Map

No

Yes

The context selection configuration.

For more information, see ContextSelection properties.

Enabled

Boolean

No

Yes

Whether to enable.

None.

FallbackStrategy

String

No

Yes

The fallback strategy.

None.

MaxOutputTokens

Integer

No

Yes

The maximum number of output tokens.

None.

ModelService

Map

No

Yes

The model service.

For more information, see ModelService properties.

PromptConfig

Map

No

Yes

The prompt configuration.

For more information, see PromptConfig properties.

TriggerConditions

Map

No

Yes

The trigger conditions.

For more information, see TriggerConditions properties.

PromptConfig syntax

"PromptConfig":{
  "CustomPrompt": String,
  "Type": String
}

PromptConfig properties

Property

Type

Required

Editable

Description

Constraints

CustomPrompt

String

No

Yes

The extraction instruction.

None.

Type

String

No

Yes

The plugin type.

None.

TriggerConditions syntax

"TriggerConditions":{
  "MessageCountThreshold": String
}

TriggerConditions properties

Property

Type

Required

Editable

Description

Constraints

MessageCountThreshold

String

No

Yes

The message count threshold.

None.

ContextSelection syntax

"ContextSelection":{
  "Type": String,
  "Value": String
}

ContextSelection properties

Property

Type

Required

Editable

Description

Constraints

Type

String

No

Yes

The plugin type.

None.

Value

String

No

Yes

The match value.

None.

ModelService syntax

"ModelService":{
  "ModelName": String,
  "ServiceId": String,
  "TimeoutMillisecond": Integer
}

ModelService properties

Property

Type

Required

Editable

Description

Constraints

ModelName

String

No

Yes

The model name.

None.

ServiceId

String

No

Yes

The ID of the service.

None.

TimeoutMillisecond

Integer

No

Yes

The timeout period.

None.

ToolReranking syntax

"ToolReranking":{
  "FallbackStrategy": String,
  "FilteringMethod": String,
  "ScoreThreshold": Number,
  "TopNCount": Integer,
  "ModelService": Map,
  "TopKPercent": Number
}

ToolReranking properties

Property

Type

Required

Editable

Description

Constraints

FallbackStrategy

String

No

Yes

The fallback strategy.

None.

FilteringMethod

String

No

Yes

The filtering method.

None.

ModelService

Map

No

Yes

The model service.

For more information, see ModelService properties.

ScoreThreshold

Number

No

Yes

The score threshold.

None.

TopKPercent

Number

No

Yes

The top K percentage.

None.

TopNCount

Integer

No

Yes

The top N count.

None.

EnableConditions syntax

"EnableConditions":{
  "ToolCountThreshold": Integer
}

EnableConditions properties

Property

Type

Required

Editable

Description

Constraints

ToolCountThreshold

Integer

No

Yes

The tool count threshold.

None.

Return values

Fn::GetAtt

  • HttpApiId: The ID of the HTTP API.

Examples

Scenario 1: Create an HTTP API.

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: 创建一个HTTP协议的API,适用于内部服务调用或开发测试。
  en: Create an HTTP API for internal service calls or dev/test environments.
Parameters:
  HttpApiName:
    Type: String
    Label:
      zh-cn: API名称
      en: API Name
    Description:
      zh-cn: HTTP API的名称,长度为1~64个字符。
      en: The name of the HTTP API, 1 to 64 characters.
    MinLength: 1
    MaxLength: 64
    AssociationProperty: AutoCompleteInput
    AssociationPropertyMetadata:
      Length: 5
      Prefix: my-api-
      CharacterClasses:
        - Class: lowercase
          min: 1
    Default: my-api
Resources:
  HttpApi:
    Type: ALIYUN::APIG::HttpApi
    Properties:
      HttpApiName:
        Ref: HttpApiName
      Type: Http
      Protocols:
        - HTTP
      BasePath: /
Outputs:
  HttpApiId:
    Label:
      zh-cn: API ID
      en: API ID
    Value:
      Fn::GetAtt:
        - HttpApi
        - HttpApiId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "创建一个HTTP协议的API,适用于内部服务调用或开发测试。",
    "en": "Create an HTTP API for internal service calls or dev/test environments."
  },
  "Parameters": {
    "HttpApiName": {
      "Type": "String",
      "Label": {
        "zh-cn": "API名称",
        "en": "API Name"
      },
      "Description": {
        "zh-cn": "HTTP API的名称,长度为1~64个字符。",
        "en": "The name of the HTTP API, 1 to 64 characters."
      },
      "MinLength": 1,
      "MaxLength": 64,
      "AssociationProperty": "AutoCompleteInput",
      "AssociationPropertyMetadata": {
        "Length": 5,
        "Prefix": "my-api-",
        "CharacterClasses": [
          {
            "Class": "lowercase",
            "min": 1
          }
        ]
      },
      "Default": "my-api"
    }
  },
  "Resources": {
    "HttpApi": {
      "Type": "ALIYUN::APIG::HttpApi",
      "Properties": {
        "HttpApiName": {
          "Ref": "HttpApiName"
        },
        "Type": "Http",
        "Protocols": [
          "HTTP"
        ],
        "BasePath": "/"
      }
    }
  },
  "Outputs": {
    "HttpApiId": {
      "Label": {
        "zh-cn": "API ID",
        "en": "API ID"
      },
      "Value": {
        "Fn::GetAtt": [
          "HttpApi",
          "HttpApiId"
        ]
      }
    }
  }
}

Scenario 2: Create a RESTful API with both HTTP and HTTPS protocols, and configure a versioned base path.

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: 创建REST类型API,支持HTTP和HTTPS双协议,配置版本化基础路径。
  en: Create a RESTful API with both HTTP and HTTPS, with a versioned base path.
Parameters:
  HttpApiName:
    Type: String
    Label:
      zh-cn: API名称
      en: API Name
    Description:
      zh-cn: RESTful API的名称,长度为1~64个字符。
      en: The name of the RESTful API, 1 to 64 characters.
    MinLength: 1
    MaxLength: 64
    AssociationProperty: AutoCompleteInput
    AssociationPropertyMetadata:
      Length: 5
      Prefix: rest-api-
      CharacterClasses:
        - Class: lowercase
          min: 1
    Default: rest-api
  BasePath:
    Type: String
    Label:
      zh-cn: API基础路径
      en: API Base Path
    Description:
      zh-cn: >-
        API的基础路径,需以/开头。建议使用版本号作为路径前缀,
        如/v1、/v2,便于API版本管理。
      en: >-
        The base path of the API, must start with /.
        Using a version prefix like /v1, /v2 is recommended.
    Default: /v1
    AllowedValues:
      - /v1
      - /v2
      - /api/v1
      - /api/v2
  Description:
    Type: String
    Label:
      zh-cn: API描述
      en: API Description
    Description:
      zh-cn: API的功能描述信息。
      en: Functional description of the API.
    Default: 生产环境RESTful API服务
    MaxLength: 256
Resources:
  RestApi:
    Type: ALIYUN::APIG::HttpApi
    Properties:
      HttpApiName:
        Ref: HttpApiName
      Type: Rest
      Protocols:
        - HTTP
        - HTTPS
      BasePath:
        Ref: BasePath
      Description:
        Ref: Description
Outputs:
  HttpApiId:
    Label:
      zh-cn: API ID
      en: API ID
    Value:
      Fn::GetAtt:
        - RestApi
        - HttpApiId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "创建REST类型API,支持HTTP和HTTPS双协议,配置版本化基础路径。",
    "en": "Create a RESTful API with both HTTP and HTTPS, with a versioned base path."
  },
  "Parameters": {
    "HttpApiName": {
      "Type": "String",
      "Label": {
        "zh-cn": "API名称",
        "en": "API Name"
      },
      "Description": {
        "zh-cn": "RESTful API的名称,长度为1~64个字符。",
        "en": "The name of the RESTful API, 1 to 64 characters."
      },
      "MinLength": 1,
      "MaxLength": 64,
      "AssociationProperty": "AutoCompleteInput",
      "AssociationPropertyMetadata": {
        "Length": 5,
        "Prefix": "rest-api-",
        "CharacterClasses": [
          {
            "Class": "lowercase",
            "min": 1
          }
        ]
      },
      "Default": "rest-api"
    },
    "BasePath": {
      "Type": "String",
      "Label": {
        "zh-cn": "API基础路径",
        "en": "API Base Path"
      },
      "Description": {
        "zh-cn": "API的基础路径,需以/开头。建议使用版本号作为路径前缀,如/v1、/v2,便于API版本管理。",
        "en": "The base path of the API, must start with /. Using a version prefix like /v1, /v2 is recommended."
      },
      "Default": "/v1",
      "AllowedValues": [
        "/v1",
        "/v2",
        "/api/v1",
        "/api/v2"
      ]
    },
    "Description": {
      "Type": "String",
      "Label": {
        "zh-cn": "API描述",
        "en": "API Description"
      },
      "Description": {
        "zh-cn": "API的功能描述信息。",
        "en": "Functional description of the API."
      },
      "Default": "生产环境RESTful API服务",
      "MaxLength": 256
    }
  },
  "Resources": {
    "RestApi": {
      "Type": "ALIYUN::APIG::HttpApi",
      "Properties": {
        "HttpApiName": {
          "Ref": "HttpApiName"
        },
        "Type": "Rest",
        "Protocols": [
          "HTTP",
          "HTTPS"
        ],
        "BasePath": {
          "Ref": "BasePath"
        },
        "Description": {
          "Ref": "Description"
        }
      }
    }
  },
  "Outputs": {
    "HttpApiId": {
      "Label": {
        "zh-cn": "API ID",
        "en": "API ID"
      },
      "Value": {
        "Fn::GetAtt": [
          "RestApi",
          "HttpApiId"
        ]
      }
    }
  }
}

Scenario 3: Create a WebSocket API with an HTTPS domain for secure real-time communication.

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: 创建WebSocket API并配置HTTPS安全域名,实现安全的实时通信服务。
  en: Create a WebSocket API with an HTTPS domain for secure real-time communication.
Parameters:
  HttpApiName:
    Type: String
    Label:
      zh-cn: API名称
      en: API Name
    Description:
      zh-cn: WebSocket API的名称,长度为1~64个字符。
      en: The name of the WebSocket API, 1 to 64 characters.
    MinLength: 1
    MaxLength: 64
    AssociationProperty: AutoCompleteInput
    AssociationPropertyMetadata:
      Length: 5
      Prefix: ws-api-
      CharacterClasses:
        - Class: lowercase
          min: 1
    Default: ws-api
  BasePath:
    Type: String
    Label:
      zh-cn: WebSocket基础路径
      en: WebSocket Base Path
    Description:
      zh-cn: WebSocket API的基础路径,需以/开头。
      en: The base path of the WebSocket API, must start with /.
    Default: /ws
  DomainName:
    Type: String
    Label:
      zh-cn: 域名
      en: Domain Name
    Description:
      zh-cn: >-
        WebSocket服务的域名,例如ws.example.com。
        需已完成域名备案和DNS解析。
      en: >-
        The domain name for WebSocket service, e.g. ws.example.com.
        DNS resolution and ICP filing must be completed.
    AllowedPattern: '^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$'
  CertIdentifier:
    Type: String
    Label:
      zh-cn: SSL证书标识
      en: SSL Certificate Identifier
    Description:
      zh-cn: SSL证书的唯一标识,可在SSL证书服务控制台获取。证书需与域名匹配。
      en: >-
        The unique identifier of the SSL certificate.
        The certificate must match the domain name.
Resources:
  WebSocketApi:
    Type: ALIYUN::APIG::HttpApi
    Properties:
      HttpApiName:
        Ref: HttpApiName
      Type: WebSocket
      Protocols:
        - HTTPS
      BasePath:
        Ref: BasePath
      Description:
        Fn::Sub: WebSocket实时通信API - ${HttpApiName}
  Domain:
    Type: ALIYUN::APIG::Domain
    Properties:
      DomainName:
        Ref: DomainName
      Protocol: HTTPS
      CertIdentifier:
        Ref: CertIdentifier
      ForceHttps: true
      TlsMin: TLS 1.2
      TlsMax: TLS 1.3
      Http2Option: Open
Outputs:
  HttpApiId:
    Label:
      zh-cn: API ID
      en: API ID
    Value:
      Fn::GetAtt:
        - WebSocketApi
        - HttpApiId
  DomainId:
    Label:
      zh-cn: 域名ID
      en: Domain ID
    Value:
      Fn::GetAtt:
        - Domain
        - DomainId
  DomainName:
    Label:
      zh-cn: 域名
      en: Domain Name
    Value:
      Fn::GetAtt:
        - Domain
        - DomainName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "创建WebSocket API并配置HTTPS安全域名,实现安全的实时通信服务。",
    "en": "Create a WebSocket API with an HTTPS domain for secure real-time communication."
  },
  "Parameters": {
    "HttpApiName": {
      "Type": "String",
      "Label": {
        "zh-cn": "API名称",
        "en": "API Name"
      },
      "Description": {
        "zh-cn": "WebSocket API的名称,长度为1~64个字符。",
        "en": "The name of the WebSocket API, 1 to 64 characters."
      },
      "MinLength": 1,
      "MaxLength": 64,
      "AssociationProperty": "AutoCompleteInput",
      "AssociationPropertyMetadata": {
        "Length": 5,
        "Prefix": "ws-api-",
        "CharacterClasses": [
          {
            "Class": "lowercase",
            "min": 1
          }
        ]
      },
      "Default": "ws-api"
    },
    "BasePath": {
      "Type": "String",
      "Label": {
        "zh-cn": "WebSocket基础路径",
        "en": "WebSocket Base Path"
      },
      "Description": {
        "zh-cn": "WebSocket API的基础路径,需以/开头。",
        "en": "The base path of the WebSocket API, must start with /."
      },
      "Default": "/ws"
    },
    "DomainName": {
      "Type": "String",
      "Label": {
        "zh-cn": "域名",
        "en": "Domain Name"
      },
      "Description": {
        "zh-cn": "WebSocket服务的域名,例如ws.example.com。需已完成域名备案和DNS解析。",
        "en": "The domain name for WebSocket service, e.g. ws.example.com. DNS resolution and ICP filing must be completed."
      },
      "AllowedPattern": "^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$"
    },
    "CertIdentifier": {
      "Type": "String",
      "Label": {
        "zh-cn": "SSL证书标识",
        "en": "SSL Certificate Identifier"
      },
      "Description": {
        "zh-cn": "SSL证书的唯一标识,可在SSL证书服务控制台获取。证书需与域名匹配。",
        "en": "The unique identifier of the SSL certificate. The certificate must match the domain name."
      }
    }
  },
  "Resources": {
    "WebSocketApi": {
      "Type": "ALIYUN::APIG::HttpApi",
      "Properties": {
        "HttpApiName": {
          "Ref": "HttpApiName"
        },
        "Type": "WebSocket",
        "Protocols": [
          "HTTPS"
        ],
        "BasePath": {
          "Ref": "BasePath"
        },
        "Description": {
          "Fn::Sub": "WebSocket实时通信API - ${HttpApiName}"
        }
      }
    },
    "Domain": {
      "Type": "ALIYUN::APIG::Domain",
      "Properties": {
        "DomainName": {
          "Ref": "DomainName"
        },
        "Protocol": "HTTPS",
        "CertIdentifier": {
          "Ref": "CertIdentifier"
        },
        "ForceHttps": true,
        "TlsMin": "TLS 1.2",
        "TlsMax": "TLS 1.3",
        "Http2Option": "Open"
      }
    }
  },
  "Outputs": {
    "HttpApiId": {
      "Label": {
        "zh-cn": "API ID",
        "en": "API ID"
      },
      "Value": {
        "Fn::GetAtt": [
          "WebSocketApi",
          "HttpApiId"
        ]
      }
    },
    "DomainId": {
      "Label": {
        "zh-cn": "域名ID",
        "en": "Domain ID"
      },
      "Value": {
        "Fn::GetAtt": [
          "Domain",
          "DomainId"
        ]
      }
    },
    "DomainName": {
      "Label": {
        "zh-cn": "域名",
        "en": "Domain Name"
      },
      "Value": {
        "Fn::GetAtt": [
          "Domain",
          "DomainName"
        ]
      }
    }
  }
}