Create a service

Updated at:

You must add your existing services to AI Gateway to register them as routable backend endpoints, which allows the gateway to discover service addresses. AI Gateway supports adding services such as container services, fixed addresses, DNS domain names, and Function Compute (FC).

Procedure

AI Gateway dynamically detects changes to backend resources, which enables unified management of traffic routing, governance, and security. AI Gateway supports creating AI services, agent services, DNS domain names, fixed addresses, container services, SAE Kubernetes services, Function Compute (FC), and MSE Nacos services.

AI service

  1. Log on to the AI Gateway console. On the gateway list page, select the region where your instance is located and click the instance ID. In the left-side navigation pane, click Service, and then click Create Service.

  2. In the Create Service panel, configure the following parameters:

    • Service Source: Select AI Services.

    • Service Name: Enter a custom name for the service.

    • Associate Provider: Select an existing provider from the drop-down list. The drop-down displays all providers available in the current instance (both built-in and custom providers). After selecting a provider, you can quickly associate the model resources under that provider. A provider identifies the large model vendor to which a model or service belongs, making it easier to track Credits consumption and costs by provider later on.

    • Provider Configuration Template: Select a pre-configured template for connecting to AI model services. Supported templates include Qwen Cloud / Alibaba Cloud Model Studio, PAI-EAS, DeepSeek, Compatibility with OpenAI, OpenAI, Azure, Gemini, Bedrock, Claude, Dark side of the Moon, Baichuan Intelligence, Zero One Everything, Intelligent Spectrum AI, Mixed Element, Step Star, Spark, Doubao, and MiniMax. The Provider Configuration Template is independent from the Provider resource and has no association with it.

      Important

      The large model capabilities offered through this AI service are not provided directly by AI Gateway. Before using these services, you are responsible for evaluating their suitability and reliability. Ensure that your use of the services complies with all applicable laws, regulations, and product terms of use. We are not liable for any consequences that arise from non-compliance.

    • Model Protocol: Select the protocol for communicating with the service. Supported protocols are OpenAI/v1 and native protocol. After you select a provider, the system populates a default value, which you can modify as needed.

      • OpenAI/v1: Uses the OpenAI-compatible protocol, which is suitable for most providers.

      • Native protocol: Uses the provider's native API protocol. When you select this option, the service address automatically updates to the corresponding native protocol endpoint (for example, https://dashscope.aliyuncs.com for Alibaba Cloud Model Studio).

    • Service Endpoint: The base URL of the large model service. After you select a provider, the system automatically populates the corresponding service address. You can also manually modify it if needed.

    • API key: The API key credential required to access the large model service.

  3. After you configure the parameters, click OK.

Agent service

  1. Log on to the AI Gateway console. On the gateway list page, select the region where your instance is located and click the instance ID. In the left-side navigation pane, click Service, and then click Create Service.

  2. In the Create Service panel, configure the following parameters:

    • Service Source: Select Service Source.

    • Service Name: Enter a custom name for the service.

    • Service Provider: Select Qwen Cloud / Alibaba Cloud Model Studio, Dify, or Custom.

      Important

      The agent capabilities offered through this agent service are not provided directly by AI Gateway. Before using these services, you are responsible for evaluating their suitability and reliability. Ensure that your use of the services complies with all applicable laws, regulations, and product terms of use. We are not liable for any consequences that arise from non-compliance.

      Alibaba Cloud Model Studio

      Dify

      • API Endpoint: Enter the endpoint address for the agent service. The default is https://api.dify.ai/v1.

      • Application Type: Select Agent or Workflow.

        • Agent: An agent application type.

        • Workflow: A workflow application type.

      • API key: Obtain the key from the service provider.

      Custom

      • API Endpoint: Enter the endpoint address of the agent service.

      • API key: Obtain the key from the service provider.

  3. After you configure the parameters, click OK.

DNS domain name

Note

AI Gateway can use the results of DNS resolution as backend service addresses.

  1. Log on to the AI Gateway console. On the gateway list page, select the region where your instance is located and click the instance ID. In the left-side navigation pane, click Service, and then click Create Service.

  2. In the Create Service panel, configure the following parameters:

    • Service Source: Select Domain Name.

    • Service Name: Enter a custom name for the service.

    • Service URL: The addresses of the backend nodes for the service. Backend nodes differ for services from different sources. The format is <DNS domain name>:<service port>. You can enter multiple addresses, separated by a comma ,.

      Important

      If you specify a public IP address, you must configure a NAT Gateway.

    • TLS Mode: Disabled by default.

      • Close: TLS is not required to access the service.

      • One-way TLS: Enable this option to access the service over HTTPS.

      • mTLS: Enable this option for mutual TLS authentication.

  3. After you configure the parameters, click OK.

Fixed address

Note

