Create a service

更新时间:
复制 MD 格式

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.

    • Large Model Supplier: Select a provider. Supported providers include Alibaba Cloud Bailian, 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.

      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).

      Note

      When the Endpoint Mode for Bedrock is set to Mantle, only the Anthropic-compatible protocol (/v1/messages) is supported. The OpenAI/v1 protocol is not supported, and the Prompt Caching feature cannot be enabled.

    • Service URL (base_url): 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.

      The service address format for the Azure provider is: https://{endpoint}/openai/deployments/{deployment-id}/chat/completions?api-version={api-version}
      The service address format for an OpenAI Compatible service is: http://{endpoint}/v1

      The following table provides configuration examples for each provider.

      Provider

      Service address

      Available models

      Configuration

      Alibaba Cloud Model Studio

      https://dashscope.aliyuncs.com/compatible-mode/v1

      qwen-max, qwen-plus, qwen-turbo, qwen-long, qwen-vl-max, qwen-vl-plus, qwen-vl-ocr, deepseek-r1, deepseek-v3

      Select a Model Studio Region. You can switch between multiple regions.

      Bedrock

      https://bedrock-runtime.{awsRegion}.amazonaws.com

      No presets (enter the model name manually)

      Configure the awsRegion, Endpoint Mode (Runtime or Mantle), and authentication method (API key or AK/SK). Mantle mode supports only the Anthropic-compatible protocol.

      Vertex AI

      User-defined

      No presets

      Configure the Authentication Method (GCP Service Account or Vertex AI Express Mode). In GCP mode, enter the GCP Service Account Key in JSON format. The vertexProjectId is parsed automatically.

      Azure

      https://{endpoint}?api-version={api-version}

      gpt-3, gpt-35-turbo, gpt-4, gpt-4o, gpt-4o-mini

      The endpoint is the access point address for your Azure OpenAI resource.

      OpenAI

      https://api.openai.com/v1

      gpt-3, gpt-35-turbo, gpt-4, gpt-4o, gpt-4o-mini

      OpenAI Compatible

      http://{endpoint}/v1

      No presets (enter the model name manually)

      Supports only AI services that comply with the OpenAI API standard.

      DeepSeek

      https://api.deepseek.com/v1

      deepseek-chat, deepseek-reasoner

      Doubao

      https://ark.cn-beijing.volces.com/api/v3

      doubao-seed-1-6-250615, doubao-seed-1-6-flash-250715, doubao-seed-1-6-thinking-250715, doubao-1-5-thinking-vision-pro-250428

      Gemini

      https://generativelanguage.googleapis.com/v1beta/openai

      gemini-1.5-flash, gemini-1.5-pro

      MiniMax

      https://api.minimaxi.com/v1

      abab6.5s, abab6.5g, abab6.5t, abab5.5s

      Moonshot AI

      https://api.moonshot.cn/v1

      moonshot-v1-8k, moonshot-v1-32k, moonshot-v1-128k

      Zhipu AI

      https://open.bigmodel.cn/api/paas/v4

      GLM-4-Plus, GLM-4-0520, GLM-4-Long, GLM-4-AirX, GLM-4-Air, GLM-4-FlashX, GLM-4-Flash, GLM-4-AllTools, GLM-4

      PAI-EAS

      Automatically retrieved after you select a Workspace and an EAS Service.

      No presets (dynamically fetched)

      You must select a Workspace, an EAS Service, and a Connection Type (private or public network). The API key is obtained automatically and does not require manual configuration.

      Claude

      https://api.anthropic.com

      claude-3-5-sonnet-latest, claude-3-5-haiku-latest, claude-3-opus-latest

      You can optionally enable Use Claude Code OAuth Token for compatibility with Claude Code client calls.

      Baichuan

      https://api.baichuan-ai.com/v1

      Baichuan4-Turbo, Baichuan4-Air, Baichuan4, Baichuan3-Turbo, Baichuan3-Turbo-128k, Baichuan2-Turbo

      Yi

      https://api.lingyiwanwu.com/v1

      yi-lightning, yi-large, yi-medium, yi-medium-200k, yi-spark, yi-large-rag, yi-large-fc, yi-large-turbo

      Hunyuan

      https://hunyuan.tencentcloudapi.com

      hunyuan-turbo-latest, hunyuan-turbo, hunyuan-large, hunyuan-pro, hunyuan-standard-256K, hunyuan-standard, hunyuan-lite

      StepFun

      https://api.stepfun.com

      step-1-8k, step-1-32k, step-1-128k, step-1-256k, step-2-16k, step-1-flash

      Spark

      https://spark-api-open.xf-yun.com

      lite, generalv3, pro-128k, generalv3.5, max-32k, 4.0Ultra

    • API key: The API key credential required to access the large model service. After you select a Large Model Supplier, obtain the key as follows:

      • Alibaba Cloud Model Studio: Go to the Alibaba Cloud Model Studio consoleAlibaba Cloud Model Studio console to obtain it.

      • PAI-EAS: The API key is automatically obtained after you select a Workspace and an EAS Service. No manual configuration is required.

      • Bedrock: If you use API key mode, you can reference a KMS key or enter the key manually. If using AK/SK mode, you must provide the awsAccessKey and awsSecretKey.

      • Other providers: Go to the respective provider's platform to obtain the API key, or contact the service provider for assistance.

  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 Alibaba Cloud Bailian, 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

      • API Endpoint: Enter the endpoint address of the agent service. The default is https://dashscope.aliyuncs.com/api/v1.

      • APP ID and API key: You can obtain the application ID and API key from the Alibaba Cloud Model Studio console.

        On the API Key Management page, click the My tab to view your API key list. Click Create My API-KEY in the upper-right corner to create a new API key. To view the full key, click View in the Actions column for an existing API key.

      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.