All Products
Search
Document Center

API Gateway:CreateHttpApi

Last Updated:Feb 05, 2026
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Creates an HTTP API.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
apig:CreateHttpApicreate
*HttpApi
acs:apig:{#regionId}:{#accountId}:httpapi/*
    none
none

Request syntax

POST /v1/http-apis HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

$.parameters[0].schema.properties.ingressConfig.enumValueTitles

namestringYes

$.parameters[0].schema.example

test-api
descriptionstringNo

$.parameters[0].schema.properties.aiProtocols.items.description

$.parameters[0].schema.properties.aiProtocols.items.example
protocolsarrayNo

$.parameters[0].schema.properties.aiProtocols.description

stringNo

$.parameters[0].schema.properties.aiProtocols.enumValueTitles

HTTP
basePathstringNo

$.parameters[0].schema.properties.deployConfigs.items.example

/v1
versionConfigHttpApiVersionConfigNo

$.parameters[0].schema.properties.deployConfigs.items.enumValueTitles

typestringNo

$.parameters[0].schema.properties.deployConfigs.description

Http
ingressConfigobjectNo

$.parameters[0].schema.properties.deployConfigs.example

environmentIdstringNo

$.parameters[0].schema.properties.deployConfigs.enumValueTitles

env-cq146allhtgk***
sourceIddeprecatedstringNo

$.parameters[0].schema.properties.enableAuth.description

src-crdddallhtgtr***
ingressClassstringNo

$.parameters[0].schema.properties.enableAuth.example

mse
watchNamespacestringNo

$.parameters[0].schema.properties.enableAuth.enumValueTitles

default
overrideIngressIpbooleanNo

$.parameters[0].schema.properties.authConfig.description

false
clusterIdstringNo

Cluster ID.

k7v5eobfzttudni2pw***
resourceGroupIdstringNo

$.parameters[0].schema.properties.authConfig.example

rg-xxx
aiProtocolsarrayNo

$.parameters[0].schema.properties.authConfig.enumValueTitles

stringNo

$.parameters[0].schema.description

OpenAI/v1
agentProtocolsarrayNo

Agent protocols

stringNo

string

http/https
deployConfigsarrayNo

$.parameters[0].schema.example

HttpApiDeployConfigNo

$.parameters[0].schema.enumValueTitles

enableAuthbooleanNo

Create an API of HTTP type

true
authConfigAuthConfigNo

The request parameters for API creation.

modelCategorystringNo

Model category

llm/text-to-image
removeBasePathOnForwardbooleanNo

Whether to remove base path when forwarding

true
firstByteTimeoutintegerNo

First byte timeout

30

Response parameters

ParameterTypeDescriptionExample
object

The API name.

requestIdstring

The API description.

A1994B10-C6A8-58FA-8347-6A08B0D4EFDE
codestring

API for testing

Ok
messagestring

The protocol list for API access.

success
dataobject

A protocol.

httpApiIdstring

HTTP API ID。

api-xxx
namestring

The API base path, which must start with a forward slash (/).

test-api

Examples

Sample success responses

JSONformat

{
  "requestId": "A1994B10-C6A8-58FA-8347-6A08B0D4EFDE",
  "code": "Ok",
  "message": "success",
  "data": {
    "httpApiId": "api-xxx",
    "name": "test-api"
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2025-07-17The internal configuration of the API is changed, but the call is not affectedView Change Details
2025-06-26The internal configuration of the API is changed, but the call is not affectedView Change Details
2025-04-25The internal configuration of the API is changed, but the call is not affectedView Change Details
2025-01-02The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-11-20The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-11-18The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-09-06The internal configuration of the API is changed, but the call is not affectedView Change Details