If a service does not have a discovery mechanism, you must manually add the backend endpoint addresses.

  1. Log on to the AI Gateway console. On the gateway list page, select the region where your instance is located and click the instance ID. In the left-side navigation pane, click Service, and then click Create Service.

  2. In the Create Service panel, configure the following parameters:

    • Service Source: Select Fixed Address.

    • Service Name: Enter a custom name for the service.

    • Service URL: The backend node addresses of the service. The backend nodes vary depending on the service source. The format is <IP>:<Service Port>. You can enter multiple addresses, separated by a comma ,.

      Important

      If you specify a public IP address, you must configure a NAT Gateway.

    • TLS Mode: Disabled by default.

      • Close: TLS is not required to access the service.

      • One-way TLS: Enable this option to access the service over HTTPS.

      • mTLS: Enable this option for mutual TLS authentication.

  3. After you configure the parameters, click OK.

Container service

Note

When you add a container service as a service source, the gateway retrieves the service list and backend endpoints from the specified ACK or ACK Serverless cluster.

  1. Log on to the AI Gateway console. Select the region where your instance is located and click the instance ID. In the left-side navigation pane, click Service.

  2. Create a source

    1. Click the Source tab, and then click Create Source. In the Create Source panel, configure the following parameters:

      • Source Type: Select ACK to discover backend services by using a Kubernetes server.

      • ACK/ACS/ACK Serverless cluster: Select the cluster where the backend service is located.

        Important
        • If no ACK, ACS, or ACK Serverless cluster exists in the current Virtual Private Cloud (VPC), you must first create an ACK managed cluster and then select that cluster.

        • To add a service source from another VPC, you must create a gateway instance in that VPC before you can select the cluster.

        • A single gateway instance can be associated with a maximum of three ACK container services.

        • AI Gateway can add Nacos or ACK sources only from within the same VPC. Adding service sources across VPCs is not supported.

    2. After you configure the parameters, click OK.

  3. Create a service

    1. Click the Service tab, and then click Create Source. In the Create Source panel, configure the following parameters:

      • Service Source: Select ACK.

        The gateway retrieves the service list from the ACK or ACK Serverless cluster and adds the services and their backend endpoints to the gateway.
      • Namespace: Select the namespace of the cluster. By default, services in the arms-prom, kube-system, and mse-pilot namespaces are not displayed.

      • Services: Select a service from the list. By default, services with names that start with consumers are not displayed.

    2. After you configure the parameters, click OK.

SAE Kubernetes service

Important

When you add an SAE Kubernetes service as a service source, you must enable K8s Service registration and discovery for the SAE application.

  1. Log on to the AI Gateway console. On the gateway list page, select the region where your instance is located and click the instance ID. In the left-side navigation pane, click Service, and then click Create Service.

  2. In the Create Service panel, configure the following parameters:

    • Service Source: SAE Kubernetes service. The SAE application must have service access configured by using the K8s ServiceName.

    • Namespace: Select the namespace of the cluster. By default, services in the arms-prom, kube-system, and mse-pilot namespaces are not displayed.

    • Services: Select a service from the list. By default, services with names that start with consumers: are not displayed.

  3. After you configure the parameters, click OK.

Function Compute (FC)

Important

Only Function Compute 3.0 is supported. Service sources from Function Compute 2.0 are not supported.

  1. Log on to the AI Gateway console. On the gateway list page, select the region where your instance is located and click the instance ID. In the left-side navigation pane, click Service, and then click Create Service.

  2. In the Create Service panel, configure the following parameters:

    • Service Source: Function Compute.

    • Function list: Select a function from the list.

    • Version or alias: Select the version or alias of the function.

  3. After you configure the parameters, click OK.

MSE Nacos

  1. Log on to the AI Gateway console. Select the region where your instance is located and click the instance ID. In the left-side navigation pane, click Service.

  2. Create a source

    1. Click the Source tab, and then click Create Source. In the Create Source panel, configure the following parameters:

      • Source Type: Select MSE Nacos to discover backend services by using an MSE Nacos service registry.

      • Nacos cluster: Select a Nacos cluster.

        Important
        • If no MSE Nacos cluster exists in the current VPC, you must first create an MSE Nacos cluster and then select it.

        • To add a service source from another VPC, you must create a gateway instance in that VPC before you can select the Nacos cluster.

        • The cluster list displays only MSE Nacos instances for which MCPEnabled = true is set. You can change this in the MSE Nacos parameter settings.

        • A single gateway instance can be associated with only one Nacos cluster.

    2. After you configure the parameters, click OK.

  3. Create a service

    1. Click the Service tab, and then click Create Service. In the Create Service panel, configure the following parameters:

      • Service Source: Select MSE Nacos.

        The gateway retrieves the service list from the Nacos cluster and adds the services and their backend endpoints to the gateway.
      • Namespace: Select a namespace. By default, services in the arms-prom, kube-system, and mse-pilot namespaces are not displayed.

      • Services: Select a service from the list. By default, services with names that start with consumers: are not displayed.

    2. After you configure the parameters, click OK.